Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ


Choose your language

InfoQ Homepage News Azure Application Insights for Node.js Hits 1.0

Azure Application Insights for Node.js Hits 1.0

Leia em Português

This item in japanese

At Node.js Interactive North America, Microsoft announced the general availability of the Application Insights for Node.js SDK.

In a blog post announcing the release, Microsoft's Arunesh Chandra, Sr. program manager for JavaScript Platform and Tools, says that Microsoft is "committed to enabling great experiences for developers building and running Node.js apps on Azure."

The SDK allows Node.js developers to gather a wide swath of data about their applications, from performance metrics to dependency tracking to console logging. Like the SDKs for other languages, by default the Node version tracks HTTP requests, system metrics, and unhandled exceptions. Developers can manually track their own custom telemetry:

let appInsights = require("applicationinsights");
appInsights.setup().start(); // assuming ikey in env var. start() can be omitted to disable any non-custom data
let client = appInsights.defaultClient;
client.trackEvent({name: "my custom event", properties: {customProperty: "custom property value"}});
client.trackException({exception: new Error("handled exceptions can be logged with this method")});
client.trackMetric({name: "custom metric", value: 3});
client.trackTrace({message: "trace message"});
client.trackDependency({target:"http://dbname", name:"select customers proc", data:"SELECT * FROM Customers", duration:231, resultCode:0, success: true, dependencyTypeName: "ZSQL"});
client.trackRequest({name:"GET /customers", url:"http://myserver/customers", duration:309, resultCode:200, success:true});

Code taken from the project's README.

While much of the 1.0 release is stability and performance enhancements, it does provide more Application Map functionality out of the box. Now, dependencies like Redis, MongoDB, and PostgreSQL can be automatically included in the Application Map. This release also adds automatic instrumentation support for the popular winston logging framework.

There were a few breaking changes, mostly related to function and type renaming. The SDK is an open source project on GitHub.

The news is good for those developers on Microsoft's Azure cloud and those who require a stable release before deploying to production. In recent years, the Node.js community has warmed to Microsoft and their software and services as they continue to contribute to open source. Application Insights became generally available in November 2016 and the addition of full support for Node.js closes a big gap in their product offering.

Rate this Article