Comments (12)
@prateekkathal @jcbit Thank you for raising this issue. A fix PR has already been merged and will be available in the next release: #1312.
from applicationinsights-node.js.
@JacksonWeber Thanks, that makes sense. I wish there was a way to just stop the package from emitting out these logs until a "DEBUG" flag was turned on for example.
These extra logs are not useful for many developers directly using this SDK. Maybe something you can add in the release pipeline?
As far as this issue is concerned though, you can mark it as resolved. Have a good one!
from applicationinsights-node.js.
@jcbit Can I take a look at your package.json file and your code you use to initialize Application Insights?
Also make sure that you're not calling client.track()
in your code, only specific track methods (ex: client.trackDependency()
) are supported by Application Insights 3.X SDK.
from applicationinsights-node.js.
Seeing the same issue when using trackException()
Envelopes could not be exported and are not retriable. Error message: [
'Error "body.data.baseData.ver cannot be null or undefined." occurred in serializing the payload - "body".'
]
My code is a simple:
try {
// Running code...
} catch (e) {
appInsights.defaultClient.trackException({ exception: e, severity: appInsights.KnownSeverityLevel.Error });
}
Even if I manually override - exception: new Error('Test')
, I still see the same error.
from applicationinsights-node.js.
@JacksonWeber Thank you for the fix. I tested v3.0.1 and it works as expected.
However, I finding these warning logs being emitted as well (also reported in #1316):
@azure/opentelemetry-instrumentation-azure-sdk [
'Module @azure/core-tracing has been loaded before @azure/opentelemetry-instrumentation-azure-sdk so it might not work, please initialize it before requiring @azure/core-tracing'
]
Accessing resource attributes before async attributes settled []
My code looks like this:
appInsights
.setup(connectionString)
.setAutoCollectRequests(false)
.setAutoCollectPerformance(false, false)
.setAutoCollectExceptions(false)
.setAutoCollectDependencies(false)
.setAutoCollectConsole(false)
.setUseDiskRetryCaching(false)
.setSendLiveMetrics(false)
.start();
this.client = appInsights.defaultClient;
this.client.setAutoPopulateAzureProperties();
Also, if I don't use the set
config functions above after setup
, I see even more warnings like these:
Invalid metric name: "\ASP.NET Applications(??APP_W3SVC_PROC??)\Request Execution Time". The metric name should be a ASCII string with a length no greater than 255 characters. []
Invalid metric name: "\ASP.NET Applications(??APP_W3SVC_PROC??)\Requests/Sec". The metric name should be a ASCII string with a length no greater than 255 characters. []
Invalid metric name: "\Process(??APP_WIN32_PROC??)\Private Bytes". The metric name should be a ASCII string with a length no greater than 255 characters. []
Invalid metric name: "\Memory\Available Bytes". The metric name should be a ASCII string with a length no greater than 255 characters. []
Invalid metric name: "\Processor(_Total)\% Processor Time". The metric name should be a ASCII string with a length no greater than 255 characters. []
Invalid metric name: "\Process(??APP_WIN32_PROC??)\% Processor Time". The metric name should be a ASCII string with a length no greater than 255 characters. []
Accessing resource attributes before async attributes settled []
Accessing resource attributes before async attributes settled []
Not sure if this requires a fix? Will be great if you can confirm though. Maybe something I am doing wrong?
from applicationinsights-node.js.
@prateekkathal To address each of these:
- Regarding the warning about @azure/core-tracing being logged. The discussion here goes into detail about how you can ignore it if you wish, and it won't impact functionality for you.
- The invalid metric names are the performance counters in Application Insights. OpenTelemetry complains about their metric names as they have spaces, but performance counter functionality is not impacted. The reason removing your config caused these warnings is that you had disabled performance counters in your custom config, but they're configured on by default.
Please let me know if you have any other concerns.
from applicationinsights-node.js.
I'm still facing this issue. I've audited my code for .track
and only see these methods used:
trackEvent
trackException
trackTrace
trackNodeHttpRequest
And I appear to be using the app insights version with the patch (v3.0.1):
I have also modified my config to match #1310 (comment).
Yet I'm still getting the errors below... did I miss anything?
Envelopes could not be exported and are not retriable. Error message: [
'Error "body.data.baseData.ver cannot be null or undefined." occurred in serializing the payload - "body".'
]
{"stack":"Error: Error \"body.data.baseData.ver cannot be null or undefined.\" occurred in serializing the payload - \"body\".\n at serializeRequestBody (/Users/kuech/Repositories/monorepo/api/node_modules/@azure/core-client/src/serializationPolicy.ts:200:13)\n at Object.sendRequest (/Users/kuech/Repositories/monorepo/api/node_modules/@azure/core-client/src/serializationPolicy.ts:58:9)\n at /Users/kuech/Repositories/monorepo/api/node_modules/@azure/core-rest-pipeline/src/pipeline.ts:170:25\n at HttpPipeline.sendRequest (/Users/kuech/Repositories/monorepo/api/node_modules/@azure/core-rest-pipeline/src/pipeline.ts:176:12)\n at ApplicationInsightsClient.sendRequest (/Users/kuech/Repositories/monorepo/api/node_modules/@azure/core-client/src/serviceClient.ts:125:26)\n at ApplicationInsightsClient.sendOperationRequest (/Users/kuech/Repositories/monorepo/api/node_modules/@azure/core-client/src/serviceClient.ts:207:38)\n at ApplicationInsightsClient.track (/Users/kuech/Repositories/monorepo/api/node_modules/@azure/monitor-opentelemetry-exporter/dist/index.js:1834:21)\n at HttpSender.send (/Users/kuech/Repositories/monorepo/api/node_modules/@azure/monitor-opentelemetry-exporter/dist/index.js:2800:38)\n at HttpSender.exportEnvelopes (/Users/kuech/Repositories/monorepo/api/node_modules/@azure/monitor-opentelemetry-exporter/dist/index.js:2589:55)\n at /Users/kuech/Repositories/monorepo/api/node_modules/@azure/monitor-opentelemetry-exporter/dist/index.js:3864:47\n at AsyncLocalStorage.run (node:async_hooks:346:14)\n at AsyncLocalStorageContextManager.with (/Users/kuech/Repositories/monorepo/api/node_modules/@opentelemetry/context-async-hooks/src/AsyncLocalStorageContextManager.ts:40:36)\n at ContextAPI.with (/Users/kuech/Repositories/monorepo/api/node_modules/@opentelemetry/api/src/api/context.ts:77:42)\n at AzureMonitorLogExporter.export (/Users/kuech/Repositories/monorepo/api/node_modules/@azure/monitor-opentelemetry-exporter/dist/index.js:3863:31)\n at /Users/kuech/Repositories/monorepo/api/node_modules/@opentelemetry/core/src/internal/exporter.ts:36:22\n at AsyncLocalStorage.run (node:async_hooks:346:14)","message":"Error \"body.data.baseData.ver cannot be null or undefined.\" occurred in serializing the payload - \"body\".","name":"Error"} []
from applicationinsights-node.js.
@chriskuech Please make sure to use version 3.0.1 of the Application Insights SDK as 3.0.0 has an issue with the manual track methods from incorrect serialization of the log body. Let me know if that version works for you.
from applicationinsights-node.js.
@JacksonWeber yes that package.json screenshot is from within my node_modules
folder to confirm I'm running v3.0.1.
from applicationinsights-node.js.
@chriskuech Not seeing any similar errors on my end with trackEvent
, trackException
or trackTrace
. However, trackNodeHttpRequest
isn't supported in versions 3.0.0 or higher. Can I take a look at one of your example track methods that's throwing that error for you?
from applicationinsights-node.js.
Interesting. I restarted the upgrade fresh and removed the trackNodeHttpRequest
and no longer have an issue. Sorry for the churn--feel free to close.
from applicationinsights-node.js.
@chriskuech No worries! Always appreciate folks reporting issues, thanks for taking the time to report!
from applicationinsights-node.js.
Related Issues (20)
- 3.0.0-beta.11 - has no exported member 'Context' HOT 19
- App insights customDimension parsing differently locally vs in Azure. HOT 1
- [Beta] - Nested objects get serialised as "[object Object]" again HOT 11
- [FEATURE] At startup, send all locally stored traces instead of waiting the first batch + some time HOT 8
- Importing Application Insights library in ES6 module import format doesn't work HOT 3
- Invalid metric name: The metric name should be a ASCII string with a length no greater than 255 characters. HOT 2
- @azure/opentelemetry-instrumentation-azure-sdk [ 'Module @azure/core-tracing has been loaded before @azure/opentelemetry-instrumentation-azure-sdk so it might not work, please initialize it before requiring @azure/core-tracing' ] HOT 2
- trackTrace no longer working since this week HOT 1
- TrackEvent no longer reporting Measurements HOT 3
- Unable to integrate with Winston logger HOT 5
- Bunyan logger problems HOT 7
- _APPRESOURCEPREVIEW_ appearing in metrics when upgrading from 2.x to 3.0.1 HOT 5
- customMetrics problems HOT 2
- Upgrade 2.x to 3.0.1 startup warnings HOT 3
- [BUG] Custom proxy with error "Expecting a valid host string in proxy settings, but found" HOT 2
- [BUG] Custom proxy with error "Expecting a valid host string in proxy settings, but found" HOT 1
- "applicationinsights 3.1.0" is not compatible with the "@azure/functions 4.5.0" HOT 1
- Correlation between Frontend and Backend.
- Severitylevel does not work
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from applicationinsights-node.js.