3
votes

I've read documents in Azure (https://docs.microsoft.com/en-us/azure/azure-monitor/app/api-custom-events-metrics#debug) But couldn't see how to enable Developer Mode for application insights.

How can I enable Developer Mode in Azure Application Insights for node.js?

3

3 Answers

3
votes

Developer Mode in the .NET Application Insights SDK does a couple of things, primarily enabling debug messages and disabling batching of telemetry.

While the Node SDK doesn’t have a single setting that does this, you can get the same behavior by using both of the following settings together:

appInsights.setup(...).setInternalLogging(true, true) to enable debug messages

appInsights.defaultClient.config.maxBatchSize = 1 to disable batching

For the second command, make sure to replace appInsights.defaultClient for your own TelemetryClient instance if you've instantiated your own.

2
votes

According to the official doc (https://docs.microsoft.com/en-us/azure/azure-monitor/app/api-custom-events-metrics#debug), currently, Developer Mode for application insights is only supported in C# and Visual Basic

2
votes

As per the source code here:

enter image description here

Then in your code, you should use the code as below:

const appInsights = require("applicationinsights");
appInsights.setup("<instrumentation_key>").setInternalLogging(true, true);
appInsights.start();