JSPM

  • Created
  • Published
  • Downloads 1166244
  • Score
    100M100P100Q181358F
  • License MIT

Microsoft Application Insights module for Node.JS

Package Exports

  • applicationinsights

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (applicationinsights) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Application Insights for Node.js

Node is a popular, lightweight platform for building fast and scalable network applications. This project extends Application Insights API surface to support Node.js. Application Insights is a service that allows developers to keep their application available, performing and succeeding. This node module will automatically send request telemetry and exceptions and logs for requests to the Application Insights service where they can be visualized in the Azure Portal.

Set-Up

Access to the source code is available from GitHub.

To use the Node Request Monitoring Module, you need an Application Insights Resource. The Application Insights Resource has an instrumentation key (iKey) that is unique to your application for monitoring.

If your Node site is running as an Azure Website, an Application Insights resource already exists for your application. See part one if your Node site is an Azure website, or part two if your Node site is not an Azure website.

Installing From Node Package Manager

Navigate to the folder where you want to install the module then open a command window and type:

npm install applicationinsights

After you install the node package, it will create new folder called node_modules and a new folder called applicationinsights within that folder. It will also create an ai.config.json file where you will manually insert your instrumentation key or iKey (detailed in steps 3 and 4 below). Depending on what you want to track, you need to specify that you want to use the module in your project using a require statement:

require('applicationinsights');

Part One (Node site running as an Azure website)

Coming soon

Part Two (Node site running as a NON-Azure website)

Creating an Application Insights resource in the Azure Portal

  1. First, create a new Application Insights resource in the Azure portal by clicking New --> Application Insights.

  2. Enter a name for your new AI project and click create. A new tile will appear on your dashboard.

  3. Expand your app by clicking on the tile on your dashboard, then click on the Properties tile to open your application's Properties blade to obtain the instrumentation key (iKey). Click on the clipboard next to the iKey to copy it.

  4. Copy and paste your iKey into the iKey variable in your ai.config.json file.

  5. Run your application and generate a request.

  6. Return to your project tile in the Azure Portal and you can view your requests in the Requests tile in your application's blade. (In my example, you can see that I have generate 10 requests and it took 1 ms to process them).