Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

applicationinsights

Package Overview
Dependencies
Maintainers
1
Versions
153
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

applicationinsights

Microsoft Application Insights module for Node.js

  • 3.0.0-beta.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
272K
decreased by-55.95%
Maintainers
1
Weekly downloads
 
Created

What is applicationinsights?

The applicationinsights npm package is a powerful tool for monitoring and diagnosing performance issues in your applications. It provides a range of features for collecting telemetry data, tracking custom events, and monitoring dependencies, among other capabilities.

What are applicationinsights's main functionalities?

Telemetry Client

The Telemetry Client allows you to track custom events and metrics. This example demonstrates how to set up the client and track a custom event.

const appInsights = require('applicationinsights');
appInsights.setup('YOUR_INSTRUMENTATION_KEY').start();
const client = appInsights.defaultClient;
client.trackEvent({ name: 'my custom event', properties: { customProperty: 'custom value' } });

Request Tracking

Request Tracking automatically collects and sends telemetry data for incoming HTTP requests. This example shows how to set up a basic HTTP server with request tracking enabled.

const appInsights = require('applicationinsights');
appInsights.setup('YOUR_INSTRUMENTATION_KEY').start();
const http = require('http');
http.createServer((req, res) => {
  res.writeHead(200, { 'Content-Type': 'text/plain' });
  res.end('Hello World\n');
}).listen(8080);

Dependency Tracking

Dependency Tracking allows you to monitor the performance and success of external dependencies. This example demonstrates how to manually track a dependency.

const appInsights = require('applicationinsights');
appInsights.setup('YOUR_INSTRUMENTATION_KEY').start();
const client = appInsights.defaultClient;
client.trackDependency({ target: 'http://example.com', name: 'GET /', data: 'http://example.com', duration: 100, resultCode: 200, success: true });

Exception Tracking

Exception Tracking captures and sends telemetry data for exceptions. This example shows how to track an exception.

const appInsights = require('applicationinsights');
appInsights.setup('YOUR_INSTRUMENTATION_KEY').start();
const client = appInsights.defaultClient;
try {
  throw new Error('Test error');
} catch (e) {
  client.trackException({ exception: e });
}

Other packages similar to applicationinsights

Keywords

FAQs

Package last updated on 27 Mar 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc