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

@microsoft/applicationinsights-core-js

Package Overview
Dependencies
Maintainers
2
Versions
581
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@microsoft/applicationinsights-core-js

Microsoft Application Insights Core Javascript SDK

  • 3.3.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
684K
decreased by-0.9%
Maintainers
2
Weekly downloads
 
Created

What is @microsoft/applicationinsights-core-js?

@microsoft/applicationinsights-core-js is a core library for Application Insights, which is a part of the Azure Monitor suite. It provides the essential functionalities for collecting and sending telemetry data from your applications to Azure Monitor. This package is typically used as a base for other Application Insights SDKs and can be extended to include additional telemetry features.

What are @microsoft/applicationinsights-core-js's main functionalities?

Initialization

This code demonstrates how to initialize the Application Insights core library with a given instrumentation key. This is the first step to start collecting telemetry data.

const { ApplicationInsights } = require('@microsoft/applicationinsights-core-js');
const appInsights = new ApplicationInsights({ config: {
  instrumentationKey: 'YOUR_INSTRUMENTATION_KEY'
}});
appInsights.loadAppInsights();

Custom Events

This code shows how to track custom events. Custom events can be used to log specific actions or occurrences in your application.

appInsights.trackEvent({ name: 'myCustomEvent', properties: { customProperty: 'customValue' } });

Custom Metrics

This code demonstrates how to track custom metrics. Custom metrics can be used to log numerical data points that are important for your application.

appInsights.trackMetric({ name: 'myCustomMetric', average: 42 });

Exception Tracking

This code shows how to track exceptions. Exception tracking is useful for logging errors and understanding the issues occurring in your application.

try {
  throw new Error('Test error');
} catch (e) {
  appInsights.trackException({ exception: e });
}

Other packages similar to @microsoft/applicationinsights-core-js

Keywords

FAQs

Package last updated on 30 Oct 2024

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