egiray
egiray

Reputation: 1209

How to run Azure Application Insights in developer mode for Javascript (node.js)

I've read documents in Azure (https://learn.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?

Upvotes: 3

Views: 5135

Answers (3)

Osvaldo Rosado
Osvaldo Rosado

Reputation: 451

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.

Upvotes: 4

Ivan Glasenberg
Ivan Glasenberg

Reputation: 30035

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();

Upvotes: 2

Minwoo Jung
Minwoo Jung

Reputation: 127

According to the official doc (https://learn.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

Upvotes: 2

Related Questions