Quick Note:
If you are only missing some telemetry like users and sessions, make sure that you have client side code in addition to your server side code:
How to get things working
Here is the basic setup for a minimalistic Application Insights setup with Node.js:
- Quickstart: Create a Node.js web app in Azure
https://learn.microsoft.com/en-us/azure/app-service/quickstart-nodejs?pivots=platform-windows - Monitor your Node.js services and apps with Application Insights
https://learn.microsoft.com/en-us/azure/azure-monitor/app/nodejs
Key points:
- Be sure to run: npm install applicationinsights --save
- Be sure to include this in your code: let appInsights = require('applicationinsights');
For this, I modified the line of code above using a great blog from Kenichiro Nakamura
which has the following:
const appInsights = require("applicationinsights");
appInsights.setup("<instrumentation_key>");
appInsights.start();
Kenichiro's blog is a great resource and I would recommend reading it in addition to the documentation:
https://dev.to/kenakamu/application-insights-sdk-for-node-js-3ki1
You will see something like this:
Troubleshooting
If things aren't working out the way you expect them to, there is a troubleshooting guide for Application Insights that addresses many of the common issues:
ASP.NET troubleshooting (includes some generic troubleshooting tips):
https://learn.microsoft.com/en-us/azure/azure-monitor/app/asp-net-troubleshoot-no-data
If you are still running into issues, message us and let us know. We will ask you for some information so that we can further investigate things on our end.