applicationinsights

  • Version 3.2.1
  • Published
  • 746 kB
  • 22 dependencies
  • MIT license

Install

npm i applicationinsights
yarn add applicationinsights
pnpm add applicationinsights

Overview

Microsoft Application Insights module for Node.js

Index

Variables

Functions

Classes

Interfaces

Enums

Namespaces

Variables

variable defaultClient

let defaultClient: TelemetryClient;
  • The default client, initialized when setup was called. To initialize a different client with its own configuration, use new TelemetryClient(instrumentationKey?).

Functions

function dispose

dispose: () => void;
  • Disposes the default client and all the auto collectors so they can be reinitialized with different configuration

function getCorrelationContext

getCorrelationContext: () => ICorrelationContext;
  • Returns an object that is shared across all code handling a given request. This can be used similarly to thread-local storage in other languages. Properties set on this object will be available to telemetry processors.

    Do not store sensitive information here. Custom properties set on this object can be exposed in a future SDK release via outgoing HTTP headers. This is to allow for correlating data cross-component.

    This method will return null if automatic dependency correlation is disabled.

    Returns

    A plain object for request storage or null if automatic dependency correlation is disabled.

function setup

setup: (setupString?: string) => typeof Configuration;
  • Initializes the default client. Should be called after setting configuration options.

    Parameter setupString

    the Connection String or Instrumentation Key to use. Optional, if this is not specified, the value will be read from the environment variable APPLICATIONINSIGHTS_CONNECTION_STRING or APPINSIGHTS_INSTRUMENTATIONKEY.

    Returns

    {Configuration} the configuration class to initialize and start the SDK.

function shutdownAzureMonitor

shutdownAzureMonitor: () => Promise<void>;
  • Shutdown Azure Monitor

function start

start: () => typeof Configuration;
  • Starts automatic collection of telemetry. Prior to calling start no telemetry will be *automatically* collected, though manual collection is enabled.

    Returns

    {ApplicationInsights} this class

function startOperation

startOperation: (
arg1:
| azureFunctionsTypes.Context
| (http.IncomingMessage | azureFunctionsTypes.HttpRequest)
| SpanContext
| Span,
arg2?: HttpRequest | string
) => ICorrelationContext | null;
  • **(Experimental!)** Starts a fresh context or propagates the current internal one.

function useAzureMonitor

useAzureMonitor: (options?: AzureMonitorOpenTelemetryOptions) => void;
  • Initialize Azure Monitor

    Parameter options

    Configuration

function wrapWithCorrelationContext

wrapWithCorrelationContext: <T>(fn: T, context?: ICorrelationContext) => T;
  • Returns a function that will get the same correlation context within its function body as the code executing this function. Use this method if automatic dependency correlation is not propagating correctly to an asynchronous callback.

Classes

class Configuration

class Configuration {}
  • The active configuration for global SDK behaviors, such as auto collection.

property start

static start: () => typeof Configuration;

    method enableWebInstrumentation

    static enableWebInstrumentation: (
    value: boolean,
    WebSnippetConnectionString?: string
    ) => typeof Configuration;
    • Sets the state of Web snippet injection

      Parameter value

      if true Web snippet will try to be injected in server response

      Parameter WebSnippetConnectionString

      if provided, Web snippet injection will use this ConnectionString. Default to use the connectionString in Node.js app initialization.

      Returns

      {Configuration} this class

    method setAutoCollectConsole

    static setAutoCollectConsole: (
    value: boolean,
    collectConsoleLog?: boolean
    ) => typeof Configuration;
    • Sets the state of console and logger tracking (enabled by default for third-party loggers only)

      Parameter value

      if true logger activity will be sent to Application Insights

      Parameter collectConsoleLog

      if true, logger autocollection will include console.log calls (default false)

      Returns

      {Configuration} this class

    method setAutoCollectDependencies

    static setAutoCollectDependencies: (value: boolean) => typeof Configuration;
    • Sets the state of dependency tracking (enabled by default)

      Parameter value

      if true dependencies will be sent to Application Insights

      Returns

      {Configuration} this class

    method setAutoCollectExceptions

    static setAutoCollectExceptions: (value: boolean) => typeof Configuration;
    • Sets the state of exception tracking (enabled by default)

      Parameter value

      if true uncaught exceptions will be sent to Application Insights

      Returns

      {Configuration} this class

    method setAutoCollectHeartbeat

    static setAutoCollectHeartbeat: (value: boolean) => typeof Configuration;
    • Sets the state of request tracking (enabled by default)

      Parameter value

      if true HeartBeat metric data will be collected every 15 minutes and sent to Application Insights

      Returns

      {Configuration} this class

    method setAutoCollectIncomingRequestAzureFunctions

    static setAutoCollectIncomingRequestAzureFunctions: (
    value: boolean
    ) => typeof Configuration;
    • Enable automatic incoming request tracking when using Azure Functions

      Parameter value

      if true auto collection of incoming requests will be enabled

      Returns

      {Configuration} this class

    method setAutoCollectPerformance

    static setAutoCollectPerformance: (
    value: boolean,
    collectExtendedMetrics: any
    ) => typeof Configuration;
    • Sets the state of performance tracking (enabled by default)

      Parameter value

      if true performance counters will be collected every second and sent to Application Insights

      Parameter collectExtendedMetrics

      if true, extended metrics counters will be collected every minute and sent to Application Insights

      Returns

      {Configuration} this class

    method setAutoCollectPreAggregatedMetrics

    static setAutoCollectPreAggregatedMetrics: (
    value: boolean
    ) => typeof Configuration;
    • Sets the state of pre aggregated metrics tracking (enabled by default)

      Parameter value

      if true pre aggregated metrics will be collected every minute and sent to Application Insights

      Returns

      {Configuration} this class

    method setAutoCollectRequests

    static setAutoCollectRequests: (value: boolean) => typeof Configuration;
    • Sets the state of request tracking (enabled by default)

      Parameter value

      if true requests will be sent to Application Insights

      Returns

      {Configuration} this class

    method setAutoDependencyCorrelation

    static setAutoDependencyCorrelation: (
    value: boolean,
    useAsyncHooks?: boolean
    ) => typeof Configuration;
    • Sets the state of automatic dependency correlation (enabled by default)

      Parameter value

      if true dependencies will be correlated with requests

      Parameter useAsyncHooks

      if true, forces use of experimental async_hooks module to provide correlation. If false, instead uses only patching-based techniques. If left blank, the best option is chosen for you based on your version of Node.js.

      Returns

      {Configuration} this class

    method setDistributedTracingMode

    static setDistributedTracingMode: (value: number) => typeof Configuration;
    • Only W3C traing mode is currently suppported so this method informs the user if they attempt to set the value.

    method setInternalLogging

    static setInternalLogging: (
    enableDebugLogger?: boolean,
    enableWarningLogger?: boolean
    ) => typeof Configuration;
    • Enables debug and warning Logger for AppInsights itself.

      Parameter enableDebugLogger

      if true, enables debug Logger

      Parameter enableWarningLogger

      if true, enables warning Logger

      Returns

      {Configuration} this class

    method setSendLiveMetrics

    static setSendLiveMetrics: (enable?: boolean) => typeof Configuration;
    • Enables communication with Application Insights Live Metrics.

      Parameter enable

      if true, enables communication with the live metrics service

    method setUseDiskRetryCaching

    static setUseDiskRetryCaching: (
    value: boolean,
    resendInterval?: number,
    maxBytesOnDisk?: number
    ) => typeof Configuration;
    • Enable or disable disk-backed retry caching to cache events when client is offline (enabled by default) Note that this method only applies to the default client. Disk-backed retry caching is disabled by default for additional clients. For enable for additional clients, use client.channel.setUseDiskRetryCaching(true). These cached events are stored in your system or user's temporary directory and access restricted to your user when possible.

      Parameter value

      if true events that occured while client is offline will be cached on disk

      Parameter resendInterval

      The wait interval for resending cached events.

      Parameter maxBytesOnDisk

      The maximum size (in bytes) that the created temporary directory for cache events can grow to, before caching is disabled.

      Returns

      {Configuration} this class

    class TelemetryClient

    class TelemetryClient {}
    • Application Insights telemetry client provides interface to track telemetry items, register telemetry initializers and and manually trigger immediate sending (flushing)

    constructor

    constructor(input?: string);
    • Constructs a new instance of TelemetryClient

      Parameter setupString

      the Connection String or Instrumentation Key to use (read from environment variable if not specified)

    property commonProperties

    commonProperties: { [key: string]: string };

      property config

      config: Config;

        property context

        context: Context;

          method addTelemetryProcessor

          addTelemetryProcessor: (
          telemetryProcessor: (
          envelope: Envelope,
          contextObjects?: { [name: string]: any }
          ) => boolean
          ) => void;
          • Adds telemetry processor to the collection. Telemetry processors will be called one by one before telemetry item is pushed for sending and in the order they were added.

            Parameter telemetryProcessor

            function, takes Envelope, and optional context object and returns boolean

          method clearTelemetryProcessors

          clearTelemetryProcessors: () => void;

            method flush

            flush: () => Promise<void>;
            • Immediately send all queued telemetry.

            method getAuthorizationHandler

            getAuthorizationHandler: (config: Config) => void;
            • Get Authorization handler

            method getStatsbeat

            getStatsbeat: () => any;

              method initialize

              initialize: () => void;

                method pushWarningToLog

                pushWarningToLog: (warning: string) => void;

                  method setAutoPopulateAzureProperties

                  setAutoPopulateAzureProperties: () => void;
                  • Automatically populate telemetry properties like RoleName when running in Azure

                    Parameter value

                    if true properties will be populated

                  method setUseDiskRetryCaching

                  setUseDiskRetryCaching: (
                  value: boolean,
                  resendInterval?: number,
                  maxBytesOnDisk?: number
                  ) => void;

                    method shutdown

                    shutdown: () => Promise<void>;
                    • Shutdown client

                    method track

                    track: (
                    telemetry: Contracts.Telemetry,
                    telemetryType: Contracts.TelemetryType
                    ) => void;
                    • Generic track method for all telemetry types

                      Parameter data

                      the telemetry to send

                      Parameter telemetryType

                      specify the type of telemetry you are tracking from the list of Contracts.DataTypes

                    method trackAvailability

                    trackAvailability: (telemetry: Contracts.AvailabilityTelemetry) => void;
                    • Log information about availability of an application

                      Parameter telemetry

                      Object encapsulating tracking options

                    method trackDependency

                    trackDependency: (telemetry: Contracts.DependencyTelemetry) => void;
                    • Log a dependency. Note that the default client will attempt to collect dependencies automatically so only use this for dependencies that aren't automatically captured or if you've disabled automatic dependency collection.

                      Parameter telemetry

                      Object encapsulating tracking option

                    method trackEvent

                    trackEvent: (telemetry: Contracts.EventTelemetry) => void;
                    • Log a user action or other occurrence.

                      Parameter telemetry

                      Object encapsulating tracking options

                    method trackException

                    trackException: (telemetry: Contracts.ExceptionTelemetry) => void;
                    • Log an exception

                      Parameter telemetry

                      Object encapsulating tracking options

                    method trackMetric

                    trackMetric: (
                    telemetry: Contracts.MetricPointTelemetry & Contracts.MetricTelemetry
                    ) => void;
                    • Log a numeric value that is not associated with a specific event. Typically used to send regular reports of performance indicators. To send a single measurement, use just the first two parameters. If you take measurements very frequently, you can reduce the telemetry bandwidth by aggregating multiple measurements and sending the resulting average at intervals.

                      Parameter telemetry

                      Object encapsulating tracking options

                    method trackNodeHttpDependency

                    trackNodeHttpDependency: (telemetry: Contracts.NodeHttpRequestTelemetry) => void;

                      method trackNodeHttpRequest

                      trackNodeHttpRequest: (telemetry: Contracts.NodeHttpRequestTelemetry) => void;

                        method trackNodeHttpRequestSync

                        trackNodeHttpRequestSync: (
                        telemetry: Contracts.NodeHttpRequestTelemetry
                        ) => void;

                          method trackPageView

                          trackPageView: (telemetry: Contracts.PageViewTelemetry) => void;
                          • Log a page view

                            Parameter telemetry

                            Object encapsulating tracking options

                          method trackRequest

                          trackRequest: (telemetry: Contracts.RequestTelemetry) => void;
                          • Log a request. Note that the default client will attempt to collect HTTP requests automatically so only use this for requests that aren't automatically captured or if you've disabled automatic request collection.

                            Parameter telemetry

                            Object encapsulating tracking options

                          method trackTrace

                          trackTrace: (telemetry: Contracts.TraceTelemetry) => void;
                          • Log a trace message

                            Parameter telemetry

                            Object encapsulating tracking options

                          Interfaces

                          interface AvailabilityTelemetry

                          interface AvailabilityTelemetry extends Telemetry {}
                          • Telemetry type used for availability web test results.

                          property duration

                          duration: number;
                          • Request duration in ms

                          property id

                          id: string;
                          • Identifier of a test run. Use it to correlate steps of test run and telemetry generated by the service.

                          property measurements

                          measurements?: {
                          [key: string]: number;
                          };
                          • Metrics associated with this event, displayed in Metrics Explorer on the portal.

                          property message

                          message: string;
                          • Diagnostic message for the result.

                          property name

                          name: string;
                          • Name of the test that these availability results represent.

                          property runLocation

                          runLocation: string;
                          • Name of the location where the test was run from.

                          property success

                          success: boolean;
                          • Success flag.

                          interface AzureMonitorOpenTelemetryOptions

                          interface AzureMonitorOpenTelemetryOptions extends DistroOptions {}
                          • Azure Monitor OpenTelemetry Options

                          property enableAutoCollectExceptions

                          enableAutoCollectExceptions?: boolean;
                          • Sets the state of exception tracking (enabled by default) if true uncaught exceptions will be sent to Application Insights

                          property enableAutoCollectPerformance

                          enableAutoCollectPerformance?: boolean;
                          • Sets the state of performance tracking (enabled by default) if true performance counters will be collected every second and sent to Azure Monitor

                          property otlpLogExporterConfig

                          otlpLogExporterConfig?: OTLPExporterConfig;
                          • OTLP Log Exporter Configuration

                          property otlpMetricExporterConfig

                          otlpMetricExporterConfig?: OTLPExporterConfig;
                          • OTLP Metric Exporter Configuration

                          property otlpTraceExporterConfig

                          otlpTraceExporterConfig?: OTLPExporterConfig;
                          • OTLP Trace Exporter Configuration

                          interface EventTelemetry

                          interface EventTelemetry extends Telemetry {}
                          • Telemetry about the custom event of interest, such application workflow event, business logic event (purchase) and anything that you would like to track and aggregate by count. Event can contain measurements such as purchase amount associated with purchase event

                          property measurements

                          measurements?: {
                          [key: string]: number;
                          };
                          • Metrics associated with this event, displayed in Metrics Explorer on the portal.

                          property name

                          name: string;
                          • Name of the event

                          interface ExceptionTelemetry

                          interface ExceptionTelemetry extends Telemetry {}
                          • Telemetry about the exception thrown by the application

                          property exception

                          exception: Error;
                          • Exception thrown

                          property measurements

                          measurements?: {
                          [key: string]: number;
                          };
                          • Metrics associated with this exception, displayed in Metrics Explorer on the portal. Defaults to empty

                          property severity

                          severity?: SeverityLevel;
                          • Exception severity level

                          interface HttpRequest

                          interface HttpRequest {}
                          • HTTP request object. Provided to your function when using HTTP Bindings.

                          property headers

                          headers: {
                          [key: string]: string;
                          };

                            property method

                            method: string | null;

                              property url

                              url: string;

                                interface InstrumentationOptions

                                interface InstrumentationOptions extends DistroInstrumentationOptions {}

                                  property console

                                  console?: InstrumentationConfig & {
                                  logSendingLevel?: SeverityNumber;
                                  };
                                  • Console Instrumentation Config

                                  interface PageViewTelemetry

                                  interface PageViewTelemetry extends Telemetry {}
                                  • Telemetry type used for availability web test results.

                                  property duration

                                  duration?: number;
                                  • Request duration in milliseconds.

                                  property id

                                  id: string;
                                  • Identifier of a page view instance. Used for correlation between page view and other telemetry items.

                                  property measurements

                                  measurements?: {
                                  [propertyName: string]: number;
                                  };
                                  • Collection of custom measurements.

                                  property name

                                  name: string;
                                  • Event name. Keep it low cardinality to allow proper grouping and useful metrics.

                                  property referredUri

                                  referredUri?: string;
                                  • Fully qualified page URI or URL of the referring page; if unknown, leave blank

                                  property url

                                  url?: string;
                                  • Request URL with all query string parameters

                                  interface Telemetry

                                  interface Telemetry {}
                                  • Base telemetry interface encapsulating coming properties

                                  property properties

                                  properties?: {
                                  [key: string]: any;
                                  };
                                  • Additional data used to filter events and metrics in the portal. Defaults to empty.

                                  property time

                                  time?: Date;
                                  • Telemetry time stamp. When it is not specified, current timestamp will be used.

                                  interface TraceTelemetry

                                  interface TraceTelemetry extends Telemetry {}
                                  • Trace telemetry reports technical, usually detailed information about the environment, usage of resources, performance, capacity etc

                                  property measurements

                                  measurements?: {
                                  [propertyName: string]: number;
                                  };
                                  • Collection of custom measurements.

                                  property message

                                  message: string;
                                  • Trace message

                                  property severity

                                  severity?: SeverityLevel;
                                  • Trace severity level.

                                  Enums

                                  enum DistributedTracingModes

                                  enum DistributedTracingModes {
                                  AI = 0,
                                  AI_AND_W3C = 1,
                                  }

                                    member AI

                                    AI = 0
                                    • Send Application Insights correlation headers

                                    member AI_AND_W3C

                                    AI_AND_W3C = 1
                                    • (Default) Send both W3C Trace Context headers and back-compatibility Application Insights headers

                                    enum KnownSeverityLevel

                                    enum KnownSeverityLevel {
                                    Verbose = 'Verbose',
                                    Information = 'Information',
                                    Warning = 'Warning',
                                    Error = 'Error',
                                    Critical = 'Critical',
                                    }

                                    member Critical

                                    Critical = 'Critical'

                                      member Error

                                      Error = 'Error'

                                        member Information

                                        Information = 'Information'

                                          member Verbose

                                          Verbose = 'Verbose'

                                            member Warning

                                            Warning = 'Warning'

                                              Namespaces

                                              namespace Contracts

                                              module 'out/src/declarations/contracts/index.d.ts' {}

                                                interface AvailabilityTelemetry

                                                interface AvailabilityTelemetry extends Telemetry {}
                                                • Telemetry type used for availability web test results.

                                                property duration

                                                duration: number;
                                                • Request duration in ms

                                                property id

                                                id: string;
                                                • Identifier of a test run. Use it to correlate steps of test run and telemetry generated by the service.

                                                property measurements

                                                measurements?: {
                                                [key: string]: number;
                                                };
                                                • Metrics associated with this event, displayed in Metrics Explorer on the portal.

                                                property message

                                                message: string;
                                                • Diagnostic message for the result.

                                                property name

                                                name: string;
                                                • Name of the test that these availability results represent.

                                                property runLocation

                                                runLocation: string;
                                                • Name of the location where the test was run from.

                                                property success

                                                success: boolean;
                                                • Success flag.

                                                interface DependencyTelemetry

                                                interface DependencyTelemetry extends Telemetry {}
                                                • Telemetry about the call to remote component

                                                property data

                                                data?: string;
                                                • Command initiated by this dependency call. Examples are SQL statement and HTTP URL with all query parameters.

                                                property dependencyTypeName

                                                dependencyTypeName?: string;
                                                • Dependency type name. Very low cardinality value for logical grouping of dependencies and interpretation of other fields like commandName and resultCode. Examples are SQL, Azure table, and HTTP.

                                                property duration

                                                duration: number;
                                                • Remote call duration in ms.

                                                property id

                                                id?: string;
                                                • Identifier of a dependency call instance. Used for correlation with the request telemetry item corresponding to this dependency call.

                                                property measurements

                                                measurements?: {
                                                [propertyName: string]: number;
                                                };
                                                • Collection of custom measurements.

                                                property name

                                                name: string;
                                                • Name of the command initiated with this dependency call. Low cardinality value. Examples are stored procedure name and URL path template.

                                                property resultCode

                                                resultCode?: string | number;
                                                • Result code of a dependency call. Examples are SQL error code and HTTP status code.

                                                property success

                                                success?: boolean;
                                                • Indication of successful or unsuccessful call.

                                                property target

                                                target?: string;
                                                • Target site of a dependency call. Examples are server name, host address.

                                                interface EventTelemetry

                                                interface EventTelemetry extends Telemetry {}
                                                • Telemetry about the custom event of interest, such application workflow event, business logic event (purchase) and anything that you would like to track and aggregate by count. Event can contain measurements such as purchase amount associated with purchase event

                                                property measurements

                                                measurements?: {
                                                [key: string]: number;
                                                };
                                                • Metrics associated with this event, displayed in Metrics Explorer on the portal.

                                                property name

                                                name: string;
                                                • Name of the event

                                                interface ExceptionTelemetry

                                                interface ExceptionTelemetry extends Telemetry {}
                                                • Telemetry about the exception thrown by the application

                                                property exception

                                                exception: Error;
                                                • Exception thrown

                                                property measurements

                                                measurements?: {
                                                [key: string]: number;
                                                };
                                                • Metrics associated with this exception, displayed in Metrics Explorer on the portal. Defaults to empty

                                                property severity

                                                severity?: SeverityLevel;
                                                • Exception severity level

                                                interface MetricPointTelemetry

                                                interface MetricPointTelemetry {}

                                                  property count

                                                  count?: number;
                                                  • The number of samples used to get this value

                                                  property kind

                                                  kind?: DataPointType;
                                                  • Type of metric being sent, e.g. Pre-agg metrics have kind=Aggregation

                                                  property max

                                                  max?: number;
                                                  • The max sample for this set

                                                  property min

                                                  min?: number;
                                                  • The min sample for this set

                                                  property name

                                                  name: string;
                                                  • A string that identifies the metric.

                                                  property namespace

                                                  namespace?: string;
                                                  • A string that identifies the metric namespace.

                                                  property stdDev

                                                  stdDev?: number;
                                                  • The standard deviation of the set

                                                  property value

                                                  value: number;
                                                  • The value of the metric

                                                  interface MetricTelemetry

                                                  interface MetricTelemetry extends Telemetry {}
                                                  • Telemetry encapsulating a custom metric, i.e. aggregated numeric values describing value, count, frequency and distribution of of a particular indicator.

                                                  property metrics

                                                  metrics?: MetricPointTelemetry[];
                                                  • List of metrics. Only one metric in the list is currently supported by Application Insights storage. If multiple data points were sent only the first one will be used.

                                                  interface NodeHttpDependencyTelemetry

                                                  interface NodeHttpDependencyTelemetry extends Telemetry {}
                                                  • Object encapsulating information about the outgoing request

                                                  property options

                                                  options: string | URL | http.RequestOptions | https.RequestOptions;
                                                  • Request options that will be used to instrument outgoing request

                                                  property request

                                                  request: http.ClientRequest;
                                                  • Outgoing HTTP request object

                                                  interface NodeHttpRequestTelemetry

                                                  interface NodeHttpRequestTelemetry extends Telemetry {}
                                                  • Object encapsulating information about the incoming HTTP request

                                                  property duration

                                                  duration?: number;
                                                  • HTTP request duration. Used only for synchronous tracks.

                                                  property error

                                                  error?: any;
                                                  • Error that occurred while processing the request. Used only for synchronous tracks.

                                                  property request

                                                  request: http.IncomingMessage;
                                                  • HTTP request object

                                                  property response

                                                  response: http.ServerResponse;
                                                  • HTTP response object

                                                  interface PageViewTelemetry

                                                  interface PageViewTelemetry extends Telemetry {}
                                                  • Telemetry type used for availability web test results.

                                                  property duration

                                                  duration?: number;
                                                  • Request duration in milliseconds.

                                                  property id

                                                  id: string;
                                                  • Identifier of a page view instance. Used for correlation between page view and other telemetry items.

                                                  property measurements

                                                  measurements?: {
                                                  [propertyName: string]: number;
                                                  };
                                                  • Collection of custom measurements.

                                                  property name

                                                  name: string;
                                                  • Event name. Keep it low cardinality to allow proper grouping and useful metrics.

                                                  property referredUri

                                                  referredUri?: string;
                                                  • Fully qualified page URI or URL of the referring page; if unknown, leave blank

                                                  property url

                                                  url?: string;
                                                  • Request URL with all query string parameters

                                                  interface RequestTelemetry

                                                  interface RequestTelemetry extends Telemetry {}
                                                  • Telemetry about the incoming request processed by the application

                                                  property duration

                                                  duration: number;
                                                  • Request duration in ms.

                                                  property id

                                                  id?: string;
                                                  • Identifier of a request call instance. Used for correlation between request and other telemetry items.

                                                  property measurements

                                                  measurements?: {
                                                  [propertyName: string]: number;
                                                  };
                                                  • Collection of custom measurements.

                                                  property name

                                                  name?: string;
                                                  • Name of the request. Represents code path taken to process request. Low cardinality value to allow better grouping of requests. For HTTP requests it represents the HTTP method and URL path template like 'GET /values/{id}'.

                                                  property resultCode

                                                  resultCode: string;
                                                  • Result of a request execution. HTTP status code for HTTP requests.

                                                  property success

                                                  success: boolean;
                                                  • Indication of successful or unsuccessful call.

                                                  property url

                                                  url?: string;
                                                  • Request URL with all query string parameters.

                                                  interface Telemetry

                                                  interface Telemetry {}
                                                  • Base telemetry interface encapsulating coming properties

                                                  property properties

                                                  properties?: {
                                                  [key: string]: any;
                                                  };
                                                  • Additional data used to filter events and metrics in the portal. Defaults to empty.

                                                  property time

                                                  time?: Date;
                                                  • Telemetry time stamp. When it is not specified, current timestamp will be used.

                                                  interface TraceTelemetry

                                                  interface TraceTelemetry extends Telemetry {}
                                                  • Trace telemetry reports technical, usually detailed information about the environment, usage of resources, performance, capacity etc

                                                  property measurements

                                                  measurements?: {
                                                  [propertyName: string]: number;
                                                  };
                                                  • Collection of custom measurements.

                                                  property message

                                                  message: string;
                                                  • Trace message

                                                  property severity

                                                  severity?: SeverityLevel;
                                                  • Trace severity level.

                                                  enum TelemetryType

                                                  enum TelemetryType {
                                                  Event = 0,
                                                  Exception = 1,
                                                  Trace = 2,
                                                  Metric = 3,
                                                  Request = 4,
                                                  Dependency = 5,
                                                  Availability = 6,
                                                  PageView = 7,
                                                  }
                                                  • Telemetry types supported by this SDK

                                                  member Availability

                                                  Availability = 6

                                                    member Dependency

                                                    Dependency = 5

                                                      member Event

                                                      Event = 0

                                                        member Exception

                                                        Exception = 1

                                                          member Metric

                                                          Metric = 3

                                                            member PageView

                                                            PageView = 7

                                                              member Request

                                                              Request = 4

                                                                member Trace

                                                                Trace = 2

                                                                  Package Files (20)

                                                                  Dependencies (22)

                                                                  Dev Dependencies (17)

                                                                  Peer Dependencies (0)

                                                                  No peer dependencies.

                                                                  Badge

                                                                  To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                  You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/applicationinsights.

                                                                  • Markdown
                                                                    [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/applicationinsights)
                                                                  • HTML
                                                                    <a href="https://www.jsdocs.io/package/applicationinsights"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>