Returns a value that indicates whether the instance has already been previously initialized.
-The current logger instance for this instance.
-ReadonlypluginThe formatted string of the installed plugins that contain a version number
-ReadonlypluginAn array of the installed plugins that provide a version
-Protected Optional_updateHook for Core extensions to allow them to update their own configuration before updating all of the plugins.
-The plugin update context
-The Update State
-boolean - True means the extension class will call updateState otherwise the Core will
-Watches and tracks status of initialization process
-ActiveStatus
-3.3.0 -If returned status is active, it means initialization process is completed. -If returned status is pending, it means the initialization process is waiting for promieses to be resolved. -If returned status is inactive, it means ikey is invalid or can 't get ikey or enpoint url from promsises.
-Adds a notification listener. The SDK calls methods on the listener when an appropriate notification is raised. -The added plugins must raise notifications. If the plugins do not implement the notifications, then no methods will be -called.
-An INotificationListener object.
-Add a new plugin to the installation
-The new plugin to add
-OptionalreplaceExisting: booleanshould any existing plugin be replaced, default is false
-OptionaldoAsync: booleanShould the add be performed asynchronously
-OptionaladdCb: ((added?: boolean) => void)[Optional] callback to call after the plugin has been added
-Optionaladded: booleanAdd a telemetry processor to decorate or drop telemetry events.
-The Telemetry Initializer function
-Add an unload handler that will be called when the SDK is being unloaded
-the handler
-Add this hook so that it is automatically removed during unloading
-The single hook or an array of IInstrumentHook objects
-Flush and send any batched / cached data immediately
-OptionalisAsync: booleanOptionalcallBack: ((flushComplete?: boolean) => void)if specified, notify caller when send is complete, the channel should return true to indicate to the caller that it will be called. -If the caller doesn't return true the caller should assume that it may never be called.
-OptionalflushComplete: booleanOptionalsendReason: SendRequestReasonspecify the reason that you are calling "flush" defaults to ManualFlush (1) if not specified
-Get the current cookie manager for this instance
-Get the current notification manager
-Get the current performance manager
-Return a new instance of the IProcessTelemetryContext for processing events
-Gets the current distributed trace context for this instance if available
-OptionalcreateNew: booleanOptional flag to create a new instance if one doesn't currently exist, defaults to true
-Initialize the sdk.
-The configuration to initialize the SDK.
-An array of extensions that are to be used by the core.
-Optionallogger: IDiagnosticLoggerOptionalnotificationManager: INotificationManagerWatches and tracks changes for accesses to the current config, and if the accessed config changes the -handler will be recalled.
-A watcher handler instance that can be used to remove itself when being unloaded
-ProtectedreleaseRemoves all instances of the listener.
-INotificationListener to remove.
-Set the current cookie manager for this instance
-The manager, if set to null/undefined will cause the default to be created
-Set the current performance manager
-The performance manager
-Sets the current distributed trace context for this instance if available
-Unload and Tear down the SDK and any initialized plugins, after calling this the SDK will be considered
-to be un-initialized and non-operational, re-initializing the SDK should only be attempted if the previous
-unload call return true stating that all plugins reported that they also unloaded, the recommended
-approach is to create a new instance and initialize that instance.
-This is due to possible unexpected side effects caused by plugins not supporting unload / teardown, unable
-to successfully remove any global references or they may just be completing the unload process asynchronously.
-If you pass isAsync as true (also the default) and DO NOT pass a callback function then an IPromise
-will be returned which will resolve once the unload is complete. The actual implementation of the IPromise
-will be a native Promise (if supported) or the default as supplied by ts-async library
OptionalisAsync: booleanCan the unload be performed asynchronously (default)
-OptionalunloadComplete: ((unloadState: ITelemetryUnloadState) => void)An optional callback that will be called once the unload has completed
-OptionalcbTimeout: numberAn optional timeout to wait for any flush operations to complete before proceeding with the -unload. Defaults to 5 seconds.
-Nothing or if occurring asynchronously a IPromise -which will be resolved once the unload is complete, the IPromise -will only be returned when no callback is provided and isAsync is true
-Update the configuration used and broadcast the changes to all loaded plugins
-The new configuration is apply
-OptionalmergeExisting: booleanShould the new configuration merge with the existing or just replace it. Default is to true.
-AbstractBaseTelemetryPlugin provides a basic implementation of the ITelemetryPlugin interface so that plugins -can avoid implementation the same set of boiler plate code as well as provide a base -implementation so that new default implementations can be added without breaking all plugins.
-Protected Optional_doTeardown / Unload hook to allow implementations to perform some additional unload operations before the BaseTelemetryPlugin -finishes it's removal.
-OptionalunloadCtx: IProcessTelemetryUnloadContextThis is the context that should be used during unloading.
-OptionalunloadState: ITelemetryUnloadStateThe details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.
-OptionalasyncCallback: (() => void)An optional callback that the plugin must call if it returns true to inform the caller that it has completed any async unload/teardown operations.
-boolean - true if the plugin has or will call asyncCallback, this allows the plugin to perform any asynchronous operations.
-Protected Optional_doExtension hook to allow implementations to perform some additional update operations before the BaseTelemetryPlugin finishes it's removal
-OptionalupdateCtx: IProcessTelemetryUpdateContextThis is the context that should be used during updating.
-OptionalupdateState: ITelemetryUpdateStateThe details / state of the update process, it holds details like the current and previous configuration.
-OptionalasyncCallback: (() => void)An optional callback that the plugin must call if it returns true to inform the caller that it has completed any async update operations.
-boolean - true if the plugin has or will call asyncCallback, this allows the plugin to perform any asynchronous operations.
-Protected_getHelper to return the current IProcessTelemetryContext, if the passed argument exists this just -returns that value (helps with minification for callers), otherwise it will return the configured -context or a temporary one.
-OptionalcurrentCtx: IProcessTelemetryContext[Optional] The current execution context
-Protected Readonly_unloadExposes the underlying unload hook container instance for this extension to allow it to be passed down to any sub components of the class. -This should NEVER be exposed or called publically as it's scope is for internal use by BaseTelemetryPlugin and any derived class (which is why -it's scoped as protected)
-Holds the core instance that was used during initialization
-Returns the current diagnostic logger that can be used to log issues, if no logger is currently -assigned a new default one will be created and returned.
-Extension name
-Returns whether the plugin has been initialized
-Priority of the extension
-Call back for telemetry processing before it it is sent
-This is the current event being reported
-This is the context for the current request, ITelemetryPlugin instances -can optionally use this to access the current core instance or define / pass additional information -to later plugins (vs appending items to the telemetry item)
-ProtectedsetInternal helper to allow setting of the internal initialized setting for inherited instances and unit testing
-Set next extension for telemetry processing
-OptionalversionPlugin version (available in data.properties.version in common schema)
-Protected_addAdd this hook so that it is automatically removed during unloading
-The single hook or an array of IInstrumentHook objects
-Protected_addAdd an unload handler that will be called when the SDK is being unloaded
-the handler
-Initialize plugin loaded by SDK
-The config for the plugin to use
-The current App Insights core to use for initializing this plugin instance
-The complete set of extensions to be used for initializing the plugin
-OptionalpluginChain: ITelemetryPluginChain[Optional] specifies the current plugin chain which identifies the -set of plugins and the order they should be executed for the current request.
-AbstractprocessCall back for telemetry processing before it it is sent
-This is the current event being reported
-OptionalitemCtx: IProcessTelemetryContextThis is the context for the current request, ITelemetryPlugin instances -can optionally use this to access the current core instance or define / pass additional information -to later plugins (vs appending items to the telemetry item)
-Tear down the plugin and remove any hooked value, the plugin should be removed so that it is no longer initialized and -therefore could be re-initialized after being torn down. The plugin should ensure that once this has been called any further -processTelemetry calls are ignored and it just calls the processNext() with the provided context.
-OptionalunloadCtx: IProcessTelemetryUnloadContextThis is the context that should be used during unloading.
-OptionalunloadState: ITelemetryUnloadStateThe details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.
-boolean - true if the plugin has or will call processNext(), this for backward compatibility as previously teardown was synchronous and returned nothing.
-The the plugin should re-evaluate configuration and update any cached configuration settings.
-This is the context that should be used during updating.
-The details / state of the update process, it holds details like the current and previous configuration.
-boolean - true if the plugin has or will call updateCtx.processNext(), this allows the plugin to perform any asynchronous operations.
-Optionalconfig: IConfigurationLogs a message to the internal queue.
-{LoggingSeverity} - The severity of the log message
-{_InternalLogMessage} - The message to log.
-This method will throw exceptions in debug mode or attempt to log the error as a console warning.
-{LoggingSeverity} - The severity of the log message
-Optionalproperties: ObjectOptionalisUserAct: booleanUnload and remove any state that this IDiagnosticLogger may be holding, this is generally called when the -owning SDK is being unloaded.
-OptionalisAsync: booleanCan the unload be performed asynchronously (default)
-If the unload occurs synchronously then nothing should be returned, if happening asynchronously then -the function should return an IPromise -/ Promise to allow any listeners to wait for the operation to complete.
-Function used to identify the get w parameter used to identify status bit to some channels
-Returns a value that indicates whether the instance has already been previously initialized.
-The current logger instance for this instance.
-ReadonlypluginThe formatted string of the installed plugins that contain a version number
-ReadonlypluginAn array of the installed plugins that provide a version
-Protected Optional_updateHook for Core extensions to allow them to update their own configuration before updating all of the plugins.
-The plugin update context
-The Update State
-boolean - True means the extension class will call updateState otherwise the Core will
-Watches and tracks status of initialization process
-ActiveStatus
-3.3.0 -If returned status is active, it means initialization process is completed. -If returned status is pending, it means the initialization process is waiting for promieses to be resolved. -If returned status is inactive, it means ikey is invalid or can 't get ikey or enpoint url from promsises.
-Adds a notification listener. The SDK calls methods on the listener when an appropriate notification is raised. -The added plugins must raise notifications. If the plugins do not implement the notifications, then no methods will be -called.
-An INotificationListener object.
-Add a new plugin to the installation
-The new plugin to add
-OptionalreplaceExisting: booleanshould any existing plugin be replaced, default is false
-OptionaldoAsync: booleanShould the add be performed asynchronously
-OptionaladdCb: ((added?: boolean) => void)[Optional] callback to call after the plugin has been added
-Optionaladded: booleanAdd a telemetry processor to decorate or drop telemetry events.
-The Telemetry Initializer function
-Add an unload handler that will be called when the SDK is being unloaded
-the handler
-Add this hook so that it is automatically removed during unloading
-The single hook or an array of IInstrumentHook objects
-Flush and send any batched / cached data immediately
-OptionalisAsync: booleanOptionalcallBack: ((flushComplete?: boolean) => void)if specified, notify caller when send is complete, the channel should return true to indicate to the caller that it will be called. -If the caller doesn't return true the caller should assume that it may never be called.
-OptionalflushComplete: booleanOptionalsendReason: SendRequestReasonspecify the reason that you are calling "flush" defaults to ManualFlush (1) if not specified
-Get the current cookie manager for this instance
-Get the current notification manager
-Get the current performance manager
-Return a new instance of the IProcessTelemetryContext for processing events
-Gets the current distributed trace context for this instance if available
-OptionalcreateNew: booleanOptional flag to create a new instance if one doesn't currently exist, defaults to true
-Optionallogger: IDiagnosticLoggerOptionalnotificationManager: INotificationManagerWatches and tracks changes for accesses to the current config, and if the accessed config changes the -handler will be recalled.
-A watcher handler instance that can be used to remove itself when being unloaded
-Enable the timer that checks the logger.queue for log messages to be flushed. -Note: Since 3.0.1 and 2.8.13 this is no longer an interval timer but is a normal -timer that is only started when this function is called and then subsequently -only if there are any logger.queue messages to be sent.
-OptionaleventName: stringProtectedreleaseRemoves all instances of the listener.
-INotificationListener to remove.
-Set the current cookie manager for this instance
-The manager, if set to null/undefined will cause the default to be created
-Set the current performance manager
-The performance manager
-Sets the current distributed trace context for this instance if available
-Unload and Tear down the SDK and any initialized plugins, after calling this the SDK will be considered
-to be un-initialized and non-operational, re-initializing the SDK should only be attempted if the previous
-unload call return true stating that all plugins reported that they also unloaded, the recommended
-approach is to create a new instance and initialize that instance.
-This is due to possible unexpected side effects caused by plugins not supporting unload / teardown, unable
-to successfully remove any global references or they may just be completing the unload process asynchronously.
-If you pass isAsync as true (also the default) and DO NOT pass a callback function then an IPromise
-will be returned which will resolve once the unload is complete. The actual implementation of the IPromise
-will be a native Promise (if supported) or the default as supplied by ts-async library
OptionalisAsync: booleanCan the unload be performed asynchronously (default)
-OptionalunloadComplete: ((unloadState: ITelemetryUnloadState) => void)An optional callback that will be called once the unload has completed
-OptionalcbTimeout: numberAn optional timeout to wait for any flush operations to complete before proceeding with the -unload. Defaults to 5 seconds.
-Nothing or if occurring asynchronously a IPromise -which will be resolved once the unload is complete, the IPromise -will only be returned when no callback is provided and isAsync is true
-Update the configuration used and broadcast the changes to all loaded plugins
-The new configuration is apply
-OptionalmergeExisting: booleanShould the new configuration merge with the existing or just replace it. Default is to true.
-Class to manage sending notifications to all the listeners.
-Optionalconfig: IConfigurationAdds a notification listener.
-The notification listener to be added.
-Notification for events being discarded.
-The array of events that have been discarded by the SDK.
-The reason for which the SDK discarded the events. The EventsDiscardedReason -constant should be used to check the different values.
-Optionalevents[Optional] A function called when the events have been requested to be sent to the sever.
-The reason why the event batch is being sent.
-A flag which identifies whether the requests are being sent in an async or sync manner.
-Notification for events sent.
-The array of events that have been sent.
-OptionalofflineOptionaloffline[Optional] A function called when the offline events have been sent from the persistent storage
-payload data that is sent from the persistent storage
-Optionaloffline[Optional] A function called when the offline events have been stored to the persistent storage
-events that are stored in the persistent storage
-Optionalperf[Optional] This event is sent if you have enabled perf events, they are primarily used to track internal performance testing and debugging -the event can be displayed via the debug plugin extension.
-Removes all instances of the listener.
-AWTNotificationListener to remove.
-OptionalunloadUnload and remove any state that this INotificationManager may be holding, this is generally called when the -owning SDK is being unloaded.
-OptionalisAsync: booleanCan the unload be performed asynchronously (default)
-If the unload occurs synchronously then nothing should be returned, if happening asynchronously then -the function should return an IPromise -/ Promise to allow any listeners to wait for the operation to complete.
-This interface identifies the details of an internal performance event - it does not represent an outgoing reported event
-StaticChildrenStaticParentMark this event as completed, calculating the total execution time.
-OptionalexIdentifies the exclusive time spent in for this event (not including child events), -this will be undefined until the event is completed.
-OptionalgetGet the names additional context associated with this perf event
-Is this occurring from an asynchronous event
-Identifies whether this event is a child event of a parent
-The name of the event
-The payload (contents) of the perfEvent, may be null or only set after the event has completed depending on -the runtime environment.
-OptionalsetSet the named additional context to be associated with this perf event, this will replace any existing value
-The start time of the event in ms
-OptionaltimeIdentifies the total inclusive time spent for this event, including the time spent for child events, -this will be undefined until the event is completed
-This defines an internal performance manager for tracking and reporting the internal performance of the SDK -- It does -not represent or report any event to the server.
-General bucket used for execution context set and retrieved via setCtx() and getCtx. -Defined as private so it can be visualized via the DebugPlugin
-Optionalmanager: INotificationManagerCreate a new event and start timing, the manager may return null/undefined to indicate that it does not -want to monitor this source event.
-The source name of the event
-Optionalpayload: anyOptionalisAsync: booleanIs the event occurring from a async event
-Complete the perfEvent and fire any notifications.
-Fire the event which will also complete the passed event
-This class will be removed!
-Creates a new Telemetry Item context with the current config, core and plugin execution chain
-The current config
-The current core instance
-OptionalstartAt: IPluginReturns the IAppInsightsCore instance for the current request
-Create a new context using the core and config from the current instance
-Optionalplugins: IPlugin[] | ITelemetryPluginChainThe execution order to process the plugins, if null or not supplied -then the current execution order will be copied.
-OptionalstartAt: IPluginThe plugin to start processing from, if missing from the execution -order then the next plugin will be NOT set.
-Returns the current IDiagnosticsLogger for the current request
-Gets the current core config instance
-Gets the named config from either the named identifier extension or core config if neither exist then the -default value is returned
-The named extension identifier
-The config field name
-OptionaldefaultValue: The default value to return if no defined config exists
-Gets the named extension config
-Returns the next configured plugin proxy
-Helper to allow inherited classes to check and possibly shortcut executing code only -required if there is a nextPlugin
-Synchronously iterate over the context chain running the callback for each plugin, once -every plugin has been executed via the callback, any associated onComplete will be called.
-Set the function to call when the current chain has executed all processNext or unloadNext items.
-Call back for telemetry processing before it it is sent
-This is the current event being reported
-boolean (true) if there is no more plugins to process otherwise false or undefined (void)
-Helper to set the next plugin proxy
-This interface is used during the serialization of events into envelope (serialized object) which is sent to the services, the format is defined via the -Common Schema 4.0 specification. The path and field names used are based on how the data is serialized -to the service (CS 4.0 location) and not specifically the location on the event object you pass into the track methods (unless they are the same).
-OptionalfieldSanitizerProvider: IFieldValueSanitizerProviderAdds a field sanitizer to the evaluation list
-Add a value sanitizer as a fallback sanitizer if this sanitizer can't handle the path/name.
-Clear the current value sanitizer cache.
-StaticgetReturns a bitwise value for the FieldValueSanitizerType enum representing the decoded type of the passed value
-The value to determine the type
-Does this field value sanitizer handle this path / field combination
-The field path
-The name of the field
-OptionalisReturns whether this ValueSanitizer is empty
-true if it contains no chained sanitizers or field sanitizers, otherwise false
Sanitizes the Property. It checks the that the property name and value are valid. It also -checks/populates the correct type and pii of the property value.
-The root path of the property
-The property name.
-The property value or an IEventProperty containing value, type ,pii and customer content.
-OptionalstringifyObjects: booleanIf supplied tells the sanitizer that it should JSON stringify() objects
-IEventProperty containing valid name, value, pii and type or null if invalid.
-Removes the field sanitizer to the evaluation list if present
-Removes the value sanitizer as a fallback sanitizer if this sanitizer can't handle the path/name if present.
-Sanitizes the value. It checks the that the property name and value are valid. It also -checks/populates the correct type and pii of the property value.
-The root path of the property
-The property name.
-The property value or an IEventProperty containing value, type ,pii and customer content.
-OptionalstringifyObjects: booleanIf supplied tells the sanitizer that it should JSON stringify() objects
-IEventProperty containing valid name, value, pii and type or null if invalid.
-OptionalisUserAct: booleanOptionalproperties: ObjectConstThe EventLatency contains a set of values that specify the latency with which an event is sent.
-Cost deferred latency. At the moment this latency is treated as Normal latency.
-Bypass normal batching/timing and send as soon as possible, this will still send asynchronously. -Added in v3.1.1
-Normal latency.
-Real time latency.
-ConstDefine a specific way to send an event synchronously
-Batch and send the event asynchronously, this is the same as either setting the event sync flag to false or not setting at all.
Attempt to send the event synchronously with a preference for the sendBeacon() API. -As per the specification, the payload of the event (when converted to JSON) must not be larger than 64kb, -the sendHook is also not supported or used when sendBeacon.
-Attempt to send the event synchronously with a preference for the fetch() API with the keepalive flag, -the SDK checks to ensure that the fetch() implementation supports the 'keepalive' flag and if not it -will fallback to either sendBeacon() or a synchronous XHR request. -As per the specification, the payload of the event (when converted to JSON) must not be larger than 64kb. -Note: Not all browsers support the keepalive flag so for those environments the events may still fail
-Attempt to send the event synchronously, this is the same as setting the event sync flag to true
ConstConstThe EventsDiscardedReason enumeration contains a set of values that specify the reason for discarding an event.
-A manual flush request was received
-Maximum batch size would be exceeded
-The Maximum number of events have already been queued
-Events are being sent based on the normal event schedule / timer.
-The Channel was resumed
-The event(s) being sent as a retry
-The SDK is unloading
-The event(s) being sent are sync events
-No specific reason was specified
-Unload event is being processed
-ConstThe TelemetryUnloadReason enumeration contains the possible reasons for why a plugin is being unloaded / torndown().
-Teardown has been called without any context.
-This instance of the plugin is being removed and replaced
-Just this plugin is being removed
-The entire SDK is being unloaded
-ConstConstConstConstEnum for property types.
-ConstError will be sent as internal telemetry
-The Error will NOT be sent as an internal telemetry, and will only be shown in the browser -console if the logging level allows it.
-No Logging will be enabled
-Error will NOT be sent as internal telemetry, and will only be shown in browser console
-ConstThe TraceLevel contains a set of values that specify the trace level for the trace messages.
-ConstThe eValueKind contains a set of values that specify value kind of the property. -Either PII (Personal Identifiable Information) or customer content.
-Generic content.
-No kind.
-An LDAP distinguished name. For example, CN=Jeff Smith,OU=Sales,DC=Fabrikam,DC=COM.
-Drops the value altogether, rather than hashing
-The fully-qualified domain name.
-Generic information.
-An IPV4 Internet address. For example, 192.0.2.1.
-Scrubs the last octet in a IPV4 Internet address. -For example: 10.121.227.147 becomes 10.121.227.*
-An IPV6 Internet address. For example, 2001:0db8:85a3:0000:0000:8a2e:0370:7334.
-Scrubs the last 4 Hextets (last 64-bits) of an IPv6 address
-An user ID.
-The Subject of an e-mail message.
-A telephone number.
-A query string.
-An SIP (Session Internet Protocol) address.
-An e-mail address.
-A URI (Uniform Resource Identifier).
-Get all of the registered events on the target object, this is primarily used for testing cleanup but may also be used by -applications to remove their own events
-The EventTarget that has registered events
-OptionaleventName: string[Optional] The name of the event to return the registered handlers and full name (with namespaces)
-OptionalevtNamespace: string | string[][Optional] Additional namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace, -if the eventName also includes a namespace the namespace(s) are merged into a single namespace
-Logs a message to the internal queue.
-The Diagnostic Logger instance to use.
-{LoggingSeverity} - The severity of the log message
-{_InternalLogMessage} - The message to log.
-Test hook for setting the maximum number of unload hooks and calling a monitor function when the hooks are added or removed -This allows for automatic test failure when the maximum number of unload hooks is exceeded
-OptionalmaxHooks: numberThe maximum number of unload hooks
-OptionaladdMonitor: ((state: string, hooks: (ILegacyUnloadHook | IUnloadHook)[]) => void)The monitor function to call when hooks are added or removed
-This is a helper method which will call throwInternal on the passed logger, will throw exceptions in -debug mode or attempt to log the error as a console warning. This helper is provided mostly to better -support minification as logger.throwInternal() will not compress the publish "throwInternal" used throughout -the code.
-The Diagnostic Logger instance to use.
-{LoggingSeverity} - The severity of the log message
-Optionalproperties: ObjectOptionalisUserAct: booleanThis is a helper method which will call warnToConsole on the passed logger with the provided message.
-The Diagnostic Logger instance to use.
-{_InternalLogMessage} - The log message.
-Trys to add an event handler for the specified event to the window, body and document
-{string} - The name of the event
-{any} - The callback function that needs to be executed for the given event
-OptionalevtNamespace: string | string[][Optional] Namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace.
-Bind the listener to the array of events
-An string array of event names to bind the listener to
-The event callback to call when the event is triggered
-OptionalexcludeEvents: string[][Optional] An array of events that should not be hooked (if possible), unless no other events can be.
-OptionalevtNamespace: string | string[][Optional] Namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace.
-true - when at least one of the events was registered otherwise false
-Listen to the pagehide and visibility changing to 'hidden' events, because the 'visibilitychange' uses -an internal proxy to detect the visibility state you SHOULD use a unique namespace when if you plan to call -removePageShowEventListener as the remove ignores the listener argument for the 'visibilitychange' event.
-The event callback to call when a page hide event is triggered
-OptionalexcludeEvents: string[][Optional] An array of events that should not be hooked (if possible), unless no other events can be.
-OptionalevtNamespace: string | string[][Optional] A Namespace to append to the event listeners so they can be uniquely identified and removed -based on this namespace. This call also adds an additional unique "pageshow" namespace to the events -so that only the matching "removePageHideEventListener" can remove these events. -Suggestion: pass as true if you are also calling addPageUnloadEventListener as that also hooks pagehide
-true - when at least one of the events was registered otherwise false
-Listen to the pageshow and visibility changing to 'visible' events, because the 'visibilitychange' uses -an internal proxy to detect the visibility state you SHOULD use a unique namespace when if you plan to call -removePageShowEventListener as the remove ignores the listener argument for the 'visibilitychange' event.
-The event callback to call when a page is show event is triggered
-OptionalexcludeEvents: string[][Optional] An array of events that should not be hooked (if possible), unless no other events can be.
-OptionalevtNamespace: string | string[][Optional/Recommended] A Namespace to append to the event listeners so they can be uniquely -identified and removed based on this namespace. This call also adds an additional unique "pageshow" namespace to the events -so that only the matching "removePageShowEventListener" can remove these events.
-true - when at least one of the events was registered otherwise false
-Listen to the 'beforeunload', 'unload' and 'pagehide' events which indicates a page unload is occurring, -this does NOT listen to the 'visibilitychange' event as while it does indicate that the page is being hidden -it does not necessarily mean that the page is being completely unloaded, it can mean that the user is -just navigating to a different Tab and may come back (without unloading the page). As such you may also -need to listen to the 'addPageHideEventListener' and 'addPageShowEventListener' events.
-The event callback to call when a page unload event is triggered
-OptionalexcludeEvents: string[][Optional] An array of events that should not be hooked, unless no other events can be.
-OptionalevtNamespace: string | string[][Optional] Namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace.
-true - when at least one of the events was registered otherwise false
-Optionallogger: IDiagnosticLoggerCalls the provided callbackFn function once for each element in an array in ascending index order. It is not invoked for index properties
-that have been deleted or are uninitialized. And unlike the ES6 forEach() you CAN stop or break the iteration by returning -1 from the
-callbackFn function.
The range (number of elements) processed by arrForEach() is set before the first call to the callbackFn. Any elements added beyond the range
-or elements which as assigned to indexes already processed will not be visited by the callbackFn.
The array or array like object of elements to be searched.
-A synchronous function that accepts up to three arguments. arrForEach calls the callbackfn function one time for each element in the array.
OptionalthisArg: anyAn object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, null or undefined -the array will be used as the this value.
-arrForEach expects a synchronous function.
-arrForEach does not wait for promises. Make sure you are aware of the implications while using promises (or async functions) as forEach callback.
const items = ['item1', 'item2', 'item3'];
const copyItems = [];
// before using for loop
for (let i = 0; i < items.length; i++) {
copyItems.push(items[i]);
}
// before using forEach()
items.forEach((item) => {
copyItems.push(item);
});
// after
arrForEach(items, (item) => {
copyItems.push(item);
// May return -1 to abort the iteration
});
// Also supports input as an array like object
const items = { length: 3, 0: 'item1', 1: 'item2', 2: 'item3' };
-
-
-The arrIndexOf() method returns the first index at which a given element can be found in the array,
-or -1 if it is not present.
-arrIndexOf() compares searchElement to elements of the Array using strict equality (the same
-method used by the === or triple-equals operator).
const array = [2, 9, 9];
arrIndexOf(array, 2); // 0
arrIndexOf(array, 7); // -1
arrIndexOf(array, 9, 2); // 2
arrIndexOf(array, 2, -1); // -1
arrIndexOf(array, 2, -3); // 0
let indices: number[] = [];
const array = ['a', 'b', 'a', 'c', 'a', 'd'];
const element = 'a';
let idx = arrIndexOf(array, element);
while (idx !== -1) {
indices.push(idx);
idx = arrIndexOf(array, element, idx + 1);
}
console.log(indices);
// [0, 2, 4]
function updateVegetablesCollection (veggies, veggie) {
if (arrIndexOf(veggies, veggie) === -1) {
veggies.push(veggie);
console.log('New veggies collection is : ' + veggies);
} else {
console.log(veggie + ' already exists in the veggies collection.');
}
}
let veggies = ['potato', 'tomato', 'chillies', 'green-pepper'];
updateVegetablesCollection(veggies, 'spinach');
// New veggies collection is : potato,tomato,chillies,green-pepper,spinach
updateVegetablesCollection(veggies, 'spinach');
// spinach already exists in the veggies collection.
// Array Like
let arrayLike = {
length: 3,
0: "potato",
1: "tomato",
2: "chillies",
3: "green-pepper" // Not checked as index is > length
};
arrIndexOf(arrayLike, "potato"); // 0
arrIndexOf(arrayLike, "tomato"); // 1
arrIndexOf(arrayLike, "chillies"); 2
arrIndexOf(arrayLike, "green-pepper"); // -1
-
-
-The array or array like object of elements to be searched.
-The element to locate in the array.
-OptionalfromIndex: numberThe index to start the search at. If the index is greater than or equal to -the array's length, -1 is returned, which means the array will not be searched. If the provided -index value is a negative number, it is taken as the offset from the end of the array. -Note: if the provided index is negative, the array is still searched from front to back. If the -provided index is 0, then the whole array will be searched. Default: 0 (entire array is searched).
-The first index of the element in the array; -1 if not found.
-The arrMap() method creates a new array populated with the results of calling a provided function on every -element in the calling array.
-arrMap calls a provided callbackFn function once for each element in an array, in order, and constructs
-a new array from the results. callbackFn is invoked only for indexes of the array which have assigned
-values (including undefined).
It is not called for missing elements of the array; that is:
-0.3.3
-const numbers = [1, 4, 9];
const roots = arrMap(numbers, (num) => Math.sqrt(num));
// roots is now [1, 2, 3]
// numbers is still [1, 4, 9]
const kvArray = [{ key: 1, value: 10 },
{ key: 2, value: 20 },
{ key: 3, value: 30 }];
const reformattedArray = arrMap(kvArray, ({ key, value}) => ({ [key]: value }));
// reformattedArray is now [{1: 10}, {2: 20}, {3: 30}],
// kvArray is still:
// [{key: 1, value: 10},
// {key: 2, value: 20},
// {key: 3, value: 30}]
// Also supports Array Like objects with same output
const kvArray = {
length: 3,
0: { key: 1, value: 10 },
1: { key: 2, value: 20 },
2: { key: 3, value: 30 }
};
-
-
-The arrReduce() method executes a user-supplied "reducer" callback function on each element of the array, -in order, passing in the return value from the calculation on the preceding element. The final result of -running the reducer across all elements of the array is a single value.
-The first time that the callback is run there is no "return value of the previous calculation". If supplied, -an initial value may be used in its place. Otherwise the array element at index 0 is used as the initial -value and iteration starts from the next element (index 1 instead of index 0).
-const getMax = (a: number, b: number) => Math.max(a, b);
// callback is invoked for each element in the array starting at index 0
arrReduce([1, 100], getMax, 50); // 100
arrReduce([ 50], getMax, 10); // 50
// callback is invoked once for element at index 1
arrReduce([1, 100], getMax); // 100
// callback is not invoked
arrReduce([ 50], getMax); // 50
arrReduce([ ], getMax, 1); // 1
arrReduce([ ], getMax); // throws TypeError
// Also supports Array like objects
arrReduce({ length: 2, 0: 1, 1: 100 }, getMax, 50); // 100
arrReduce({ length: 1, 0: 50 }, getMax, 10); // 50
// callback is invoked once for element at index 1
arrReduce({ length: 2, 0: 1, 1: 100 }, getMax); // 100
// callback is not invoked
arrReduce({ length: 1, 0: 50 }, getMax); // 50
arrReduce({ length: 0 }, getMax, 1); // 1
-
-
-Identifies the type of array elements
-The array or array like object of elements to be searched.
-A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.
-OptionalinitialValue: T | RIf initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
-The value that results from running the "reducer" callback function to completion over the entire array.
-Binds the specified function to an event, so that the function gets called whenever the event fires on the object
-Object to add the event too.
-String that specifies any of the standard DHTML Events without "on" prefix and optional (dot "." prefixed) namespaces "click" "click.mynamespace".
-Pointer that specifies the function to call when event fires
-OptionaluseCapture: boolean[Optional] Defaults to false
-True if the function was bound successfully to the event, otherwise false
-Mark the provided value so that if it's included into the configuration it will NOT have -its properties converted into a dynamic (reactive) object. If the object is not a plain object -or an array (ie. a class) this function has not affect as only Objects and Arrays are converted -into dynamic objects in the dynamic configuration.
-When you have tagged a value as both forceDynamicConversion and blocked force will take precedence.
-You should only need to use this function, if you are creating dynamic "classes" from objects -which confirm to the require interface. A common case for this is during unit testing where it's -easier to create mock extensions.
-If value is falsy (null / undefined / 0 / empty string etc) it will not be tagged and
-if there is an exception adding the property to the value (because its frozen etc) the
-exception will be swallowed
The object that you want to block from being converted into a -trackable dynamic object
-The original value
-// This is a valid "extension", but it is technically an object
// So when included in the config.extensions it WILL be cloned and then
// converted into a dynamic object, where all of its properties will become
// get/set object properties and will be tracked. While this WILL still
// function, when attempt to use a mocking framework on top of this the
// functions are now technically get accessors which return a function
// and this can cause some mocking frameworks to fail.
let mockChannel = {
pause: () => { },
resume: () => { },
teardown: () => { },
flush: (async: any, callBack: any) => { },
processTelemetry: (env: any) => { },
setNextPlugin: (next: any) => { },
initialize: (config: any, core: any, extensions: any) => { },
identifier: "testChannel",
priority: 1003
};
-
-
-OptionalrootConfig: IConfigurationOptionallogger: IDiagnosticLoggerCreate or return a dynamic version of the passed config, if it is not already dynamic
-The config to be converted into a dynamic config
-OptionaldefaultConfig: IConfigDefaults<T, IConfiguration>The default values to apply on the config if the properties don't already exist
-Optionallogger: IDiagnosticLoggerOptionalinPlace: booleanShould the config be converted in-place into a dynamic config or a new instance returned, defaults to true
-The dynamic config handler for the config (whether new or existing)
-Create a new guid.
-The style of guid to generated, defaults to Digits -Digits (Default) : 32 digits separated by hyphens: 00000000-0000-0000-0000-000000000000 -Braces - 32 digits separated by hyphens, enclosed in braces: {00000000-0000-0000-0000-000000000000} -Parentheses - 32 digits separated by hyphens, enclosed in parentheses: (00000000-0000-0000-0000-000000000000) -Numeric - 32 digits: 00000000000000000000000000000000
-The formatted guid.
-Creates a new Telemetry Item context with the current config, core and plugin execution chain
-The current core instance
-OptionalstartAt: IPluginIdentifies the next plugin to execute, if null there is no "next" plugin and if undefined it should assume the start of the chain
-Create a new ITraceParent instance using the provided values.
-OptionaltraceId: stringThe traceId to use, when invalid a new random W3C id will be generated.
-OptionalspanId: stringThe parent/span id to use, a new random value will be generated if it is invalid.
-Optionalflags: numberThe traceFlags to use, defaults to zero (0) if not supplied or invalid
-Optionalversion: stringThe version to used, defaults to version "01" if not supplied or invalid.
-Return the number of milliseconds that have elapsed since January 1, 1970 00:00:00 UTC.
-To offer protection against timing attacks and fingerprinting, the precision of utcNow() -might get rounded depending on browser settings. In Firefox, the privacy.reduceTimerPrecision -preference is enabled by default and defaults to 20µs in Firefox 59; in 60 it will be 2ms.
-A Number representing the milliseconds elapsed since the UNIX epoch.
-Removes an event handler for the specified event
-{string} - The name of the event, with optional namespaces or just the namespaces, -such as "click", "click.mynamespace" or ".mynamespace"
-{any} - The callback function that needs to be removed from the given event, when using a -namespace (with or without a qualifying event) this may be null to remove all previously attached event handlers -otherwise this will only remove events with this specific handler.
-OptionaluseCapture: boolean[Optional] Defaults to false
-Helper function to wrap a function with a perf event
-The Performance Manager or a Performance provider source (may be null)
-The callback to create the source name for the event (if perf monitoring is enabled)
-The function to call and measure
-OptionalperfEvt: IPerfEventOptionaldetails: (() => any)A function to return the payload details
-OptionalisAsync: booleanIs the event / function being call asynchronously or synchronously
-Returns string representation of an object suitable for diagnostics logging.
-The object to be converted to a diagnostic string value
-Optionalformat: number | booleanIdentifies whether the JSON value should be formated
-true - Format with 4 spacesfalse (or not Truthy) - Do not formatA string representation of the object suitable for diagnostics logging
-let obj = { a: 1, b: "Hello", c: { d: 2, e: "Darkness" } };
let objStr = dumpObj(obj);
// objStr === "[object Object]: { a: 1, b: "Hello", c: { d: 2, e: "Darkness" } }"
let objStrFmt = dumpObj(obj, true);
// objStrFmt === "[object Object]: {\n a: 1,\n b: "Hello",\n c: {\n d: 2,\n e: "Darkness"\n }\n}"
let objStrFmt2 = dumpObj(obj, 2);
// objStrFmt2 === "[object Object]: {\n a: 1,\n b: "Hello",\n c: {\n d: 2,\n e: "Darkness"\n }\n}"
let objStrFmt3 = dumpObj(obj, 0);
// objStrFmt3 === "[object Object]: { a: 1, b: "Hello", c: { d: 2, e: "Darkness" } }"
let objStrFmt4 = dumpObj(obj, false);
// objStrFmt4 === "[object Object]: { a: 1, b: "Hello", c: { d: 2, e: "Darkness" } }"
let objStrFmt5 = dumpObj(obj, null);
// objStrFmt5 === "[object Object]: { a: 1, b: "Hello", c: { d: 2, e: "Darkness" } }"
let objStrFmt6 = dumpObj(obj, undefined);
// objStrFmt6 === "[object Object]: { a: 1, b: "Hello", c: { d: 2, e: "Darkness" } }"
let objStrFmt7 = dumpObj(obj, "");
// objStrFmt7 === "[object Object]: { a: 1, b: "Hello", c: { d: 2, e: "Darkness" } }"
let err = new Error("Hello Darkness");
let errStr = dumpObj(err);
// errStr === "[object Error]: { stack: 'Error: Hello Darkness\n at <anonymous>:1:13', message: 'Hello Darkness', name: 'Error'"
let errStrFmt = dumpObj(err, true);
// errStrFmt === "[object Error]: {\n stack: "Error: Hello Darkness\n at <anonymous>:1:13",\n message: "Hello Darkness",\n name: "Error"\n}"
let errStrFmt2 = dumpObj(err, 2);
// errStrFmt2 === "[object Error]: {\n stack: "Error: Hello Darkness\n at <anonymous>:1:13",\n message: "Hello Darkness",\n name: "Error"\n}"
let errStrFmt3 = dumpObj(err, 0);
// errStrFmt3 === "[object Error]: { stack: "Error: Hello Darkness\n at <anonymous>:1:13", message: "Hello Darkness", name: "Error" }"
-
-
-Removes an event handler for the specified event
-{string} - The name of the event, with optional namespaces or just the namespaces, -such as "click", "click.mynamespace" or ".mynamespace"
-{any} - The callback function that needs to be removed from the given event, when using a -namespace (with or without a qualifying event) this may be null to remove all previously attached event handlers -otherwise this will only remove events with this specific handler.
-OptionalevtNamespace: string | string[][Optional] Additional namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace, -if the eventName also includes a namespace the namespace(s) are merged into a single namespace
-OptionaluseCapture: boolean[Optional] Defaults to false
-Binds the specified function to an event, so that the function gets called whenever the event fires on the object
-String that specifies any of the standard DHTML Events without "on" prefix, if may also include an optional (dot "." prefixed) -namespaces "click" "click.mynamespace" in addition to specific namespaces.
-Pointer that specifies the function to call when event fires
-OptionalevtNamespace: string | string[][Optional] Additional namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace, -if the eventName also includes a namespace the namespace(s) are merged into a single namespace
-OptionaluseCapture: boolean[Optional] Defaults to false
-True if the function was bound successfully to the event, otherwise false
-Helper function to fetch the passed traceparent from the page, looking for it as a meta-tag or a Server-Timing header.
-OptionalselectIdx: numberIf the found value is comma separated which is the preferred entry to select, defaults to the first
-This is the reverse case of blockDynamicConversion in that this will tag an -object to indicate that it should always be converted into a dynamic trackable object -even when not an object or array. So all properties of this object will become -get / set accessor functions.
-When you have tagged a value as both forceDynamicConversion and blocked force will take precedence.
-If value is falsy (null / undefined / 0 / empty string etc) it will not be tagged and
-if there is an exception adding the property to the value (because its frozen etc) the
-exception will be swallowed.
The object that should be tagged and converted if included into a dynamic -configuration.
-The original value
-Optionalmessage: stringFormat the ITraceParent value as a string using the supported and know version formats. -So even if the passed traceParent is a later version the string value returned from this -function will convert it to only the known version formats. -This currently only supports version "00" and invalid "ff"
-The parsed traceParent value
-Helper to get and decode the cookie value using decodeURIComponent, this is for historical -backward compatibility where the document.cookie value was decoded before parsing.
-The cookie manager to use
-The name of the cookie to get
-A flag to indicate whether the cookie value should be decoded
-The decoded cookie value (if available) otherwise an empty string.
-Returns the current global scope object, for a normal web page this will be the current -window, for a Web Worker this will be current worker global scope via "self". The internal -implementation returns the first available instance object in the following order
-OptionaluseCached: boolean[Optional] used for testing to bypass the cached lookup, when true this will
-cause the cached global to be reset.
Return the named global object if available, will return null if the object is not available.
-The globally named object, may be any valid property key (string, number or symbol)
-OptionaluseCached: boolean[Optional] used for testing to bypass the cached lookup, when true this will
-cause the cached global to be reset.
// This does not cause the evaluation to occur
window.myGlobal = "Hello";
let cachedValue = getInst("myGlobal");
// cachedValue === "Hello"
window.myGlobal = "Darkness";
// getInst("myGlobal") === "Darkness"
let promiseCls = getInst("Promise");
// May throw if the global is not supported by the runtime
// otherwise the Promise class.
-
-
-Returns the global location object if it is present otherwise null. -This helper is used to access the location object without causing an exception -"Uncaught ReferenceError: location is not defined"
-OptionalcheckForMock: booleanReturns the global performance Object if available, which can be used to
-gather performance information about the current document. It serves as the
-point of exposure for the Performance Timeline API, the High Resolution Time
-API, the Navigation Timing API, the User Timing API, and the Resource Timing API.
The global performance object if available.
-Returns the number of milliseconds that has elapsed since the time origin, if
-the runtime does not support the performance API it will fallback to return
-the number of milliseconds since the unix epoch.
The number of milliseconds as a DOMHighResTimeStamp double value or
-an integer depending on the runtime.
Checks if JSON object is available, this is required as we support the API running without a -window /document (eg. Node server, electron webworkers) and if we attempt to assign a history -object to a local variable or pass as an argument an "Uncaught ReferenceError: JSON is not defined" -exception will be thrown. -Defined as a function to support lazy / late binding environments.
-The objHasOwnProperty() method returns a boolean indicating whether the object -has the specified property as its own property (as opposed to inheriting it).
-The objHasOwnProperty() method returns true if the specified property is a direct -property of the object — even if the value is null or undefined. The method returns -false if the property is inherited, or has not been declared at all. Unlike the in -operator, this method does not check for the specified property in the object's -prototype chain.
-The method can be called on most JavaScript objects, because most objects descend -from Object, and hence inherit its methods. For example Array is an Object, so you -can use objHasOwnProperty() method to check whether an index exists:
-The object being evaluated
-The String or Symbol of the property to test
-true if the object has the specified property as own property; otherwise false
let example = {};
objHasOwnProperty(example, 'prop'); // false
example.prop = 'exists';
objHasOwnProperty(example, 'prop'); // true - 'prop' has been defined
example.prop = null;
objHasOwnProperty(example, 'prop'); // true - own property exists with value of null
example.prop = undefined;
objHasOwnProperty(example, 'prop'); // true - own property exists with value of undefined
-
-
-Checks if the type of value is an Array.
-Checks if HTML5 Beacons are supported in the current environment.
-OptionaluseCached: boolean[Optional] used for testing to bypass the cached lookup, when true this will
-cause the cached global to be reset.
True if supported, false otherwise.
-Check if an object is of type Date
-Checks if the Fetch API is supported in the current environment.
-OptionalwithKeepAlive: boolean[Optional] If True, check if fetch is available and it supports the keepalive feature, otherwise only check if fetch is supported
-True if supported, otherwise false
-Checks to see if the past value is a function value
-function myFunction() { }
isFunction(null); // false
isFunction(undefined); // false
isFunction("null"); // false
isFunction("undefined"); // false
isFunction("1"); // false
isFunction("aa"); // false
isFunction(new Date()); // false
isFunction(1); // false
isFunction(""); // false
isFunction(myFunction); // true
isFunction([]); // false
isFunction(new Array(1)); // false
-
-
-Checks if the provided value is null, undefined or contains the string value of "undefined".
-The value to check
-true if the value is null or undefined
isNullOrUndefined(null); // true
isNullOrUndefined(undefined); // true
isNullOrUndefined("undefined"); // true
let value = null;
isNullOrUndefined(value); // true
let value = undefined;
isNullOrUndefined(value); // true
isNullOrUndefined(""); // false
isNullOrUndefined(0); // false
isNullOrUndefined(new Date()); // false
isNullOrUndefined(true); // false
isNullOrUndefined(false); // false
-
-
-Checks to see if the past value is a string value
-Checks if the provided value is undefined or contains the string value "undefined", -if you want to consider the string value as undefined see isStrictUndefined
-The value to check
-true if the value is undefined or "undefined", otherwise false
-isUndefined(undefined); // true
isUndefined("undefined"); // true
isUndefined(null); // false
isUndefined("null"); // false
isUndefined("1"); // false
isUndefined("aa"); // false
isUndefined(new Date()); // false
isUndefined(1); // false
isUndefined(""); // false
isUndefined(_dummyFunction); // false
isUndefined([]); // false
isUndefined(new Array(1)); // false
isUndefined(true); // false
isUndefined(false); // false
isUndefined("true"); // false
isUndefined("false"); // false
isUndefined(new Boolean(true)); // false
isUndefined(new Boolean(false)); // false
isUndefined(new Boolean("true")); // false
isUndefined(new Boolean("false")); // false
isUndefined(Boolean(true)); // false
isUndefined(Boolean(false)); // false
isUndefined(Boolean("true")); // false
isUndefined(Boolean("false")); // false
isUndefined(new RegExp("")); // false
isUndefined(new ArrayBuffer(0)); // false
isUndefined(new Error("Test Error"));// false
isUndefined(new TypeError("Test TypeError")); // false
isUndefined(new TestError("Test TestError")); // false
isUndefined(_dummyError()); // false
isUndefined(Promise.reject()); // false
isUndefined(Promise.resolve()); // false
isUndefined(new Promise(() => {})); // false
isUndefined(_simplePromise()); // false
isUndefined(_simplePromiseLike()); // false
isUndefined(Object.create(null)); // false
isUndefined(polyObjCreate(null)); // false
-
-
-Is the provided W3c span id (aka. parent id) a valid string representation, it must be a 16-character -string of lowercase hexadecimal characters, for example, 00f067aa0ba902b7. -If all characters are zero (0000000000000000) this is considered an invalid value.
-The W3c span id to be validated
-true if valid otherwise false
-Is the provided W3c Trace Id a valid string representation, it must be a 32-character string -of lowercase hexadecimal characters for example, 4bf92f3577b34da6a3ce929d0e0e4736. -If all characters as zero (00000000000000000000000000000000) it will be considered an invalid value.
-The W3c trace Id to be validated
-true if valid otherwise false
-Generate random base64 id string. -The default length is 22 which is 132-bits so almost the same as a GUID but as base64 (the previous default was 5)
-OptionalmaxLength: numberOptional value to specify the length of the id to be generated, defaults to 22
-Validates that the string name conforms to the JS IdentifierName specification and if not -normalizes the name so that it would. This method does not identify or change any keywords -meaning that if you pass in a known keyword the same value will be returned. -This is a simplified version
-The name to validate
-Try to define get/set object property accessors for the target object/prototype, this will provide compatibility with -existing API definition when run within an ES5+ container that supports accessors but still enable the code to be loaded -and executed in an ES3 container, providing basic IE8 compatibility.
-The object on which to define the property.
-The name of the property to be defined or modified.
-OptionalgetProp: (() => V)The getter function to wire against the getter.
-OptionalsetProp: ((v: V) => void)The setter function to wire against the setter.
-Optionalconfigurable: booleanCan the value be changed, defaults to true
-Optionalenumerable: booleanShould this get property be enumerable, defaults to true.
-The object that was passed to the function
-It is recommended that you use objDefine instead objDefineAccessors as this internally creates -the ObjDefinePropDescriptor definition based on your provided arguments. And only using a minimum set of functions -reduces your overall bundle size.
-Calls the provided callbackFn function once for each key in an object. This is equivelent to arrForEach(Object.keys(theObject), callbackFn) or
-if not using the array helper Object.keys(theObject).forEach(callbackFn) except that this helper avoid creating a temporary of the object
-keys before iterating over them and like the arrForEach helper you CAN stop or break the iteration by returning -1 from the callbackFn function.
A function that accepts up to two arguments, the key name and the current value of the property represented by the key.
-OptionalthisArg: any[Optional] An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, null or undefined -the object will be used as the this value.
-The objFreeze() method freezes an object. A frozen object can no longer be changed; freezing an object
-prevents new properties from being added to it, existing properties from being removed, prevents changing the
-enumerability, configurability, or writability of existing properties, and prevents the values of existing
-properties from being changed. In addition, freezing an object also prevents its prototype from being changed.
-objFreeze() returns the same object that was passed in.
Nothing can be added to or removed from the properties set of a frozen object. Any attempt to do so will fail, -either silently or by throwing a TypeError exception (most commonly, but not exclusively, when in strict mode).
-For data properties of a frozen object, values cannot be changed, the writable and configurable attributes are -set to false. Accessor properties (getters and setters) work the same (and still give the illusion that you are -changing the value). Note that values that are objects can still be modified, unless they are also frozen. As -an object, an array can be frozen; after doing so, its elements cannot be altered and no elements can be added -to or removed from the array.
-objFreeze() returns the same object that was passed into the function. It does not create a frozen copy.
The objKeys() method returns an array of a given object's own enumerable property names, iterated in
-the same order that a normal loop would.
objKeys() returns an array whose elements are strings corresponding to the enumerable properties found -directly upon object. The ordering of the properties is the same as that given by looping over the -properties of the object manually.
-// simple array
const arr = ['a', 'b', 'c'];
console.log(objKeys(arr)); // console: ['0', '1', '2']
// array-like object
const obj = { 0: 'a', 1: 'b', 2: 'c' };
console.log(objKeys(obj)); // console: ['0', '1', '2']
// array-like object with random key ordering
const anObj = { 100: 'a', 2: 'b', 7: 'c' };
console.log(objKeys(anObj)); // console: ['2', '7', '100']
// getFoo is a property which isn't enumerable
const myObj = objCreate({}, {
getFoo: {
value() { return this.foo; }
}
});
myObj.foo = 1;
console.log(objKeys(myObj)); // console: ['foo']
-
-
-The objSeal() method seals an object, preventing new properties from being added to it and marking all
-existing properties as non-configurable. Values of present properties can still be changed as long as they
-are writable.
Watch and track changes for accesses to the current config, the provided config MUST already be -a dynamic config or a child accessed via the dynamic config
-Optionallogger: IDiagnosticLoggerThe logger instance to use if there is no existing handler
-A watcher handler instance that can be used to remove itself when being unloaded
-Create and open an XMLHttpRequest object
-The request method
-The url
-OptionalwithCredentials: booleanOption flag indicating that credentials should be sent
-Optional flag indicating that the XHR object should be marked as disabled and not tracked (default is false)
-Optional flag indicating if the instance should be a synchronous request (defaults to false)
-Optionaltimeout: numberOptional value identifying the timeout value that should be assigned to the XHR request
-A new opened XHR request
-A helper function to assist with JIT performance for objects that have properties added / removed dynamically -this is primarily for chromium based browsers and has limited effects on Firefox and none of IE. Only call this -function after you have finished "updating" the object, calling this within loops reduces or defeats the benefits. -This helps when iterating using for..in, objKeys() and objForEach()
-The object to be optimized if possible
-Parses the response from the backend.
-XMLHttpRequest or XDomainRequest response
-OptionaldiagLog: IDiagnosticLoggerAttempt to parse the provided string as a W3C TraceParent header value (https://www.w3.org/TR/trace-context/#traceparent-header)
-The value to be parsed
-OptionalselectIdx: numberIf the found value is comma separated which is the preferred entry to select, defaults to the first
-Returns the number of milliseconds that has elapsed since the time origin, if
-the runtime does not support the performance API it will fallback to return
-the number of milliseconds since the unix epoch.
The number of milliseconds as a DOMHighResTimeStamp double value or
-an integer depending on the runtime.
Effectively assigns all enumerable properties (not just own properties) and functions (including inherited prototype) from -the source object to the target, it attempts to use proxy getters / setters (if possible) and proxy functions to avoid potential -implementation issues by assigning prototype functions as instance ones
-This method is the primary method used to "update" the snippet proxy with the ultimate implementations.
-Special ES3 Notes: -Updates (setting) of direct property values on the target or indirectly on the source object WILL NOT WORK PROPERLY, updates to the -properties of "referenced" object will work (target.context.newValue = 10 => will be reflected in the source.context as it's the -same object). ES3 Failures: assigning target.myProp = 3 -> Won't change source.myProp = 3, likewise the reverse would also fail.
-The target object to be assigned with the source properties and functions
-The source object which will be assigned / called by setting / calling the targets proxies
-OptionalchkSet: ((name: string, isFunc?: boolean, source?: S, target?: T) => boolean)An optional callback to determine whether a specific property/function should be proxied
-Creates a proxy function on the target which internally will call the source version with all arguments passed to the target method.
-The target object to be assigned with the source properties and functions
-The function name that will be added on the target
-The source object which will be assigned / called by setting / calling the targets proxies
-The function name on the source that will be proxied on the target
-OptionaloverwriteTarget: booleanIf false this will not replace any pre-existing name otherwise (the default) it will overwrite any existing name
Creates proxy functions on the target which internally will call the source version with all arguments passed to the target method.
-The target object to be assigned with the source properties and functions
-The source object which will be assigned / called by setting / calling the targets proxies
-An array of function names that will be proxied on the target
-OptionaloverwriteTarget: booleanIf false this will not replace any pre-existing name otherwise (the default) it will overwrite any existing name
-Trys to remove event handler(s) for the specified event/namespace to the window, body and document
-{string} - The name of the event, with optional namespaces or just the namespaces, -such as "click", "click.mynamespace" or ".mynamespace"
-{any} - - The callback function that needs to be removed from the given event, when using a -namespace (with or without a qualifying event) this may be null to remove all previously attached event handlers -otherwise this will only remove events with this specific handler.
-OptionalevtNamespace: string | string[][Optional] Namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace.
-Remove the listener from the array of events
-An string array of event names to bind the listener to
-The event callback to call when the event is triggered
-OptionalevtNamespace: string | string[][Optional] Namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace.
-Removes the pageHide event listeners added by addPageHideEventListener, because the 'visibilitychange' uses -an internal proxy to detect the visibility state you SHOULD use a unique namespace when calling addPageHideEventListener -as the remove ignores the listener argument for the 'visibilitychange' event.
-The specific listener to remove for the 'pageshow' event only (ignored for 'visibilitychange')
-OptionalevtNamespace: string | string[]The unique namespace used when calling addPageShowEventListener
-Removes the pageShow event listeners added by addPageShowEventListener, because the 'visibilitychange' uses -an internal proxy to detect the visibility state you SHOULD use a unique namespace when calling addPageShowEventListener -as the remove ignores the listener argument for the 'visibilitychange' event.
-The specific listener to remove for the 'pageshow' event only (ignored for 'visibilitychange')
-OptionalevtNamespace: string | string[]The unique namespace used when calling addPageShowEventListener
-Remove any matching 'beforeunload', 'unload' and 'pagehide' events that may have been added via addEventListener, -addEventListeners, addPageUnloadEventListener or addPageHideEventListener.
-The specific event callback to to be removed
-OptionalevtNamespace: string | string[][Optional] Namespace(s) uniquely identified and removed based on this namespace.
-true - when at least one of the events was registered otherwise false
-Helper to return the ICookieMgr from the core (if not null/undefined) or a default implementation -associated with the configuration or a legacy default.
-Optionalconfig: IConfigurationOptionalconfig: IConfigurationSanitizes the Property. It checks the that the property name and value are valid. It also -checks/populates the correct type and pii of the property value.
-property name - The property name.
-The property value or an IEventProperty containing value, -type ,pii and customer content.
-OptionalstringifyObjects: booleanIEventProperty containing valid name, value, pii and type or null if invalid.
-Sets the provided value on the target instance using the field name when the provided chk function returns true, the chk -function will only be called if the new value is no equal to the original value.
-The target object
-The key of the target
-The value to set
-OptionalvalChk: ((value: T[K]) => boolean)[Optional] Callback to check the value that if supplied will be called check if the new value can be set
-OptionalsrcChk: ((value: T[K]) => boolean)[Optional] Callback to check to original value that if supplied will be called if the new value should be set (if allowed)
-The existing or new value, depending what was set
-This method lets you determine whether or not a string ends with another string. This method is case-sensitive.
-This method lets you determine whether or not a string begins with another string. This method is case-sensitive.
-The value to be checked
-The characters to be searched for at the start of the string
-Optionalposition: number[Optional] The position in this string at which to begin searching for searchString.
-Defaults to 0
true if the given characters are found at the beginning of the string; otherwise, false.
The trim() method removes whitespace from both ends of a string and returns a new string, -without modifying the original string. Whitespace in this context is all the whitespace -characters (space, tab, no-break space, etc.) and all the line terminator characters -(LF, CR, etc.).
-The string value to be trimmed.
-A new string representing str stripped of whitespace from both its beginning and end.
-If neither the beginning or end of str has any whitespace, a new string is still returned (essentially
-a copy of str), with no exception being thrown.
-To return a new string with whitespace trimmed from just one end, use strTrimStart() or strTrimEnd().
Identifies an interface to a host that can provide an IPerfManager implementation
-OptionalactiveWatches and tracks status of initialization process
-ActiveStatus
-3.3.0 -If returned status is active, it means initialization process is completed. -If returned status is pending, it means the initialization process is waiting for promieses to be resolved. -If returned status is inactive, it means ikey is invalid or can 't get ikey or enpoint url from promsises.
-ReadonlyconfigFunction used to identify the get w parameter used to identify status bit to some channels
-OptionalisReturns a value that indicates whether the instance has already been previously initialized.
-ReadonlyloggerThe current logger instance for this instance.
-ReadonlypluginThe formatted string of the installed plugins that contain a version number
-ReadonlypluginAn array of the installed plugins that provide a version
-OptionaladdAdds a notification listener. The SDK calls methods on the listener when an appropriate notification is raised. -The added plugins must raise notifications. If the plugins do not implement the notifications, then no methods will be -called.
-An INotificationListener object.
-Add a new plugin to the installation
-The new plugin to add
-OptionalreplaceExisting: booleanshould any existing plugin be replaced, default is false
-OptionaldoAsync: booleanShould the add be performed asynchronously
-OptionaladdCb: ((added?: boolean) => void)[Optional] callback to call after the plugin has been added
-Optionaladded: booleanAdd a telemetry processor to decorate or drop telemetry events.
-The Telemetry Initializer function
-Add a handler that will be called when the SDK is being unloaded
-the handler
-Add this hook so that it is automatically removed during unloading
-The single hook or an array of IInstrumentHook objects
-Flush and send any batched / cached data immediately
-OptionalisAsync: booleanOptionalcallBack: ((flushComplete?: boolean) => void)if specified, notify caller when send is complete, the channel should return true to indicate to the caller that it will be called. -If the caller doesn't return true the caller should assume that it may never be called.
-OptionalflushComplete: booleanOptionalsendReason: SendRequestReasonspecify the reason that you are calling "flush" defaults to ManualFlush (1) if not specified
-OptionalcbTimeout: numberAn optional timeout to wait for any flush operations to complete before proceeding with the unload. Defaults to 5 seconds.
-Get the current cookie manager for this instance
-Get the current notification manager
-Get the current performance manager
-Return a new instance of the IProcessTelemetryContext for processing events
-Gets the current distributed trace context for this instance if available
-OptionalcreateNew: booleanOptional flag to create a new instance if one doesn't currently exist, defaults to true
-Optionallogger: IDiagnosticLoggerOptionalnotificationManager: INotificationManagerWatches and tracks changes for accesses to the current config, and if the accessed config changes the -handler will be recalled.
-A watcher handler instance that can be used to remove itself when being unloaded
-OptionalpollOptionalremoveRemoves all instances of the listener.
-INotificationListener to remove.
-Set the current cookie manager for this instance
-The manager, if set to null/undefined will cause the default to be created
-Set the current performance manager
-The performance manager
-Sets the current distributed trace context for this instance if available
-OptionalstopUnload and Tear down the SDK and any initialized plugins, after calling this the SDK will be considered
-to be un-initialized and non-operational, re-initializing the SDK should only be attempted if the previous
-unload call return true stating that all plugins reported that they also unloaded, the recommended
-approach is to create a new instance and initialize that instance.
-This is due to possible unexpected side effects caused by plugins not supporting unload / teardown, unable
-to successfully remove any global references or they may just be completing the unload process asynchronously.
-If you pass isAsync as true (also the default) and DO NOT pass a callback function then an IPromise
-will be returned which will resolve once the unload is complete. The actual implementation of the IPromise
-will be a native Promise (if supported) or the default as supplied by ts-async library
OptionalisAsync: booleanCan the unload be performed asynchronously (default)
-OptionalunloadComplete: ((unloadState: ITelemetryUnloadState) => void)An optional callback that will be called once the unload has completed
-OptionalcbTimeout: numberAn optional timeout to wait for any flush operations to complete before proceeding with the -unload. Defaults to 5 seconds.
-Nothing or if occurring asynchronously a IPromise -which will be resolved once the unload is complete, the IPromise -will only be returned when no callback is provided and isAsync is true
-Update the configuration used and broadcast the changes to all loaded plugins, this does NOT support updating, adding or removing -any the plugins (extensions or channels). It will notify each plugin (if supported) that the configuration has changed but it will -not remove or add any new plugins, you need to call addPlugin or getPlugin(identifier).remove();
-The new configuration is apply
-OptionalmergeExisting: booleanShould the new configuration merge with the existing or just replace it. Default is to merge.
-Optional ReadonlyappApp id returned by the backend - not necessary returned, but we don't need it with each response.
-ReadonlyerrorsList of errors for items which were not accepted
-ReadonlyitemsNumber of items succesfuly accepted by the backend
-ReadonlyitemsNumber of items received by the backend
-Provides data transmission capabilities
-OptionalcoreThe App Insights core to use for backward compatibility. -Therefore the interface will be able to access the core without needing to cast to "any". -[optional] any 3rd party plugins which are already implementing this interface don't fail to compile.
-OptionalgetGet offline support
-IInternalOfflineSupport
-ReadonlyidentifierExtension name
-Initialize plugin loaded by SDK
-The config for the plugin to use
-The current App Insights core to use for initializing this plugin instance
-The complete set of extensions to be used for initializing the plugin
-OptionalpluginChain: ITelemetryPluginChain[Optional] specifies the current plugin chain which identifies the -set of plugins and the order they should be executed for the current request.
-OptionalisReturns a value that indicates whether the plugin has already been previously initialized. -New plugins should implement this method to avoid being initialized more than once.
-ReadonlypriorityPriority of the extension
-Call back for telemetry processing before it it is sent
-This is the current event being reported
-OptionalitemCtx: IProcessTelemetryContextThis is the context for the current request, ITelemetryPlugin instances -can optionally use this to access the current core instance or define / pass additional information -to later plugins (vs appending items to the telemetry item)
-OptionalsetSet next extension for telemetry processing, this is not optional as plugins should use the -processNext() function of the passed IProcessTelemetryContext instead. It is being kept for -now for backward compatibility only.
-OptionalteardownTear down the plugin and remove any hooked value, the plugin should be removed so that it is no longer initialized and -therefore could be re-initialized after being torn down. The plugin should ensure that once this has been called any further -processTelemetry calls are ignored and it just calls the processNext() with the provided context.
-OptionalunloadCtx: IProcessTelemetryUnloadContextThis is the context that should be used during unloading.
-OptionalunloadState: ITelemetryUnloadStateThe details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.
-boolean - true if the plugin has or will call processNext(), this for backward compatibility as previously teardown was synchronous and returned nothing.
-OptionalupdateThe the plugin should re-evaluate configuration and update any cached configuration settings or -plugins. If implemented this method will be called whenever a plugin is added or removed and if -the configuration has bee updated.
-This is the context that should be used during updating.
-The details / state of the update process, it holds details like the current and previous configuration.
-boolean - true if the plugin has or will call updateCtx.processNext(), this allows the plugin to perform any asynchronous operations.
-Optional ReadonlyversionPlugin version (available in data.properties.version in common schema)
-OptionalflushFlush to send data immediately; channel should default to sending data asynchronously. If executing asynchronously and
-you DO NOT pass a callback function then a IPromise
-will be returned which will resolve once the flush is complete. The actual implementation of the IPromise
-will be a native Promise (if supported) or the default as supplied by ts-async library
send data asynchronously when true
-OptionalcallBack: ((flushComplete?: boolean) => void)if specified, notify caller when send is complete, the channel should return true to indicate to the caller that it will be called. -If the caller doesn't return true the caller should assume that it may never be called.
-OptionalflushComplete: booleanOptionalsendReason: SendRequestReasonspecify the reason that you are calling "flush" defaults to ManualFlush (1) if not specified
-true to indicate that callback will be called after the flush is complete otherwise the caller
-should assume that any provided callback will never be called, Nothing or if occurring asynchronously a
-IPromise which will be resolved once the unload is complete,
-the IPromise will only be returned when no callback is provided
-and async is true.OptionalpauseOptionalresumeThe default values with a check function
-OptionalblkBlock the value associated with this property from having it's properties / values converted into -dynamic properties, this is generally used to block objects or arrays provided by external libraries -which may be a plain object with readonly (non-configurable) or const properties.
-OptionaldfUse this check to determine the default fallback, default only checked whether the property isDefined,
-therefore null; "" are considered to be valid values.
OptionalfbThe default fallback key if the main key is not present, this is the key value from the config
-OptionalisCallback function to check if the user-supplied value is valid, if not the default will be applied
-OptionalmrgSpecify that any provided value should have the default value(s) merged into the value rather than -just using either the default of user provided values. Mergeed objects will automatically be marked -as referenced.
-OptionalrdSet this field of the target as read-only, which will block this single named property from -ever being changed for the target instance. -This does NOT freeze or seal the instance, it just stops the direct re-assignment of the named property, -if the value is a non-primitive (ie. an object or array) it's properties will still be mutable.
-OptionalrefSet this field of the target as referenced, which will cause any object or array instance -to be updated in-place rather than being entirely replaced. All other values will continue to be replaced. -This is required for nested default objects to avoid multiple repetitive updates to listeners
-OptionalsetOptional function to allow converting and setting of the default value
-OptionalvThe default value to apply if the user-supplied value is not valid
-Configuration provided to SDK core
-Optional ReadonlychannelsChannel queues that is setup by caller in desired order. -If channels are provided here, core will ignore any channels that are already setup, example if there is a SKU with an initialized channel
-OptionalconnectionConnection string of resource. Either this or instrumentationKey must be specified.
-Optionalcookie[Optional] A Cookie Manager configuration which includes hooks to allow interception of the get, set and delete cookie -operations. If this configuration is specified any specified enabled and domain properties will take precedence over the -cookieDomain and disableCookiesUsage values.
-OptionalcookieOptionalcookieOptionalcreate[Optional] Callback function that will be called to create a the IPerfManager instance when required and enablePerfMgr
-is enabled, this enables you to override the default creation of a PerfManager() without needing to setPerfMgr()
-after initialization.
OptionaldiagnosticSet the timer interval (in ms) for internal logging queue, this is the -amount of time to wait after logger.queue messages are detected to be sent. -Note: since 3.0.1 and 2.8.13 the diagnostic logger timer is a normal timeout timer -and not an interval timer. So this now represents the timer "delay" and not -the frequency at which the events are sent.
-Optionaldisable[Optional] A boolean that indicated whether to disable the use of cookies by the SDK. If true, the SDK will not store or -read any data from cookies. Cookie usage can be re-enabled after initialization via the core.getCookieMgr().enable().
-Optionaldisable[Optional] A flag for performance optimization to disable attempting to use the Chrome Debug Extension, if disabled and the extension is installed -this will not send any notifications.
-OptionaldisableOptionaldisable[Optional] An array of page show events that you would like to be ignored, special note there must be at lease one valid show event -hooked, if you list all or the runtime environment only supports a listed (disabled) event it will STILL be hooked, if required by the SDK. -Page Show events include "pageshow" and "visibilitychange" (with 'visible' state)
-Optionaldisable[Optional] An array of the page unload events that you would like to be ignored, special note there must be at least one valid unload -event hooked, if you list all or the runtime environment only supports a listed "disabled" event it will still be hooked, if required by the SDK. -Unload events include "beforeunload", "unload", "visibilitychange" (with 'hidden' state) and "pagehide"
-OptionalenableIf enabled, uncaught exceptions will be thrown to help with debugging
-Optionalenable[Optional] When enabled this will create local perfEvents based on sections of the code that have been instrumented -to emit perfEvents (via the doPerf()) when this is enabled. This can be used to identify performance issues within -the SDK, the way you are using it or optionally your own instrumented code. -The provided IPerfManager implementation does NOT send any additional telemetry events to the server it will only fire -the new perfEvent() on the INotificationManager which you can listen to. -This also does not use the window.performance API, so it will work in environments where this API is not supported.
-OptionalenableWParamAdd "&w=0" parameter to support UA Parsing when web-workers don't have access to Document. -Default is false
-OptionalendpointEndpoint where telemetry data is sent
-Optionalexp[Optional] Set additional configuration for exceptions, such as more scripts to include in the exception telemetry.
-OptionalextensionExtension configs loaded in SDK
-Optional ReadonlyextensionsAdditional plugins that should be loaded by core at runtime
-OptionalfeatureCustom optional value to opt in features
-Optionalid[Optional] Identifies the default length used to generate random session and user id's if non currently exists for the user / session. -Defaults to 22, previous default value was 5, if you need to keep the previous maximum length you should set this value to 5.
-OptionalinitIf your connection string, instrumentation key and endpoint url are promises, -this config is to manually set in memory proxy track calls count limit before promises finished. -Default: 100
-OptionalinitIf your connection string, instrumentation key and endpoint url are promises, -this config is to manually set timeout for those promises. -Default: 50000ms
-OptionalinstrumentationInstrumentation key of resource. Either this or connectionString must be specified.
-OptionalloggingConsole logging level. All logs with a severity level higher -than the configured level will be printed to console. Otherwise -they are suppressed. ie Level 2 will print both CRITICAL and -WARNING logs to console, level 1 prints only CRITICAL.
-Note: Logs sent as telemetry to instrumentation key will also -be logged to console if their severity meets the configured loggingConsoleLevel
-0: ALL console logging off -1: logs to console: severity >= CRITICAL -2: logs to console: severity >= WARNING
-OptionalloggingTelemtry logging level to instrumentation key. All logs with a severity -level higher than the configured level will sent as telemetry data to -the configured instrumentation key.
-0: ALL iKey logging off -1: logs to iKey: severity >= CRITICAL -2: logs to iKey: severity >= WARNING
-OptionalmaxMaximum number of iKey transmitted logging telemetry per page view
-Optionalperf[Optional] Fire every single performance event not just the top level root performance event. Defaults to false.
-OptionalstorageCustom optional value that will be added as a prefix for storage name.
-Delete/Remove the named cookie if cookie support is available and enabled. -Note: Not using "delete" as the name because it's a reserved word which would cause issues on older browsers
-The name of the cookie
-Optionalpath: string[optional] Path to set for the cookie, if not supplied will default to "/"
-Purge the cookie from the system if cookie support is available, this function ignores the enabled setting of the manager -so any cookie will be removed. -Note: Not using "delete" as the name because it's a reserved word which would cause issues on older browsers
-The name of the cookie
-Optionalpath: string[optional] Path to set for the cookie, if not supplied will default to "/"
-Set the named cookie with the value and optional domain and optional
-The name of the cookie
-The value of the cookie (Must already be encoded)
-OptionalmaxAgeSec: number[optional] The maximum number of SECONDS that this cookie should survive
-Optionaldomain: string[optional] The domain to set for the cookie
-Optionalpath: string[optional] Path to set for the cookie, if not supplied will default to "/"
-OptionalunloadUnload and remove any state that this ICookieMgr may be holding, this is generally called when the -owning SDK is being unloaded.
-OptionalisAsync: booleanCan the unload be performed asynchronously (default)
-If the unload occurs synchronously then nothing should be returned, if happening asynchronously then -the function should return an IPromise -/ Promise to allow any listeners to wait for the operation to complete.
-OptionalupdateOptional Callback hook to allow the cookie manager to update it's configuration, not generally implemented now that -dynamic configuration is supported
-Configuration definition for instance based cookie management configuration
-OptionalblockedSpecify the cookie name(s) to never be written, this will cause any cookie name to never be created or updated, -they will still be read unless also included in the ignoreCookies and may still be explicitly purged or deleted. -If not provided defaults to the same list provided in ignoreCookies. (Since v2.8.8)
-OptionaldelHook function to delete the named cookie with the specified value, separated from -setCookie to avoid the need to parse the value to determine whether the cookie is being -added or removed.
-The name of the cookie
-The value to set to expire the cookie
-OptionaldomainCustom cookie domain. This is helpful if you want to share Application Insights cookies across subdomains.
-OptionalenabledDefaults to true, A boolean that indicates whether the use of cookies by the SDK is enabled by the current instance. -If false, the instance of the SDK initialized by this configuration will not store or read any data from cookies
-OptionalgetHook function to fetch the named cookie value.
-The name of the cookie
-OptionalignoreSpecify the cookie name(s) to be ignored, this will cause any matching cookie name to never be read or written.
-They may still be explicitly purged or deleted. You do not need to repeat the name in the blockedCookies
-configuration.(Since v2.8.8)
OptionalpathSpecifies the path to use for the cookie, defaults to '/'
-OptionalsetHook function to set the named cookie with the specified value.
-The name of the cookie
-The value to set for the cookie
-0: OFF -1: only critical (default) -2: critical + info
-The internal logging queue
-OptionaldebugOptionalerrorThis will write an error to the console if possible. -Provided by the default DiagnosticLogger instance, and internally the SDK will fall back to warnToConsole, however, -direct callers MUST check for its existence on the logger as you can provide your own IDiagnosticLogger instance.
-The error message
-OptionallogLogs a message to the internal queue.
-The severity of the log message
-The message to log.
-This method will throw exceptions in debug mode or attempt to log the error as a console warning.
-The severity of the log message
-Optionalproperties: ObjectOptionalisUserAct: booleanOptionalunloadUnload and remove any state that this IDiagnosticLogger may be holding, this is generally called when the -owning SDK is being unloaded.
-OptionalisAsync: booleanCan the unload be performed asynchronously (default)
-If the unload occurs synchronously then nothing should be returned, if happening asynchronously then -the function should return an IPromise -/ Promise to allow any listeners to wait for the operation to complete.
-OptionalupdateOptional Callback hook to allow the diagnostic logger to update it's configuration
-Returns the unique identifier for a trace. All requests / spans from the same trace share the same traceId. -Must be read from incoming headers or generated according to the W3C TraceContext specification, -in a hex representation of 16-byte array. A.k.a. trace-id, TraceID or Distributed TraceID
-Self-generated 8-bytes identifier of the incoming request. Must be a hex representation of 8-byte array. -Also know as the parentId, used to link requests together -https://www.w3.org/TR/trace-context/#parent-id
-Set the unique identifier for a trace. All requests / spans from the same trace share the same traceId. -Must be conform to the W3C TraceContext specification, in a hex representation of 16-byte array. -A.k.a. trace-id, TraceID or Distributed TraceID https://www.w3.org/TR/trace-context/#trace-id
-This interface identifies the config which can track changes
-Set the value that is or will be assigned to this named property of the target will not have it's
-properties converted into dynamic properties, this means that any changes the values properties will
-not be monitored for changes and therefore will not cause any listeners to be notified in any value
-is changed. If the value associated with the target[name] is change this is still dynamic and will
-cause listeners to be notified.
let localValue = target[name]; // If within a listener this will cause the listener to be called again
target[name] = newValue; // This will notify listeners that accessed target[name]
// This will not cause lsiteners to be called because propa is not converted and value of target[name]
// did not change.
target[name].propa = 1;
target[name].propb = 2;
// If within a listener this will caused the listener to be called again only if target[name] is reassigned
// not if the value associated with propa is changed.
let localValue = target[name].propa;
-
-
-Link back to the configuration object that should be used to get/set values
-The logger instance to use to logger any issues
-Helper to call any listeners that are waiting to be notified
-Set this named property of the target as read-only, which will block this single named property from -ever being changed for the target instance. -This does NOT freeze or seal the instance, it just stops the direct re-assignment of the named property, -if the value is a non-primitive (ie. an object or array) it's properties will still be mutable.
-Set this named property of the target as referenced, which will cause any object or array instances -to be updated in-place rather than being entirely replaced. All other values will continue to be replaced.
-Set the value against the provided config/name with the value, the property -will be converted to be dynamic (if not already) as long as the provided config -is already a tracked dynamic object.
-Set default values for the config if not present.
-ReadonlyuidUnique Id for this config handler
-Watch and track changes for accesses to the current config anb
-An interface used to create an event property value along with tagging it as PII, or customer content. -Caution: Customer content and PII are mutually exclusive. You can use only one of them at a time. -If you use both, then the property will be considered invalid, and therefore won't be sent.
-Optionalkind[Optional] The value kind associated with property value. The constant enum ValueKind should be used to specify the -different kinds.
-Optionalproperty[Optional] The data type for the property. Valid values accepted by onecollector are -"string", "bool", "double", "int64", "datetime", "guid". -The EventPropertyType constant enum should be used to specify the different property type values.
-The value for the property.
-An interface used for telemetry event timings.
-OptionalprocessArray of times when each plugin configured in 1DS calls processTelemetry method
-OptionalsendArray of times when a specific channel received a response from endpoint or request timed out
-OptionalsendArray of times when a specific channel tried to send the telemetry to configured endpoint
-OptionalserializationArray of times when a specific channel completed serialization of the telemetry event
-OptionalserializationArray of times when a specific channel started serialization of the telemetry event
-OptionaltrackTime when 1DS Core calls track
-The IExtendedConfiguration interface holds the configuration details passed to core during initialize.
-Optionalanon[Optional] Name of the Anon cookie. The value will be set in the qsp header to collector requests. Collector will use this value to look for specific cookie to use for anid property.
-Optional ReadonlychannelsChannel queues that is setup by caller in desired order. -If channels are provided here, core will ignore any channels that are already setup, example if there is a SKU with an initialized channel
-OptionalconnectionConnection string of resource. Either this or instrumentationKey must be specified.
-Optionalcookie[Optional] A Cookie Manager configuration which includes hooks to allow interception of the get, set and delete cookie -operations. If this configuration is specified any specified enabled and domain properties will take precedence over the -cookieDomain and disableCookiesUsage values.
-OptionalcookieOptionalcookieOptionalcreate[Optional] Callback function that will be called to create a the IPerfManager instance when required and enablePerfMgr
-is enabled, this enables you to override the default creation of a PerfManager() without needing to setPerfMgr()
-after initialization.
OptionaldiagnosticSet the timer interval (in ms) for internal logging queue, this is the -amount of time to wait after logger.queue messages are detected to be sent. -Note: since 3.0.1 and 2.8.13 the diagnostic logger timer is a normal timeout timer -and not an interval timer. So this now represents the timer "delay" and not -the frequency at which the events are sent.
-Optionaldisable[Optional] A boolean that indicated whether to disable the use of cookies by the 1DS Web SDK. The cookies added by the SDK are -MicrosoftApplicationsTelemetryDeviceId. If cookies are disabled, then session events are not sent unless propertyStorageOverride -is provided to store the values elsewhere.
-Optionaldisable[Optional] A flag for performance optimization to disable attempting to use the Chrome Debug Extension, if disabled and the extension is installed -this will not send any notifications.
-Optionaldisable[Optional] Disables additional internal event timings that are added during processing of events, the timings are not sent as part telemetry items to the server
-OptionaldisableOptionaldisable[Optional] An array of page show events that you would like to be ignored, special note there must be at lease one valid show event -hooked, if you list all or the runtime environment only supports a listed (disabled) event it will STILL be hooked, if required by the SDK. -Page Show events include "pageshow" and "visibilitychange" (with 'visible' state)
-Optionaldisable[Optional] An array of the page unload events that you would like to be ignored, special note there must be at least one valid unload -event hooked, if you list all or the runtime environment only supports a listed "disabled" event it will still be hooked, if required by the SDK. -Unload events include "beforeunload", "unload", "visibilitychange" (with 'hidden' state) and "pagehide"
-Optionalenable[Optional] Enables support for objects with compound keys which indirectly represent an object where the "key" of the object contains a "." as part of it's name.
-OptionalenableIf enabled, uncaught exceptions will be thrown to help with debugging
-Optionalenable[Optional] When enabled this will create local perfEvents based on sections of the code that have been instrumented -to emit perfEvents (via the doPerf()) when this is enabled. This can be used to identify performance issues within -the SDK, the way you are using it or optionally your own instrumented code. -The provided IPerfManager implementation does NOT send any additional telemetry events to the server it will only fire -the new perfEvent() on the INotificationManager which you can listen to. -This also does not use the window.performance API, so it will work in environments where this API is not supported.
-OptionalenableWParamAdd "&w=0" parameter to support UA Parsing when web-workers don't have access to Document. -Default is false
-OptionalendpointEndpoint where telemetry data is sent
-Optionalexp[Optional] Set additional configuration for exceptions, such as more scripts to include in the exception telemetry.
-OptionalextensionExtension configs loaded in SDK
-Optional ReadonlyextensionsAdditional plugins that should be loaded by core at runtime
-OptionalfeatureCustom optional value to opt in features
-Optionalid[Optional] Identifies the default length used to generate random session and user id's if non currently exists for the user / session. -Defaults to 22, previous default value was 5, if you need to keep the previous maximum length you should set this value to 5.
-OptionalinitIf your connection string, instrumentation key and endpoint url are promises, -this config is to manually set in memory proxy track calls count limit before promises finished. -Default: 100
-OptionalinitIf your connection string, instrumentation key and endpoint url are promises, -this config is to manually set timeout for those promises. -Default: 50000ms
-OptionalinstrumentationInstrumentation key of resource. Either this or connectionString must be specified.
-OptionalloggingConsole logging level. All logs with a severity level higher -than the configured level will be printed to console. Otherwise -they are suppressed. ie Level 2 will print both CRITICAL and -WARNING logs to console, level 1 prints only CRITICAL.
-Note: Logs sent as telemetry to instrumentation key will also -be logged to console if their severity meets the configured loggingConsoleLevel
-0: ALL console logging off -1: logs to console: severity >= CRITICAL -2: logs to console: severity >= WARNING
-OptionalloggingTelemtry logging level to instrumentation key. All logs with a severity -level higher than the configured level will sent as telemetry data to -the configured instrumentation key.
-0: ALL iKey logging off -1: logs to iKey: severity >= CRITICAL -2: logs to iKey: severity >= WARNING
-OptionalmaxMaximum number of iKey transmitted logging telemetry per page view
-Optionalperf[Optional] Fire every single performance event not just the top level root performance event. Defaults to false.
-Optionalproperty[Optional] The property storage override that should be used to store -internal SDK properties, otherwise stored as cookies. It is needed where cookies are not available.
-OptionalstorageCustom optional value that will be added as a prefix for storage name.
-An interface used to create an event, along with its name, properties, type, timestamp, and priority.
-OptionalbaseTelemetry properties pertaining to domain about which data is being captured. Example, duration, referrerUri for browser page. -These are alternatively referred to as Part B properties for a Common Schema event.
-OptionalbaseTelemetry type used for part B
-OptionaldataProperties to be captured about the telemetry item. -Custom properties (alternatively referred to as Part C properties for a Common Schema event) can be -directly added under data.
-OptionalextSystem context properties of the telemetry item, example: ip address, city etc
-OptionaliIdentifier of the resource that uniquely identifies which resource data is sent to
-OptionallatencyAn EventLatency value, that specifies the latency for the event.The EventLatency constant should be -used to specify the different latency values.
-Unique name of the telemetry item
-Optionalpersistence[Optional] An EventPersistence value, that specifies the persistence for the event. The EventPersistence constant -should be used to specify the different persistence values.
-Optionalsync[Optional] A boolean that specifies whether the event should be sent as a sync request.
-OptionaltagsSystem context property extensions that are not global (not in ctx)
-OptionaltimeTimestamp when item was sent
-Optionaltimings[Optional] A timings object.
-OptionalverCommonSchema Version of this SDK
-This interface defines the object that is passed to any provided FieldValueSanitizerFunc, it provides not only the value to be sanitized but also -some context about the value like it's location within the envelope (serialized object), the format is defined via the -Common Schema 4.0 specification.
-The name of the field with the event path that will store the value
-The path within the event where the value is stored
-The value for the property.
-A reference to the value sanitizer that created the details
-Identifies the type of the property value
-This interface is used during the serialization of individual fields when converting the events into envelope (serialized object) which is sent to the services, -the format is defined via the Common Schema 4.0 specification. The path and field names used are based -on how the data is serialized to the service (CS 4.0 location) and not specifically the location on the event object you pass into the track methods (unless they are the same).
-Get the field sanitizer for this type of field based on the field type, value kind and/or event property type
-The field path
-The name of the field
-The type of field
-OptionaltheKind: numberThe value kind of the field
-OptionalpropType: numberThe property type of the field
-Internal Interface
-OptionalbatchBatch an array of strings into one string
-array of strings
-a string represent all items in the given array
-OptionalcreateCreate 1ds payload data
-ITelemetryItems
-IPayloadData
-Create payload data
-data
-IPayloadData
-Get current endpoint url
-endpoint
-OptionalserializeSerialize an item into a string
-telemetry item
-OptionalconvertUndefined: anyconvert undefined to a custom-defined object
-Serialized string
-OptionalshouldIf the item should be processed by offline channel
-telemetry item
-should process or not
-An interface used for the notification listener.
-Optionalevents[Optional] A function called when events are discarded.
-The array of events that have been discarded.
-The reason for discarding the events. The EventsDiscardedReason -constant should be used to check the different values.
-Optionalevents[Optional] A function called when the events have been requested to be sent to the sever.
-The reason why the event batch is being sent.
-OptionalisAsync: booleanA flag which identifies whether the requests are being sent in an async or sync manner.
-Optionalevents[Optional] A function called when events are sent.
-The array of events that have been sent.
-Optionalperf[Optional] This event is sent if you have enabled perf events, they are primarily used to track internal performance testing and debugging -the event can be displayed via the debug plugin extension.
-OptionalofflineOptionaloffline[Optional] A function called when the offline events have been sent from the persistent storage
-payload data that is sent from the persistent storage
-Optionaloffline[Optional] A function called when the offline events have been stored to the persistent storage
-items that are stored in the persistent storage
-OptionalunloadUnload and remove any state that this INotificationListener may be holding, this is generally called when the -owning Manager is being unloaded.
-OptionalisAsync: booleanCan the unload be performed asynchronously (default)
-If the unload occurs synchronously then nothing should be returned, if happening asynchronously then -the function should return an IPromise -/ Promise to allow any listeners to wait for the operation to complete.
-Class to manage sending notifications to all the listeners.
-Adds a notification listener.
-The notification listener to be added.
-Notification for events being discarded.
-The array of events that have been discarded by the SDK.
-The reason for which the SDK discarded the events. The EventsDiscardedReason -constant should be used to check the different values.
-Optionalevents[Optional] A function called when the events have been requested to be sent to the sever.
-The reason why the event batch is being sent.
-A flag which identifies whether the requests are being sent in an async or sync manner.
-Notification for events sent.
-The array of events that have been sent.
-OptionalofflineOptionaloffline[Optional] A function called when the offline events have been sent from the persistent storage
-payload data that is sent from the persistent storage
-Optionaloffline[Optional] A function called when the offline events have been stored to the persistent storage
-items that are stored in the persistent storage
-Optionalperf[Optional] This event is sent if you have enabled perf events, they are primarily used to track internal performance testing and debugging -the event can be displayed via the debug plugin extension.
-The perf event details
-Removes all instances of the listener.
-AWTNotificationListener to remove.
-OptionalunloadUnload and remove any state that this INotificationManager may be holding, this is generally called when the -owning SDK is being unloaded.
-OptionalisAsync: booleanCan the unload be performed asynchronously (default)
-If the unload occurs synchronously then nothing should be returned, if happening asynchronously then -the function should return an IPromise -/ Promise to allow any listeners to wait for the operation to complete.
-IPayloadData describes interface of payload sent via POST channel
-This interface identifies the details of an internal performance event - it does not represent an outgoing reported event
-OptionalchildThe child perf events that are contained within the total time of this event.
-Mark this event as completed, calculating the total execution time.
-OptionalexIdentifies the exclusive time spent in for this event (not including child events), -this will be undefined until the event is completed.
-OptionalgetGet the names additional context associated with this perf event
-Is this occurring from an asynchronous event
-Identifies whether this event is a child event of a parent
-The name of the performance event
-OptionalparentThe Parent event that was started before this event was created
-The payload (contents) of the perfEvent, may be null or only set after the event has completed depending on -the runtime environment.
-OptionalsetSet the named additional context to be associated with this perf event, this will replace any existing value
-The start time of the performance event
-OptionaltimeIdentifies the total inclusive time spent for this event, including the time spent for child events, -this will be undefined until the event is completed
-This defines an internal performance manager for tracking and reporting the internal performance of the SDK -- It does -not represent or report any event to the server.
-Create a new event and start timing, the manager may return null/undefined to indicate that it does not -want to monitor this source event.
-The source name of the event
-OptionalpayloadDetails: (() => any)An optional callback function to fetch the payload details for the event.
-OptionalisAsync: booleanIs the event occurring from a async event
-Complete the perfEvent and fire any notifications.
-Fire the event which will also complete the passed event
-Identifies an interface to a host that can provide an IPerfManager implementation
-Get the current performance manager
-Set the current performance manager
-The performance manager
-OptionalcoreThe App Insights core to use for backward compatibility. -Therefore the interface will be able to access the core without needing to cast to "any". -[optional] any 3rd party plugins which are already implementing this interface don't fail to compile.
-ReadonlyidentifierExtension name
-Initialize plugin loaded by SDK
-The config for the plugin to use
-The current App Insights core to use for initializing this plugin instance
-The complete set of extensions to be used for initializing the plugin
-OptionalpluginChain: ITelemetryPluginChain[Optional] specifies the current plugin chain which identifies the -set of plugins and the order they should be executed for the current request.
-OptionalisReturns a value that indicates whether the plugin has already been previously initialized. -New plugins should implement this method to avoid being initialized more than once.
-OptionalteardownTear down the plugin and remove any hooked value, the plugin should be removed so that it is no longer initialized and -therefore could be re-initialized after being torn down. The plugin should ensure that once this has been called any further -processTelemetry calls are ignored and it just calls the processNext() with the provided context.
-This is the context that should be used during unloading.
-OptionalunloadState: ITelemetryUnloadStateThe details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.
-boolean - true if the plugin has or will call processNext(), this for backward compatibility as previously teardown was synchronous and returned nothing.
-Optional ReadonlyversionPlugin version (available in data.properties.version in common schema)
-The current context for the current call to processTelemetry(), used to support sharing the same plugin instance -between multiple AppInsights instances
-The current core instance for the request
-Create a new context using the core and config from the current instance, returns a new instance of the same type
-Optionalplugins: IPlugin[] | ITelemetryPluginChainThe execution order to process the plugins, if null or not supplied -then the current execution order will be copied.
-OptionalstartAt: IPluginThe plugin to start processing from, if missing from the execution -order then the next plugin will be NOT set.
-THe current diagnostic logger for the request
-Gets the current core config instance
-Gets the named config from either the named identifier extension or core config if neither exist then the -default value is returned
-The named extension identifier
-The config field name
-OptionaldefaultValue: The default value to return if no defined config exists
-Gets the named extension config
-Returns the next configured plugin proxy
-Helper to allow plugins to check and possibly shortcut executing code only -required if there is a nextPlugin
-Synchronously iterate over the context chain running the callback for each plugin, once -every plugin has been executed via the callback, any associated onComplete will be called.
-Set the function to call when the current chain has executed all processNext or unloadNext items.
-The onComplete to call
-Optionalthat: anyThe "this" value to use for the onComplete call, if not provided or undefined defaults to the current context
-Rest...args: any[]Any additional arguments to pass to the onComplete function
-Call back for telemetry processing before it it is sent
-This is the current event being reported
-boolean (true) if there is no more plugins to process otherwise false or undefined (void)
-Helper to set the next plugin proxy
-The current context for the current call to teardown() implementations, used to support when plugins are being removed -or the SDK is being unloaded.
-The current core instance for the request
-Create a new context using the core and config from the current instance, returns a new instance of the same type
-Optionalplugins: IPlugin[] | ITelemetryPluginChainThe execution order to process the plugins, if null or not supplied -then the current execution order will be copied.
-OptionalstartAt: IPluginThe plugin to start processing from, if missing from the execution -order then the next plugin will be NOT set.
-THe current diagnostic logger for the request
-Gets the current core config instance
-Gets the named config from either the named identifier extension or core config if neither exist then the -default value is returned
-The named extension identifier
-The config field name
-OptionaldefaultValue: The default value to return if no defined config exists
-Gets the named extension config
-Returns the next configured plugin proxy
-Helper to allow plugins to check and possibly shortcut executing code only -required if there is a nextPlugin
-Synchronously iterate over the context chain running the callback for each plugin, once -every plugin has been executed via the callback, any associated onComplete will be called.
-Set the function to call when the current chain has executed all processNext or unloadNext items.
-The onComplete to call
-Optionalthat: anyThe "this" value to use for the onComplete call, if not provided or undefined defaults to the current context
-Rest...args: any[]Any additional arguments to pass to the onComplete function
-This Plugin has finished unloading, so unload the next one
-boolean (true) if there is no more plugins to process otherwise false or undefined (void)
-Helper to set the next plugin proxy
-The IPropertyStorageOverride interface provides a custom interface for storing internal SDK properties - otherwise they are -stored as cookies. -You need this interface when you intend to run auto collection for common properties, or when you log a session in -a non browser environment.
-A function that gets a value for a given key.
-The key for which the value must be fetched.
-A function for passing key value pairs to be stored.
-The key for the key value pair.
-The value for the key value pair.
-Add a telemetry processor to decorate or drop telemetry events.
-The Telemetry Initializer function
-An alternate interface which provides automatic removal during unloading of the component
-Telemety item supported in Core
-OptionalbaseBased on schema for part B
-OptionalbaseTelemetry type used for part B
-OptionaldataCustom data
-OptionalextSystem context properties of the telemetry item, example: ip address, city etc
-OptionaliIdentifier of the resource that uniquely identifies which resource data is sent to
-Unique name of the telemetry item
-OptionaltagsSystem context property extensions that are not global (not in ctx)
-OptionaltimeTimestamp when item was sent
-OptionalverCommonSchema Version of this SDK
-Configuration provided to SDK core
-OptionalcoreThe App Insights core to use for backward compatibility. -Therefore the interface will be able to access the core without needing to cast to "any". -[optional] any 3rd party plugins which are already implementing this interface don't fail to compile.
-ReadonlyidentifierExtension name
-Initialize plugin loaded by SDK
-The config for the plugin to use
-The current App Insights core to use for initializing this plugin instance
-The complete set of extensions to be used for initializing the plugin
-OptionalpluginChain: ITelemetryPluginChain[Optional] specifies the current plugin chain which identifies the -set of plugins and the order they should be executed for the current request.
-OptionalisReturns a value that indicates whether the plugin has already been previously initialized. -New plugins should implement this method to avoid being initialized more than once.
-ReadonlypriorityPriority of the extension
-Call back for telemetry processing before it it is sent
-This is the current event being reported
-OptionalitemCtx: IProcessTelemetryContextThis is the context for the current request, ITelemetryPlugin instances -can optionally use this to access the current core instance or define / pass additional information -to later plugins (vs appending items to the telemetry item)
-OptionalsetSet next extension for telemetry processing, this is not optional as plugins should use the -processNext() function of the passed IProcessTelemetryContext instead. It is being kept for -now for backward compatibility only.
-OptionalteardownTear down the plugin and remove any hooked value, the plugin should be removed so that it is no longer initialized and -therefore could be re-initialized after being torn down. The plugin should ensure that once this has been called any further -processTelemetry calls are ignored and it just calls the processNext() with the provided context.
-This is the context that should be used during unloading.
-OptionalunloadState: ITelemetryUnloadStateThe details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.
-boolean - true if the plugin has or will call processNext(), this for backward compatibility as previously teardown was synchronous and returned nothing.
-OptionalupdateThe the plugin should re-evaluate configuration and update any cached configuration settings or -plugins. If implemented this method will be called whenever a plugin is added or removed and if -the configuration has bee updated.
-This is the context that should be used during updating.
-The details / state of the update process, it holds details like the current and previous configuration.
-boolean - true if the plugin has or will call updateCtx.processNext(), this allows the plugin to perform any asynchronous operations.
-Optional ReadonlyversionPlugin version (available in data.properties.version in common schema)
-Configuration provided to SDK core
-Returns the next plugin
-Returns the underlying plugin that is being proxied for the processTelemetry call
-Call back for telemetry processing before it it is sent
-This is the current event being reported
-OptionalitemCtx: IProcessTelemetryContextThis is the context for the current request, ITelemetryPlugin instances -can optionally use this to access the current core instance or define / pass additional information -to later plugins (vs appending items to the telemetry item)
-OptionalunloadThis plugin is being unloaded and should remove any hooked events and cleanup any global/scoped values, after this -call the plugin will be removed from the telemetry processing chain and will no longer receive any events..
-The unload context to use for this call.
-The details of the unload operation
-OptionalupdateThe the plugin should re-evaluate configuration and update any cached configuration settings or -plugins. If implemented this method will be called whenever a plugin is added or removed and if -the configuration has bee updated.
-This is the context that should be used during updating.
-The details / state of the update process, it holds details like the current and previous configuration.
-boolean - true if the plugin has or will call updateCtx.processNext(), this allows the plugin to perform any asynchronous operations.
-OptionaladdedThis holds a collection of plugins that have been added (if the reason identifies that one or more plugins have been added)
-OptionalcfgThis is a new active configuration that should be used
-OptionalmergeWas the new config requested to be merged with the existing config
-OptionalnewIf this is a configuration update this was the previous configuration that was used
-OptionaloldThe detected changes
-Identifies the reason for the update notification, this is a bitwise numeric value
-OptionalremovedThis holds a collection of plugins that have been removed (if the reason identifies that one or more plugins have been removed)
-Interface which identifiesAdd this hook so that it is automatically removed during unloading
-Optional_doTeardown / Unload hook to allow implementations to perform some additional unload operations before the BaseTelemetryPlugin -finishes it's removal.
-OptionalunloadCtx: IProcessTelemetryUnloadContextThis is the context that should be used during unloading.
-OptionalunloadState: ITelemetryUnloadStateThe details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.
-OptionalasyncCallback: (() => void)An optional callback that the plugin must call if it returns true to inform the caller that it has completed any async unload/teardown operations.
-boolean - true if the plugin has or will call asyncCallback, this allows the plugin to perform any asynchronous operations.
-This interface is used during the serialization of events into envelope (serialized object) which is sent to the services, the format is defined via the -Common Schema 4.0 specification. The path and field names used are based on how the data is serialized -to the service (CS 4.0 location) and not specifically the location on the event object you pass into the track methods (unless they are the same).
-Adds a field sanitizer to the evaluation list
-Add a value sanitizer as a fallback sanitizer if this sanitizer can't handle the path/name.
-Does this field value sanitizer handle this path / field combination
-The field path
-The name of the field
-Sanitizes the Property. It checks the that the property name and value are valid. It also -checks/populates the correct type and pii of the property value.
-The root path of the property
-The property name.
-The property value or an IEventProperty containing value, type ,pii and customer content.
-OptionalstringifyObjects: booleanIf supplied tells the sanitizer that it should JSON stringify() objects
-IEventProperty containing valid name, value, pii and type or null if invalid.
-Removes the field sanitizer to the evaluation list if present
-Removes the value sanitizer as a fallback sanitizer if this sanitizer can't handle the path/name if present.
-Sanitizes the value. It checks the that the property name and value are valid. It also -checks/populates the correct type and pii of the property value.
-The root path of the property
-The property name.
-The property value or an IEventProperty containing value, type ,pii and customer content.
-OptionalstringifyObjects: booleanIf supplied tells the sanitizer that it should JSON stringify() objects
-IEventProperty containing valid name, value, pii and type or null if invalid.
-The current config object
-Set this named property of the target as read-only, which will block this single named property from -ever being changed for the target instance. -This does NOT freeze or seal the instance, it just stops the direct re-assignment of the named property, -if the value is a non-primitive (ie. an object or array) it's properties will still be mutable.
-Set this named property of the target as referenced, which will cause any object or array instance -to be updated in-place rather than being entirely replaced. All other values will continue to be replaced.
-Set the value against the provided config/name with the value, the property -will be converted to be dynamic (if not already) as long as the provided config -is already a tracked dynamic object.
-Set default values for the config if not present.
-The configuration object to set default on (if missing)
-The default values to apply to the config
-An interface which provides automatic removal during unloading of the component
-ReadonlyresponseOptionaluseCapture: booleanOptionaluseCapture: booleanOptionaluseCapture: booleanRemoves the event listener in target's event listener list with the same type, callback, and options.
-Removes the event listener in target's event listener list with the same type, callback, and options.
-Optionaloptions: boolean | EventListenerOptionsThe IXHROverride interface overrides the way HTTP requests are sent.
-ConstThe EventLatency contains a set of values that specify the latency with which an event is sent.
-ConstThe EventPersistence contains a set of values that specify the event's persistence.
-ConstEnum for property types.
-ConstThe EventsDiscardedReason enumeration contains a set of values that specify the reason for discarding an event.
-ConstConstConstConstConstThe ValueKind contains a set of values that specify value kind of the property. -Either PII (Personal Identifiable Information) or customer content.
-ConstConstChecks if document object is available
-ConstChecks if window object is available
-ConstConstConstConstClass that manages adding events to inbound queues and batching of events -into requests.
-Protected Optional_doTeardown / Unload hook to allow implementations to perform some additional unload operations before the BaseTelemetryPlugin -finishes it's removal.
-OptionalunloadCtx: IProcessTelemetryUnloadContextThis is the context that should be used during unloading.
-OptionalunloadState: ITelemetryUnloadStateThe details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.
-OptionalasyncCallback: (() => void)An optional callback that the plugin must call if it returns true to inform the caller that it has completed any async unload/teardown operations.
-boolean - true if the plugin has or will call asyncCallback, this allows the plugin to perform any asynchronous operations.
-Protected Optional_doExtension hook to allow implementations to perform some additional update operations before the BaseTelemetryPlugin finishes it's removal
-OptionalupdateCtx: IProcessTelemetryUpdateContextThis is the context that should be used during updating.
-OptionalupdateState: ITelemetryUpdateStateThe details / state of the update process, it holds details like the current and previous configuration.
-OptionalasyncCallback: (() => void)An optional callback that the plugin must call if it returns true to inform the caller that it has completed any async update operations.
-boolean - true if the plugin has or will call asyncCallback, this allows the plugin to perform any asynchronous operations.
-Protected_getHelper to return the current IProcessTelemetryContext, if the passed argument exists this just -returns that value (helps with minification for callers), otherwise it will return the configured -context or a temporary one.
-OptionalcurrentCtx: IProcessTelemetryContext[Optional] The current execution context
-Protected Readonly_unloadExposes the underlying unload hook container instance for this extension to allow it to be passed down to any sub components of the class. -This should NEVER be exposed or called publically as it's scope is for internal use by BaseTelemetryPlugin and any derived class (which is why -it's scoped as protected)
-Holds the core instance that was used during initialization
-Returns the current diagnostic logger that can be used to log issues, if no logger is currently -assigned a new default one will be created and returned.
-Extension name
-Returns whether the plugin has been initialized
-Priority of the extension
-Call back for telemetry processing before it it is sent
-This is the current event being reported
-This is the context for the current request, ITelemetryPlugin instances -can optionally use this to access the current core instance or define / pass additional information -to later plugins (vs appending items to the telemetry item)
-ProtectedsetInternal helper to allow setting of the internal initialized setting for inherited instances and unit testing
-Set next extension for telemetry processing
-Plugin version (available in data.properties.version in common schema)
-Protected_addAdd this hook so that it is automatically removed during unloading
-The single hook or an array of IInstrumentHook objects
-Protected_addLoad custom transmission profiles. Each profile should have timers for real time, and normal and can -optionally specify the immediate latency time in ms (defaults to 0 when not defined). Each profile should -make sure that a each normal latency timer is a multiple of the real-time latency and the immediate -is smaller than the real-time. -Setting the timer value to -1 means that the events for that latency will not be scheduled to be sent. -Note that once a latency has been set to not send, all latencies below it will also not be sent. The -timers should be in the form of [normal, high, [immediate]]. -e.g Custom: -[10,5] - Sets the normal latency time to 10 seconds and real-time to 5 seconds; Immediate will default to 0ms -[10,5,1] - Sets the normal latency time to 10 seconds and real-time to 5 seconds; Immediate will default to 1ms -[10,5,0] - Sets the normal latency time to 10 seconds and real-time to 5 seconds; Immediate will default to 0ms -[10,5,-1] - Sets the normal latency time to 10 seconds and real-time to 5 seconds; Immediate events will not be -scheduled on their own and but they will be included with real-time or normal events as the first events in a batch. -This also removes any previously loaded custom profiles.
-A dictionary containing the transmit profiles.
-Flush to send data immediately; channel should default to sending data asynchronously. If executing asynchronously (the default) and
-you DO NOT pass a callback function then a IPromise
-will be returned which will resolve once the flush is complete. The actual implementation of the IPromise
-will be a native Promise (if supported) or the default as supplied by ts-async library
send data asynchronously when true
-OptionalcallBack: ((flushComplete?: boolean) => void)if specified, notify caller when send is complete, the channel should return true to indicate to the caller that it will be called. -If the caller doesn't return true the caller should assume that it may never be called.
-OptionalflushComplete: booleanOptionalsendReason: SendRequestReasonspecify the reason that you are calling "flush" defaults to ManualFlush (1) if not specified
-true to indicate that callback will be called after the flush is complete otherwise the caller
-should assume that any provided callback will never be called, Nothing or if occurring asynchronously a
-IPromise which will be resolved once the unload is complete,
-the IPromise will only be returned when no callback is provided
-and async is true.Add an event to the appropriate inbound queue based on its latency.
-The event to be added to the queue.
-OptionalitemCtx: IProcessTelemetryContextThis is the context for the current request, ITelemetryPlugin instances -can optionally use this to access the current core instance or define / pass additional information -to later plugins (vs appending items to the telemetry item)
-Sets the event queue limits at runtime (after initialization), if the number of queued events is greater than the -eventLimit or autoFlushLimit then a flush() operation will be scheduled.
-The number of events that can be kept in memory before the SDK starts to drop events. If the value passed is less than or -equal to zero the value will be reset to the default (10,000).
-OptionalautoFlushLimit: numberWhen defined, once this number of events has been queued the system perform a flush() to send the queued events -without waiting for the normal schedule timers. Passing undefined, null or a value less than or equal to zero will disable the auto flush.
-Tear down the plugin and remove any hooked value, the plugin should be removed so that it is no longer initialized and -therefore could be re-initialized after being torn down. The plugin should ensure that once this has been called any further -processTelemetry calls are ignored and it just calls the processNext() with the provided context.
-OptionalunloadCtx: IProcessTelemetryUnloadContextThis is the context that should be used during unloading.
-OptionalunloadState: ITelemetryUnloadStateThe details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.
-boolean - true if the plugin has or will call processNext(), this for backward compatibility as previously teardown was synchronous and returned nothing.
-The the plugin should re-evaluate configuration and update any cached configuration settings.
-This is the context that should be used during updating.
-The details / state of the update process, it holds details like the current and previous configuration.
-boolean - true if the plugin has or will call updateCtx.processNext(), this allows the plugin to perform any asynchronous operations.
-The IChannelConfiguration interface holds the configuration details passed to Post module.
-Optionaladd[Optional] flag to indicate whether the sendBeacon and fetch (with keep-alive flag) should add the "NoResponseBody" query string -value to indicate that the server should return a 204 for successful requests. Defaults to true
-Optionalalways[Optional] By default during unload (or when you specify to use sendBeacon() or sync fetch (with keep-alive) for an event) the SDK -ignores any provided httpXhrOverride and attempts to use sendBeacon() or fetch(with keep-alive) when they are available. -When this configuration option is true any provided httpXhrOverride will always be used, so any provided httpXhrOverride will -also need to "handle" the synchronous unload scenario.
-Optionalauto[Optional] If defined, when the number of queued events reaches or exceeded this limit this will cause the queue to be immediately -flushed rather than waiting for the normal timers. Defaults to undefined.
-Optionalavoid[Optional] Avoid adding request headers to the outgoing request that would cause a pre-flight (OPTIONS) request to be sent for each request. -This currently defaults to false. This is changed as the collector enables Access-Control-Max-Age to allow the browser to better cache any -previous OPTIONS response. Hence, we moved some of the current dynamic values sent on the query string to a header.
-OptionalclearOverride for clearTimeout
-Optionaldisable[Optional] If defined allows you to disable the auto batch (iKey set of requests) flushing logic. This is in addition to the -default transmission profile timers, autoFlushEventsLimit and eventsLimitInMem config values.
-Optionaldisable[Optional] By default additional timing metrics details are added to each event after they are sent to allow you to review how long it took -to create serialized request. As not all implementations require this level of detail and it's now possible to get the same metrics via -the IPerfManager and IPerfEvent we are enabling these details to be disabled. Default value is false to retain the previous behavior, -if you are not using these metrics and performance is a concern then it is recommended to set this value to true.
-Optionaldisable[Optional] A flag to disable the usage of the fetch with keep-alive support.
-Optionaldisable[Optional] Switch to disable the v8 optimizeObject() calls used to provide better serialization performance. Defaults to false.
-OptionaldisableThe master off switch. Do not send any data if set to TRUE
-Optionaldisable[Optional] When using Xhr for sending requests disable sending as synchronous during unload or synchronous flush. -You should enable this feature for IE (when there is no sendBeacon() or fetch (with keep-alive)) and you have clients -that end up blocking the UI during page unloading. This will cause ALL XHR requests to be sent asynchronously which -during page unload may result in the lose of telemetry.
-Optionalenable[Optional] Enables support for objects with compound keys which indirectly represent an object where the "key" of the object contains a "." as part of it's name.
-Optionalevents[Optional] The number of events that can be kept in memory before the SDK starts to drop events. By default, this is 10,000.
-Optionalexclude:warning: DO NOT USE THIS FLAG UNLESS YOU KNOW THAT PII DATA WILL NEVER BE INCLUDED IN THE EVENT!
-[Optional] Flag to indicate whether the SDK should include the common schema metadata in the payload. Defaults to true. -This flag is only applicable to the POST channel and will cause the SDK to exclude the common schema metadata from the payload, -while this will reduce the size of the payload, also means that the data marked as PII will not be processed as PII by the backend -and will not be included in the PII data purge process.
-Optionalfetch[Optional] Specify whether cross-site Access-Control fetch requests should include credentials such as cookies, -authentication headers, or TLS client certificates.
-Possible values:
-If not set, the default value will be "include".
-For more information, refer to:
- -OptionalhttpXHROverride[Optional] The HTTP override that should be used to send requests, as an IXHROverride object. -By default during the unload of a page or if the event specifies that it wants to use sendBeacon() or sync fetch (with keep-alive), -this override will NOT be called. You can now change this behavior by enabling the 'alwaysUseXhrOverride' configuration value. -The payload data (first argument) now also includes any configured 'timeout' (defaults to undefined) and whether you should avoid -creating any synchronous XHR requests 'disableXhrSync' (defaults to false/undefined)
-OptionalignoreMC1 and MS0 cookies will not be returned from Collector endpoint.
-Optionalimmediate[Optional] Sets the maximum number of immediate latency events that will be cached in memory before the SDK starts to drop other -immediate events only, does not drop normal and real time latency events as immediate events have their own internal queue. Under -normal situations immediate events are scheduled to be sent in the next Javascript execution cycle, so the typically number of -immediate events is small (~1), the only time more than one event may be present is when the channel is paused or immediate send -is disabled (via manual transmit profile). By default max number of events is 500 and the default transmit time is 0ms.
-Optionalmax[Optional] Identifies the number of times any single event will be retried if it receives a failed (retirable) response, this -causes the event to be internally "requeued" and resent in the next batch. As each normal batched send request is retried at -least once before starting to increase the internal backoff send interval, normally batched events will generally be attempted -the next nearest even number of times. This means that the total number of actual send attempts will almost always be even -(setting to 5 will cause 6 requests), unless using manual synchronous flushing (calling flush(false)) which is not subject to -request level retry attempts. -Defaults to 6 times.
-Optionalmax[Optional] Identifies the number of times any single event will be retried if it receives a failed (retriable) response as part -of processing / flushing events once a page unload state has been detected, this causes the event to be internally "requeued" -and resent in the next batch, which during page unload. Unlike the normal batching process, send requests are never retried, -so the value listed here is always the maximum number of attempts for any single event. -Defaults to 2 times. -Notes: -The SDK by default will use the sendBeacon() API if it exists which is treated as a fire and forget successful response, so for -environments that support or supply this API the events won't be retried (because they will be deeded to be successfully sent). -When an environment (IE) doesn't support sendBeacon(), this will cause multiple synchronous (by default) XMLHttpRequests to be sent, -which will block the UI until a response is received. You can disable ALL synchronous XHR requests by setting the 'disableXhrSync' -configuration setting and/or changing this value to 0 or 1.
-OptionaloverrideOverride for Endpoint where telemetry data is sent
-OptionaloverrideOverride for Instrumentation key
-Optionalpayload[Optional] POST channel listener function, used for enabling logging or reporting (RemoteDDVChannel) of the payload that is being sent.
-Optionalpayload[Optional] POST channel preprocessing function. Can be used to gzip the payload before transmission and to set the appropriate -Content-Encoding header. The preprocessor is explicitly not called during teardown when using the sendBeacon() API.
-OptionalsetOverride for setTimeout
-Optionalstringify[Optional] During serialization, when an object is identified, should the object be serialized by JSON.stringify(theObject); (when true) otherwise by theObject.toString(). -Defaults to false
-Optionaltransports[Optional] Either an array or single value identifying the requested TransportType type that should be used. -This is used during initialization to identify the requested send transport, it will be ignored if a httpXHROverride is provided.
-Optionalunload[Optional] Either an array or single value identifying the requested TransportType type(s) that should be used during unload or events -marked as sendBeacon. This is used during initialization to identify the requested send transport, it will be ignored if a httpXHROverride -is provided and alwaysUseXhrOverride is true.
-Optionaluse[Optional] A flag to enable or disable the usage of the sendBeacon() API (if available). If running on ReactNative this defaults
-to false for all other cases it defaults to true.
Optionalvalue[Optional] The value sanitizer to use while constructing the envelope.
-Optionalxhr[Optional] Specify a timeout (in ms) to apply to requests when sending requests using XHR, XDR or fetch requests. Defaults to undefined -and therefore the runtime defaults (normally zero for browser environments)
-IPayloadData describes interface of payload sent via POST channel
-OptionaldisableOptionaldisableOptionalheadersOptionalsendOptionaltimeoutPost channel interface
-Optional_setOverride for setTimeout
-OptionalcoreThe App Insights core to use for backward compatibility. -Therefore the interface will be able to access the core without needing to cast to "any". -[optional] any 3rd party plugins which are already implementing this interface don't fail to compile.
-Diagnostic logger
-ReadonlyidentifierExtension name
-Initialize plugin loaded by SDK
-The config for the plugin to use
-The current App Insights core to use for initializing this plugin instance
-The complete set of extensions to be used for initializing the plugin
-OptionalpluginChain: ITelemetryPluginChain[Optional] specifies the current plugin chain which identifies the -set of plugins and the order they should be executed for the current request.
-OptionalisReturns a value that indicates whether the plugin has already been previously initialized. -New plugins should implement this method to avoid being initialized more than once.
-ReadonlypriorityPriority of the extension
-Call back for telemetry processing before it it is sent
-This is the current event being reported
-OptionalitemCtx: IProcessTelemetryContextThis is the context for the current request, ITelemetryPlugin instances -can optionally use this to access the current core instance or define / pass additional information -to later plugins (vs appending items to the telemetry item)
-OptionalsetSet next extension for telemetry processing, this is not optional as plugins should use the -processNext() function of the passed IProcessTelemetryContext instead. It is being kept for -now for backward compatibility only.
-OptionalteardownTear down the plugin and remove any hooked value, the plugin should be removed so that it is no longer initialized and -therefore could be re-initialized after being torn down. The plugin should ensure that once this has been called any further -processTelemetry calls are ignored and it just calls the processNext() with the provided context.
-This is the context that should be used during unloading.
-OptionalunloadState: ITelemetryUnloadStateThe details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.
-boolean - true if the plugin has or will call processNext(), this for backward compatibility as previously teardown was synchronous and returned nothing.
-OptionalupdateThe the plugin should re-evaluate configuration and update any cached configuration settings or -plugins. If implemented this method will be called whenever a plugin is added or removed and if -the configuration has bee updated.
-This is the context that should be used during updating.
-The details / state of the update process, it holds details like the current and previous configuration.
-boolean - true if the plugin has or will call updateCtx.processNext(), this allows the plugin to perform any asynchronous operations.
-Optional ReadonlyversionPlugin version (available in data.properties.version in common schema)
-The IXHROverride interface overrides the way HTTP requests are sent.
-ConstBest Effort. RealTime Latency events are sent every 9 sec and -Normal Latency events are sent every 18 sec.
-ConstNear Real Time profile. RealTime Latency events are sent every 3 sec and -Normal Latency events are sent every 6 sec.
-ConstReal Time profile (default profile). RealTime Latency events are sent every 1 sec and -Normal Latency events are sent every 2 sec.
-Internal interface to pass appInsights object to subcomponents without coupling
-StaticVersionProtected Optional_doTeardown / Unload hook to allow implementations to perform some additional unload operations before the BaseTelemetryPlugin -finishes it's removal.
-OptionalunloadCtx: IProcessTelemetryUnloadContextThis is the context that should be used during unloading.
-OptionalunloadState: ITelemetryUnloadStateThe details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.
-OptionalasyncCallback: (() => void)An optional callback that the plugin must call if it returns true to inform the caller that it has completed any async unload/teardown operations.
-boolean - true if the plugin has or will call asyncCallback, this allows the plugin to perform any asynchronous operations.
-Protected Optional_doExtension hook to allow implementations to perform some additional update operations before the BaseTelemetryPlugin finishes it's removal
-OptionalupdateCtx: IProcessTelemetryUpdateContextThis is the context that should be used during updating.
-OptionalupdateState: ITelemetryUpdateStateThe details / state of the update process, it holds details like the current and previous configuration.
-OptionalasyncCallback: (() => void)An optional callback that the plugin must call if it returns true to inform the caller that it has completed any async update operations.
-boolean - true if the plugin has or will call asyncCallback, this allows the plugin to perform any asynchronous operations.
-Protected_getHelper to return the current IProcessTelemetryContext, if the passed argument exists this just -returns that value (helps with minification for callers), otherwise it will return the configured -context or a temporary one.
-OptionalcurrentCtx: IProcessTelemetryContext[Optional] The current execution context
-Protected Readonly_unloadExposes the underlying unload hook container instance for this extension to allow it to be passed down to any sub components of the class. -This should NEVER be exposed or called publically as it's scope is for internal use by BaseTelemetryPlugin and any derived class (which is why -it's scoped as protected)
-ReadonlyconfigHolds the core instance that was used during initialization
-Returns the current diagnostic logger that can be used to log issues, if no logger is currently -assigned a new default one will be created and returned.
-Returns whether the plugin has been initialized
-Call back for telemetry processing before it it is sent
-This is the current event being reported
-This is the context for the current request, ITelemetryPlugin instances -can optionally use this to access the current core instance or define / pass additional information -to later plugins (vs appending items to the telemetry item)
-ProtectedsetInternal helper to allow setting of the internal initialized setting for inherited instances and unit testing
-Set next extension for telemetry processing
-OptionalversionPlugin version (available in data.properties.version in common schema)
-Protected_addAdd this hook so that it is automatically removed during unloading
-The single hook or an array of IInstrumentHook objects
-Protected_addCreate a page view telemetry item and send it to the SDK pipeline through the core.track API
-Page view item to be sent
-Optionalproperties: { Custom properties (Part C) that a user can add to the telemetry item
-OptionalsystemProperties: { System level properties (Part A) that a user can add to the telemetry item
-Starts the timer for tracking a page load time. Use this instead of trackPageView if you want to control when the page view timer starts and stops,
-but don't want to calculate the duration yourself. This method doesn't send any telemetry. Call stopTrackPage to log the end of the page view
-and send the event.
Optionalname: stringA string that idenfities this item, unique within this HTML document. Defaults to the document title.
-Log an extended event that you started timing with startTrackEvent.
The string you used to identify this event in startTrackEvent.
Optionalproperties: { map[string, string] - additional data used to filter events and metrics in the portal. Defaults to empty.
-Optionalmeasurements: { map[string, number] - metrics associated with this event, displayed in Metrics Explorer on the portal. Defaults to empty.
-Stops the timer that was started by calling startTrackPage and sends the pageview load time telemetry with the specified properties and measurements.
-The duration of the page view will be the time between calling startTrackPage and stopTrackPage.
Optionalname: stringThe string you used as the name in startTrackPage. Defaults to the document title.
-Optionalurl: stringString - a relative or absolute URL that identifies the page or other item. Defaults to the window location.
-Optionalproperties: { map[string, string] - additional data used to filter pages and metrics in the portal. Defaults to empty.
-Optionalmeasurement: { Tear down the plugin and remove any hooked value, the plugin should be removed so that it is no longer initialized and -therefore could be re-initialized after being torn down. The plugin should ensure that once this has been called any further -processTelemetry calls are ignored and it just calls the processNext() with the provided context.
-OptionalunloadCtx: IProcessTelemetryUnloadContextThis is the context that should be used during unloading.
-OptionalunloadState: ITelemetryUnloadStateThe details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.
-boolean - true if the plugin has or will call processNext(), this for backward compatibility as previously teardown was synchronous and returned nothing.
-input object argument. Only name and average are mandatory.
-OptionalcustomProperties: ICustomPropertiesLog a numeric value that is not associated with a specific event. Typically -used to send regular reports of performance indicators. To send single measurement, just -use the name and average fields of IMetricTelemetry. If you take measurements -frequently, you can reduce the telemetry bandwidth by aggregating multiple measurements -and sending the resulting average at intervals
-ApplicationInsights
-Logs that a page or other item was viewed.
-OptionalpageView: IPageViewTelemetryOptionalcustomProperties: ICustomPropertiesAdditional data used to filter events and metrics. Defaults to empty. -If a user wants to provide duration for pageLoad, it'll have to be in pageView.properties.duration
-The the plugin should re-evaluate configuration and update any cached configuration settings.
-This is the context that should be used during updating.
-The details / state of the update process, it holds details like the current and previous configuration.
-boolean - true if the plugin has or will call updateCtx.processNext(), this allows the plugin to perform any asynchronous operations.
-Internal interface to pass appInsights object to subcomponents without coupling
-Protected Optional_doTeardown / Unload hook to allow implementations to perform some additional unload operations before the BaseTelemetryPlugin -finishes it's removal.
-OptionalunloadCtx: IProcessTelemetryUnloadContextThis is the context that should be used during unloading.
-OptionalunloadState: ITelemetryUnloadStateThe details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.
-OptionalasyncCallback: (() => void)An optional callback that the plugin must call if it returns true to inform the caller that it has completed any async unload/teardown operations.
-boolean - true if the plugin has or will call asyncCallback, this allows the plugin to perform any asynchronous operations.
-Protected Optional_doExtension hook to allow implementations to perform some additional update operations before the BaseTelemetryPlugin finishes it's removal
-OptionalupdateCtx: IProcessTelemetryUpdateContextThis is the context that should be used during updating.
-OptionalupdateState: ITelemetryUpdateStateThe details / state of the update process, it holds details like the current and previous configuration.
-OptionalasyncCallback: (() => void)An optional callback that the plugin must call if it returns true to inform the caller that it has completed any async update operations.
-boolean - true if the plugin has or will call asyncCallback, this allows the plugin to perform any asynchronous operations.
-Protected_getHelper to return the current IProcessTelemetryContext, if the passed argument exists this just -returns that value (helps with minification for callers), otherwise it will return the configured -context or a temporary one.
-OptionalcurrentCtx: IProcessTelemetryContext[Optional] The current execution context
-Protected Readonly_unloadExposes the underlying unload hook container instance for this extension to allow it to be passed down to any sub components of the class. -This should NEVER be exposed or called publically as it's scope is for internal use by BaseTelemetryPlugin and any derived class (which is why -it's scoped as protected)
-Holds the core instance that was used during initialization
-Returns the current diagnostic logger that can be used to log issues, if no logger is currently -assigned a new default one will be created and returned.
-Returns whether the plugin has been initialized
-Call back for telemetry processing before it it is sent
-This is the current event being reported
-This is the context for the current request, ITelemetryPlugin instances -can optionally use this to access the current core instance or define / pass additional information -to later plugins (vs appending items to the telemetry item)
-ProtectedsetInternal helper to allow setting of the internal initialized setting for inherited instances and unit testing
-Set next extension for telemetry processing
-OptionalversionPlugin version (available in data.properties.version in common schema)
-Protected_addAdd this hook so that it is automatically removed during unloading
-The single hook or an array of IInstrumentHook objects
-Protected_addTear down the plugin and remove any hooked value, the plugin should be removed so that it is no longer initialized and -therefore could be re-initialized after being torn down. The plugin should ensure that once this has been called any further -processTelemetry calls are ignored and it just calls the processNext() with the provided context.
-OptionalunloadCtx: IProcessTelemetryUnloadContextThis is the context that should be used during unloading.
-OptionalunloadState: ITelemetryUnloadStateThe details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.
-boolean - true if the plugin has or will call processNext(), this for backward compatibility as previously teardown was synchronous and returned nothing.
-The the plugin should re-evaluate configuration and update any cached configuration settings.
-This is the context that should be used during updating.
-The details / state of the update process, it holds details like the current and previous configuration.
-boolean - true if the plugin has or will call updateCtx.processNext(), this allows the plugin to perform any asynchronous operations.
-Manually update event name. -If current instance is the main instance, then following config changes will be sent out under this new event name. -If current instance is listener instances, it will listen to event details under this new name.
-OptionaleventName: stringnew event name
-ConstOptionalblkDetermines if fetching the CDN endpoint should be blocked or not.
-OptionalcfgCDN endpoint for fetching configuration. If cfgUrl is defined, instance will NOT listen to core configuration changes.
-OptionalcustomEvent name for sending or listening to configuration change details
-OptionalnonWhen current instance is set with syncMode: Receive, config fields under nonOverrideConfigs will NOT be changed by any config details sent out from other instances.
-NOTE: this config will be ONLY applied during initialization, so it won't be changed dynamically
OptionalonOverrides callback function to handle event details when changes are received via event listener.
-OptionaloverrideOverrides fetch function to get config from cfgUrl when cfgUrl is defined.
-OptionaloverrideOverrides sync() function to broadcast changes.\
-OptionalscheduleIdentifies the time interval (in milliseconds) for fetching config details from cfgUrl when cfgUrl is defined. -Default to 30 mins, 30601000ms. -If set to 0, the fetch operation will only be called once during initialization.
-OptionalsyncIdentifies whether instance should receive or broadcast config changes
-Manually update event name. -If current instance is the main instance, then following config changes will be sent out under this new event name. -If current instance is listener instances, it will listen to event details under this new name.
-OptionaleventName: stringnew event name
-AppId of this component parsed from some backend response.
-A send buffer object
-Protected Optional_doTeardown / Unload hook to allow implementations to perform some additional unload operations before the BaseTelemetryPlugin -finishes it's removal.
-OptionalunloadCtx: IProcessTelemetryUnloadContextThis is the context that should be used during unloading.
-OptionalunloadState: ITelemetryUnloadStateThe details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.
-OptionalasyncCallback: (() => void)An optional callback that the plugin must call if it returns true to inform the caller that it has completed any async unload/teardown operations.
-boolean - true if the plugin has or will call asyncCallback, this allows the plugin to perform any asynchronous operations.
-Protected Optional_doExtension hook to allow implementations to perform some additional update operations before the BaseTelemetryPlugin finishes it's removal
-OptionalupdateCtx: IProcessTelemetryUpdateContextThis is the context that should be used during updating.
-OptionalupdateState: ITelemetryUpdateStateThe details / state of the update process, it holds details like the current and previous configuration.
-OptionalasyncCallback: (() => void)An optional callback that the plugin must call if it returns true to inform the caller that it has completed any async update operations.
-boolean - true if the plugin has or will call asyncCallback, this allows the plugin to perform any asynchronous operations.
-Protected_getHelper to return the current IProcessTelemetryContext, if the passed argument exists this just -returns that value (helps with minification for callers), otherwise it will return the configured -context or a temporary one.
-OptionalcurrentCtx: IProcessTelemetryContext[Optional] The current execution context
-Protected_sampleA method which will cause data to be send to the url
-Readonly_senderThe configuration for this sender instance
-Protected Readonly_unloadExposes the underlying unload hook container instance for this extension to allow it to be passed down to any sub components of the class. -This should NEVER be exposed or called publically as it's scope is for internal use by BaseTelemetryPlugin and any derived class (which is why -it's scoped as protected)
-Holds the core instance that was used during initialization
-Returns the current diagnostic logger that can be used to log issues, if no logger is currently -assigned a new default one will be created and returned.
-ReadonlyidentifierReturns whether the plugin has been initialized
-ReadonlypriorityCall back for telemetry processing before it it is sent
-This is the current event being reported
-This is the context for the current request, ITelemetryPlugin instances -can optionally use this to access the current core instance or define / pass additional information -to later plugins (vs appending items to the telemetry item)
-ProtectedsetInternal helper to allow setting of the internal initialized setting for inherited instances and unit testing
-Set next extension for telemetry processing
-OptionalversionPlugin version (available in data.properties.version in common schema)
-Protected_addAdd this hook so that it is automatically removed during unloading
-The single hook or an array of IInstrumentHook objects
-Protected_addStaticconstructFlush to send data immediately; channel should default to sending data asynchronously. If executing asynchronously (the default) and
-you DO NOT pass a callback function then a IPromise
-will be returned which will resolve once the flush is complete. The actual implementation of the IPromise
-will be a native Promise (if supported) or the default as supplied by ts-async library
send data asynchronously when true
-OptionalcallBack: ((flushComplete?: boolean) => void)if specified, notify caller when send is complete, the channel should return true to indicate to the caller that it will be called. -If the caller doesn't return true the caller should assume that it may never be called.
-OptionalflushComplete: booleantrue to indicate that callback will be called after the flush is complete otherwise the caller
-should assume that any provided callback will never be called, Nothing or if occurring asynchronously a
-IPromise which will be resolved once the unload is complete,
-the IPromise will only be returned when no callback is provided
-and async is true.Pause the sending (transmission) of events, this will cause all events to be batched only until the maximum limits are -hit at which point new events are dropped. Will also cause events to NOT be sent during page unload, so if Session storage -is disabled events will be lost. -SessionStorage Limit is 2000 events, In-Memory (Array) Storage is 10,000 events (can be configured via the eventsLimitInMem).
-Tear down the plugin and remove any hooked value, the plugin should be removed so that it is no longer initialized and -therefore could be re-initialized after being torn down. The plugin should ensure that once this has been called any further -processTelemetry calls are ignored and it just calls the processNext() with the provided context.
-OptionalunloadCtx: IProcessTelemetryUnloadContextThis is the context that should be used during unloading.
-OptionalunloadState: ITelemetryUnloadStateThe details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.
-boolean - true if the plugin has or will call processNext(), this for backward compatibility as previously teardown was synchronous and returned nothing.
-Trigger the immediate send of buffered data; If executing asynchronously (the default) this may (not required) return
-an IPromise that will resolve once the
-send is complete. The actual implementation of the IPromise will be a native Promise (if supported) or the default
-as supplied by ts-async library
Indicates if the events should be sent asynchronously
-OptionalforcedSender: SenderFunction{SenderFunction} - Indicates the forcedSender, undefined if not passed
-OptionalsendReason: SendRequestReasonThe the plugin should re-evaluate configuration and update any cached configuration settings.
-This is the context that should be used during updating.
-The details / state of the update process, it holds details like the current and previous configuration.
-boolean - true if the plugin has or will call updateCtx.processNext(), this allows the plugin to perform any asynchronous operations.
-Optionalalways[Optional] By default during unload (or when you specify to use sendBeacon() or sync fetch (with keep-alive) for an event) the SDK -ignores any provided httpXhrOverride and attempts to use sendBeacon() or fetch(with keep-alive) when they are available. -When this configuration option is true any provided httpXhrOverride will always be used, so any provided httpXhrOverride will -also need to "handle" the synchronous unload scenario.
-Specify the storage buffer type implementation.
-(Optional) Provide user an option to convert undefined field to user defined value.
-(Optional) The ability for the user to provide extra headers
-Optionaldisable[Optional] Disable events splitting during sendbeacon. -Default: false
-The master off switch. Do not send any data if set to TRUE
-Don't use XMLHttpRequest or XDomainRequest (for IE < 9) by default instead attempt to use fetch() or sendBeacon. -If no other transport is available it will still use XMLHttpRequest
-The JSON format (normal vs line delimited). True means line delimited JSON.
-Optionalenable(Optional) Enable the sender to return a promise so that manually flushing (and general sending) can wait for the request to finish. -Note: Enabling this may cause unhandled promise rejection errors to occur if you do not listen and handle any rejection response, -this should only be for manual flush attempts. -Defaults to false
-Store a copy of a send buffer in the session storage
-The url to which payloads will be sent
-(Optional) The number of events that can be kept in memory before the SDK starts to drop events. By default, this is 10,000.
-OptionalhttpXHROverride[Optional] The HTTP override that should be used to send requests, as an IXHROverride object. -By default during the unload of a page or if the event specifies that it wants to use sendBeacon() or sync fetch (with keep-alive), -this override will NOT be called. -If alwaysUseXhrOverride configuration value is set to true, the override will always be used. -The payload data (first argument) now also includes any configured 'timeout' (defaults to undefined) and whether you should avoid -creating any synchronous XHR requests 'disableXhr' (defaults to false/undefined)
-(Optional) Override the instrumentation key that this channel instance sends to
-Is retry handler disabled. -If enabled, retry on 206 (partial success), 408 (timeout), 429 (too many requests), 500 (internal server error) and 503 (service unavailable).
-The maximum interval allowed between calls to batchInvoke
-The maximum size of a batch in bytes
-Optionalmax(Optional) The specific max retry count for each telemetry item. -Default: 10 -if it is set to 0, means no retry allowed -if it is set to undefined, means no limit for retry times
-Is beacon disabled on page unload. -If enabled, flush events through beaconSender.
-If fetch keepalive is supported do not use it for sending events during unload, it may still fallback to fetch() without keepalive
-Optionalretry(Optional) The specific error codes that will cause a retry of sending data to the backend.
-Optionaltransports[Optional] Either an array or single value identifying the requested TransportType type that should be used. -This is used during initialization to identify the requested send transport, it will be ignored if a httpXHROverride is provided.
-Optionalunload[Optional] Either an array or single value identifying the requested TransportType type(s) that should be used during unload or events -marked as sendBeacon. This is used during initialization to identify the requested send transport, it will be ignored if a httpXHROverride -is provided and alwaysUseXhrOverride is true.
-StaticVersionProtected Optional_doTeardown / Unload hook to allow implementations to perform some additional unload operations before the BaseTelemetryPlugin -finishes it's removal.
-OptionalunloadCtx: IProcessTelemetryUnloadContextThis is the context that should be used during unloading.
-OptionalunloadState: ITelemetryUnloadStateThe details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.
-OptionalasyncCallback: (() => void)An optional callback that the plugin must call if it returns true to inform the caller that it has completed any async unload/teardown operations.
-boolean - true if the plugin has or will call asyncCallback, this allows the plugin to perform any asynchronous operations.
-Protected Optional_doExtension hook to allow implementations to perform some additional update operations before the BaseTelemetryPlugin finishes it's removal
-OptionalupdateCtx: IProcessTelemetryUpdateContextThis is the context that should be used during updating.
-OptionalupdateState: ITelemetryUpdateStateThe details / state of the update process, it holds details like the current and previous configuration.
-OptionalasyncCallback: (() => void)An optional callback that the plugin must call if it returns true to inform the caller that it has completed any async update operations.
-boolean - true if the plugin has or will call asyncCallback, this allows the plugin to perform any asynchronous operations.
-Protected_getHelper to return the current IProcessTelemetryContext, if the passed argument exists this just -returns that value (helps with minification for callers), otherwise it will return the configured -context or a temporary one.
-OptionalcurrentCtx: IProcessTelemetryContext[Optional] The current execution context
-Protected Readonly_unloadExposes the underlying unload hook container instance for this extension to allow it to be passed down to any sub components of the class. -This should NEVER be exposed or called publically as it's scope is for internal use by BaseTelemetryPlugin and any derived class (which is why -it's scoped as protected)
-Holds the core instance that was used during initialization
-Returns the current diagnostic logger that can be used to log issues, if no logger is currently -assigned a new default one will be created and returned.
-Returns whether the plugin has been initialized
-Call back for telemetry processing before it it is sent
-This is the current event being reported
-This is the context for the current request, ITelemetryPlugin instances -can optionally use this to access the current core instance or define / pass additional information -to later plugins (vs appending items to the telemetry item)
-ProtectedsetInternal helper to allow setting of the internal initialized setting for inherited instances and unit testing
-Set next extension for telemetry processing
-OptionalversionPlugin version (available in data.properties.version in common schema)
-Protected_addAdd this hook so that it is automatically removed during unloading
-The single hook or an array of IInstrumentHook objects
-Protected_addTear down the plugin and remove any hooked value, the plugin should be removed so that it is no longer initialized and -therefore could be re-initialized after being torn down. The plugin should ensure that once this has been called any further -processTelemetry calls are ignored and it just calls the processNext() with the provided context.
-OptionalunloadCtx: IProcessTelemetryUnloadContextThis is the context that should be used during unloading.
-OptionalunloadState: ITelemetryUnloadStateThe details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.
-boolean - true if the plugin has or will call processNext(), this for backward compatibility as previously teardown was synchronous and returned nothing.
-The the plugin should re-evaluate configuration and update any cached configuration settings.
-This is the context that should be used during updating.
-The details / state of the update process, it holds details like the current and previous configuration.
-boolean - true if the plugin has or will call updateCtx.processNext(), this allows the plugin to perform any asynchronous operations.
-ClickAnalytics Configuration
-OptionalautoAutomatic capture configuration. Default is true
-OptionalbehaviorValidator to use for the data-bhvr value
-OptionalcallbackCallbacks configuration
-OptionalcoreCore data configuration
-OptionaldataCustom Data Tags provided to ovverride default tags used to capture click data.
-OptionaldefaultDefault Behavior value when Right Click event has occured. This -value will be ovverriden if the element has the data-*-bhvr attribute present.
-OptionaldropFlag to drop events that do not have custom event names, no parentId and no data in content (basically no useful click data). -Default will be false
-OptionalpagePage tags
-OptionalurlEnables the logging of values after a "#" character of the URL. Default is "false."
-OptionalurlEnables the logging of the query string of the URL. Default is "false."
-StaticgetOptionalidentifier: stringReadonlyapplicationApplication build.
-ReadonlyapplicationApplication id.
-ReadonlyapplicationApplication layer.
-ReadonlyapplicationApplication type id.
-ReadonlyapplicationApplication version. Information in the application context fields is always about the application that is sending the telemetry.
-ReadonlycloudReadonlycloudReadonlycloudReadonlycloudReadonlycloudName of the role the application is a part of. Maps directly to the role name in azure.
-ReadonlycloudName of the instance where the application is running. Computer name for on-premisis, instance name for Azure.
-ReadonlycloudReadonlydeviceReadonlydeviceThe browser name and version as reported by the browser.
-ReadonlydeviceReadonlydeviceUnique client device id. Computer name in most cases.
-ReadonlydeviceReadonlydeviceReadonlydeviceDevice locale using
ReadonlydeviceReadonlydeviceModel of the device the end user of the application is using. Used for client scenarios. If this field is empty then it is derived from the user agent.
-ReadonlydeviceReadonlydeviceReadonlydeviceOEMNameClient device OEM name taken from the browser.
-ReadonlydeviceOSReadonlydeviceOSVersionOperating system name and version of the device the end user of the application is using. If this field is empty then it is derived from the user agent. Example 'Windows 10 Pro 10.0.10586.0'
-ReadonlydeviceName of the instance where application is running. Computer name for on-premisis, instance name for Azure.
-ReadonlydeviceName of the role application is part of. Maps directly to the role name in azure.
-ReadonlydeviceReadonlydeviceThe type of the device the end user of the application is using. Used primarily to distinguish JavaScript telemetry from server side telemetry. Examples: 'PC', 'Phone', 'Browser'. 'PC' is the default value.
-ReadonlydeviceVMNameReadonlyinternalAgent version. Used to indicate the version of StatusMonitor installed on the computer if it is used for data collection.
-ReadonlyinternalThis is the node name used for billing purposes. Use it to override the standard detection of nodes.
-ReadonlyinternalThis identifies the source of the Sdk script (used to identify whether the SDK was loaded via the CDN)
-ReadonlyinternalSDK version. See https://github.com/microsoft/ApplicationInsights-Home/blob/master/SDK-AUTHORING.md#sdk-version-specification for information.
-ReadonlyinternalThis identifies the version of the snippet that was used to initialize the SDK
-ReadonlylocationThe city of the client device. If any of Country, Province, or City is specified, those values will be preferred over geolocation of the IP address field. Information in the location context fields is always about the end user. When telemetry is sent from a service, the location context is about the user that initiated the operation in the service.
-ReadonlylocationThe country of the client device. If any of Country, Province, or City is specified, those values will be preferred over geolocation of the IP address field. Information in the location context fields is always about the end user. When telemetry is sent from a service, the location context is about the user that initiated the operation in the service.
-ReadonlylocationThe IP address of the client device. IPv4 and IPv6 are supported. Information in the location context fields is always about the end user. When telemetry is sent from a service, the location context is about the user that initiated the operation in the service.
-ReadonlylocationThe province/state of the client device. If any of Country, Province, or City is specified, those values will be preferred over geolocation of the IP address field. Information in the location context fields is always about the end user. When telemetry is sent from a service, the location context is about the user that initiated the operation in the service.
-ReadonlyoperationThe correlation vector is a light weight vector clock which can be used to identify and order related events across clients and services.
-ReadonlyoperationA unique identifier for the operation instance. The operation.id is created by either a request or a page view. All other telemetry sets this to the value for the containing request or page view. Operation.id is used for finding all the telemetry items for a specific operation instance.
-ReadonlyoperationThe name (group) of the operation. The operation.name is created by either a request or a page view. All other telemetry items set this to the value for the containing request or page view. Operation.name is used for finding all the telemetry items for a group of operations (i.e. 'GET Home/Index').
-ReadonlyoperationThe unique identifier of the telemetry item's immediate parent.
-ReadonlyoperationReadonlyoperationName of synthetic source. Some telemetry from the application may represent a synthetic traffic. It may be web crawler indexing the web site, site availability tests or traces from diagnostic libraries like Application Insights SDK itself.
-ReadonlysessionSession ID - the instance of the user's interaction with the app. Information in the session context fields is always about the end user. When telemetry is sent from a service, the session context is about the user that initiated the operation in the service.
-ReadonlysessionBoolean value indicating whether the session identified by ai.session.id is first for the user or not.
-ReadonlysessionReadonlyuserReadonlyuserIn multi-tenant applications this is the account ID or name which the user is acting with. Examples may be subscription ID for Azure portal or blog name blogging platform.
-ReadonlyuserThe browser's user agent string as reported by the browser. This property will be used to extract informaiton regarding the customer's browser but will not be stored. Use custom properties to store the original user agent.
-ReadonlyuserReadonlyuserAuthenticated user id. The opposite of ai.user.id, this represents the user with a friendly name. Since it's PII information it is not collected by default by most SDKs.
-ReadonlyuserReadonlyuserAnonymous user id. Represents the end user of the application. When telemetry is sent from a service, the user context is about the user that initiated the operation in the service.
-ReadonlyuserStore region for UWP applications.
-Data struct to contain both B and C sections.
-The data contract for serializing this object.
-Telemetry data item.
-The application's instrumentation key. The key is typically represented as a GUID, but there are cases when it is not a guid. No code should rely on iKey being a GUID. Instrumentation key is case insensitive.
-Type name of telemetry data item.
-Sampling rate used in application. This telemetry item represents 1 / sampleRate actual telemetry items.
-Sequence field used to track absolute order of uploaded events.
-Key/value collection of context properties. See ContextTagKeys for information on available properties.
-Event date time when telemetry item was created. This is the wall clock time on the client when the event was generated. There is no guarantee that the client's time is accurate. This field must be formatted in UTC ISO 8601 format, with a trailing 'Z' character, as described publicly on https://en.wikipedia.org/wiki/ISO_8601#UTC. Note: the number of decimal seconds digits provided are variable (and unspecified). Consumers should handle this, i.e. managed code consumers should not use format 'O' for parsing as it specifies a fixed length. Example: 2009-06-15T13:45:30.0000000Z.
-Envelope version. For internal use only. By assigning this the default, it will not be serialized within the payload unless changed to a value other than #1.
-The set of fields for a serializable object. -This defines the serialization order and a value of true/false -for each field defines whether the field is required or not.
-StaticdataStaticenvelopeCollection of custom measurements.
-Event name. Keep it low cardinality to allow proper grouping and useful metrics.
-Collection of custom properties.
-Schema version
-Constructs a new instance of the ExceptionTelemetry object
-Optionalproperties: { Optionalmeasurements: { OptionalseverityLevel: numberOptionalid: stringThe set of fields for a serializable object. -This defines the serialization order and a value of true/false -for each field defines whether the field is required or not.
-StaticdataStaticenvelopeException chain - list of inner exceptions.
-StaticformatFormats the provided errorObj for display and reporting, it may be a String, Object, integer or undefined depending on the browser.
-The supplied errorObj
-OptionalidOptionalisCollection of custom measurements.
-OptionalproblemCollection of custom properties.
-Severity level. Mostly used to indicate exception severity level when it is reported by logging library.
-Schema version
-StaticCreateOptionalevt: string | EventOptionalstack: stringOptionalerrorSrc: stringStaticCreateOptionalproperties: anyOptionalmeasurements: { StaticCreateConstructs a new instance of the MetricTelemetry object
-Optionalcount: numberOptionalmin: numberOptionalmax: numberOptionalstdDev: numberOptionalproperties: anyOptionalmeasurements: { The set of fields for a serializable object. -This defines the serialization order and a value of true/false -for each field defines whether the field is required or not.
-StaticdataStaticenvelopeCollection of custom measurements.
-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.
-Collection of custom properties.
-Schema version
-An instance of PageView represents a generic action on a page like a button click. It is also the base type for PageView.
-Constructs a new instance of the PageEventTelemetry object
-Optionalname: stringOptionalurl: stringOptionaldurationMs: numberOptionalproperties: { Optionalmeasurements: { Optionalid: stringThe set of fields for a serializable object. -This defines the serialization order and a value of true/false -for each field defines whether the field is required or not.
-StaticdataRequest duration in format: DD.HH:MM:SS.MMMMMM. For a page view (PageViewData), this is the duration. For a page view with performance information (PageViewPerfData), this is the page load time. Must be less than 1000 days.
-StaticenvelopeIdentifier of a page view instance. Used for correlation between page view and other telemetry items.
-Collection of custom measurements.
-Event name. Keep it low cardinality to allow proper grouping and useful metrics.
-Collection of custom properties.
-Request URL with all query string parameters
-Schema version
-Constructs a new instance of the PageEventTelemetry object
-Optionalproperties: { Optionalmeasurements: { Optionalcs4BaseData: IPageViewPerformanceTelemetryThe set of fields for a serializable object. -This defines the serialization order and a value of true/false -for each field defines whether the field is required or not.
-StaticdataDOM processing time in TimeSpan 'G' (general long) format: d:hh:mm:ss.fffffff
-Request duration in format: DD.HH:MM:SS.MMMMMM. For a page view (PageViewData), this is the duration. For a page view with performance information (PageViewPerfData), this is the page load time. Must be less than 1000 days.
-StaticenvelopeIdentifier of a page view instance. Used for correlation between page view and other telemetry items.
-Collection of custom measurements.
-Event name. Keep it low cardinality to allow proper grouping and useful metrics.
-Network connection time in TimeSpan 'G' (general long) format: d:hh:mm:ss.fffffff
-Performance total in TimeSpan 'G' (general long) format: d:hh:mm:ss.fffffff
-Collection of custom properties.
-Received response time in TimeSpan 'G' (general long) format: d:hh:mm:ss.fffffff
-Sent request time in TimeSpan 'G' (general long) format: d:hh:mm:ss.fffffff
-Request URL with all query string parameters
-Schema version
-Constructs a new instance of the RemoteDependencyData object
-Optionalmethod: stringOptionalcorrelationContext: stringOptionalproperties: ObjectOptionalmeasurements: ObjectThe set of fields for a serializable object. -This defines the serialization order and a value of true/false -for each field defines whether the field is required or not.
-Command initiated by this dependency call. Examples are SQL statement and HTTP URL's with all query parameters.
-StaticdataRequest duration in format: DD.HH:MM:SS.MMMMMM. Must be less than 1000 days.
-StaticenvelopeIdentifier of a dependency call instance. Used for correlation with the request telemetry item corresponding to this dependency call.
-Collection of custom measurements.
-Name of the command initiated with this dependency call. Low cardinality value. Examples are stored procedure name and URL path template.
-Collection of custom properties.
-Result code of a dependency call. Examples are SQL error code and HTTP status code.
-Indication of successful or unsuccessful call.
-Target site of a dependency call. Examples are server name, host address.
-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.
-Schema version
-StaticcreateCreate a telemetry item that the 1DS channel understands
-Create a telemetry item that the 1DS channel understands
-domain specific properties; part B
-telemetry item type. ie PageViewData
-name of the envelope. ie Microsoft.ApplicationInsights.
OptionalcustomProperties: { user defined custom properties; part C
-OptionalsystemProperties: { system properties that are added to the context; part A
-ITelemetryItem that is sent to channel
-domain specific properties; part B
-telemetry item type. ie PageViewData
-name of the envelope. ie Microsoft.ApplicationInsights.
user defined custom properties; part C
-system properties that are added to the context; part A
-ITelemetryItem that is sent to channel
-OptionalnamePrefix: stringConstructs a new instance of the TraceTelemetry object
-OptionalseverityLevel: numberOptionalproperties: anyOptionalmeasurements: { The set of fields for a serializable object. -This defines the serialization order and a value of true/false -for each field defines whether the field is required or not.
-StaticdataStaticenvelopeCollection of custom measurements.
-Trace message
-Collection of custom properties.
-Trace severity level.
-Schema version
-ConstMax length allowed for exceptions.
-Max length allowed for Id field in page views.
-Max length allowed for messages.
-Max length allowed for custom names.
-Max length allowed for custom values.
-Max length allowed for names
-Max length allowed for url.
-ConstEnum is used in aiDataContract to describe how fields are serialized. -For instance: (Fieldtype.Required | FieldType.Array) will mark the field as required and indicate it's an array
-ConstConstConstDefines the level of severity for the event.
-Checks if a request url is not on a excluded domain list and if it is safe to add correlation headers. -Headers are always included if the current domain matches the request domain. If they do not match (CORS), -they are regex-ed across correlationHeaderDomains and correlationHeaderExcludedDomains to determine if headers are included. -Some environments don't give information on currentHost via window.location.host (e.g. Cordova). In these cases, the user must -manually supply domains to include correlation headers on. Else, no headers will be included at all.
-OptionalcurrentHost: stringCreates a IDistributedTraceContext from an optional telemetryTrace
-OptionaltelemetryTrace: ITelemetryTraceThe telemetryTrace instance that is being wrapped
-OptionalparentCtx: IDistributedTraceContextAn optional parent distributed trace instance, almost always undefined as this scenario is only used in the case of multiple property handlers.
-A new IDistributedTraceContext instance that is backed by the telemetryTrace or temporary object
-Create a new OfflineListener instance to monitor browser online / offline events
-OptionalparentEvtNamespace: string | string[]The parent event namespace to append to any specific events for this instance
-Create a new ITraceParent instance using the provided values.
-OptionaltraceId: stringThe traceId to use, when invalid a new random W3C id will be generated.
-OptionalspanId: stringThe parent/span id to use, a new random value will be generated if it is invalid.
-Optionalflags: numberThe traceFlags to use, defaults to zero (0) if not supplied or invalid
-Optionalversion: stringThe version to used, defaults to version "01" if not supplied or invalid.
-Helper function to fetch the passed traceparent from the page, looking for it as a meta-tag or a Server-Timing header.
-OptionalselectIdx: numberIf the found value is comma separated which is the preferred entry to select, defaults to the first
-Format the ITraceParent value as a string using the supported and know version formats. -So even if the passed traceParent is a later version the string value returned from this -function will convert it to only the known version formats. -This currently only supports version "00" and invalid "ff"
-The parsed traceParent value
-Checks if HTML5 Beacons are supported in the current environment.
-OptionaluseCached: boolean[Optional] used for testing to bypass the cached lookup, when true this will
-cause the cached global to be reset.
True if supported, false otherwise.
-Is the parsed traceParent indicating that the trace is currently sampled.
-The parsed traceParent value
-Is the provided W3c span id (aka. parent id) a valid string representation, it must be a 16-character -string of lowercase hexadecimal characters, for example, 00f067aa0ba902b7. -If all characters are zero (0000000000000000) this is considered an invalid value.
-The W3c span id to be validated
-true if valid otherwise false
-Is the provided W3c Trace Id a valid string representation, it must be a 32-character string -of lowercase hexadecimal characters for example, 4bf92f3577b34da6a3ce929d0e0e4736. -If all characters as zero (00000000000000000000000000000000) it will be considered an invalid value.
-The W3c trace Id to be validated
-true if valid otherwise false
-Validates that the provided ITraceParent instance conforms to the currently supported specifications
-OptionalconnectionString: stringAttempt to parse the provided string as a W3C TraceParent header value (https://www.w3.org/TR/trace-context/#traceparent-header)
-The value to be parsed
-OptionalselectIdx: numberIf the found value is comma separated which is the preferred entry to select, defaults to the first
-Returns whether LocalStorage can be used, if the reset parameter is passed a true this will override -any previous disable calls.
-Optionalreset: booleanShould the usage be reset and determined only based on whether LocalStorage is available
-Data struct to contain both B and C sections.
-OptionalcustomProperties: { OptionalcustomProperties: { OptionalcustomProperties: { OptionalcustomProperties: { OptionalcustomProperties: { OptionalcustomProperties: { Configuration settings for how telemetry is sent
-OptionalaccountAn optional account id, if your app groups users into accounts. No spaces, commas, semicolons, equals, or vertical bars.
-Optionaladd[Optional] Flag to indicate whether the internal looking endpoints should be automatically
-added to the excludeRequestFromAutoTrackingPatterns collection. (defaults to true).
-This flag exists as the provided regex is generic and may unexpectedly match a domain that
-should not be excluded.
OptionaladdProvide a way to enrich dependencies logs with context at the beginning of api call. -Default is undefined.
-OptionalajaxThe amount of time to wait before re-attempting to find the windows.performance timings -for an ajax request, time is in milliseconds and is passed directly to setTimeout() -Defaults to 25.
-OptionalappAppId is used for the correlation between AJAX dependencies happening on the client-side with the server-side requets. When Beacon API is enabled, it cannot be used automatically, but can be set manually in the configuration. Default is null
-OptionalautoIf true, on a pageview, the previous instrumented page's view time is tracked and sent as telemetry and a new timer is started for the current pageview. It is sent as a custom metric named PageVisitTime in milliseconds and is calculated via the Date now() function (if available) and falls back to (new Date()).getTime() if now() is unavailable (IE8 or less). Default is false.
-OptionalbufferIf specified, overrides the storage & retrieval mechanism that is used to manage unsent telemetry.
-OptionalconvertProvide user an option to convert undefined field to user defined value.
-OptionalcookieCustom cookie domain. This is helpful if you want to share Application Insights cookies across subdomains.
-OptionalcookieCustom cookie path. This is helpful if you want to share Application Insights cookies behind an application gateway.
-OptionalcorrelationOptionalcorrelationDisable correlation headers using regular expressions
-OptionalcorrelationDisable correlation headers for specific domain
-OptionalcustomThe ability for the user to provide extra headers
-OptionaldisableIf true, Ajax calls are not autocollected. Default is false
-OptionaldisableIf true, the SDK will not store or read any data from cookies. Default is false. -If you have also specified a cookieCfg then enabled property (if specified) will take precedent over this value.
-OptionaldisableIf false, the SDK will add two headers ('Request-Id' and 'Request-Context') to all dependency requests to correlate them with corresponding requests on the server side. Default is false.
-OptionaldisableIf true, exceptions are not autocollected. Default is false
-OptionaldisableIf true, Fetch requests are not autocollected. Default is false (Since 2.8.0, previously true).
-OptionaldisableDefault false. If true, flush method will not be called when onBeforeUnload, onUnload, onPageHide or onVisibilityChange (hidden state) event(s) trigger.
-OptionaldisableDefault value of #disableFlushOnBeforeUnload. If true, flush method will not be called when onPageHide or onVisibilityChange (hidden state) event(s) trigger.
-Optionaldisable[Optional] Disable iKey deprecation error message.
-OptionaldisableIf true, telemetry is not collected or sent. Default is false
-Optionaldisable[Optional] Sets to true if user wants to disable sending internal log message 'SendBrowserInfoOnUserInit' -default to be false for versions 2.8.x and 3.0.x, true for versions 3.1.x and later
-OptionaldisableDon't use XMLHttpRequest or XDomainRequest (for IE < 9) by default instead attempt to use fetch() or sendBeacon. -If no other transport is available it will still use XMLHttpRequest
-OptionaldistributedSets the distributed tracing mode. If AI_AND_W3C mode or W3C mode is set, W3C trace context headers (traceparent/tracestate) will be generated and included in all outgoing requests. -AI_AND_W3C is provided for back-compatibility with any legacy Application Insights instrumented services
-OptionalemitThe JSON format (normal vs line delimited). True means line delimited JSON.
-OptionalenableAn optional value that will track Response Error data through trackDependency function.
-OptionalenableFlag to enable looking up and including additional browser window.performance timings -in the reported ajax (XHR and fetch) reported metrics. -Defaults to false.
-OptionalenableAutomatically track route changes in Single Page Applications (SPA). If true, each route change will send a new Pageview to Application Insights.
-OptionalenableIf true, the SDK will add two headers ('Request-Id' and 'Request-Context') to all CORS requests to correlate outgoing AJAX dependencies with corresponding requests on the server side. Default is false
-OptionalenableIf true, debugging data is thrown as an exception by the logger. Default false
-OptionalenableAn optional value that will track Request Header through trackDependency function.
-OptionalenableAn optional value that will track Response Header through trackDependency function.
-OptionalenableIf true, the buffer with all unsent telemetry is stored in session storage. The buffer is restored on page load. Default is true.
-OptionalenableDefault false. Define whether to track unhandled promise rejections and report as JS errors. -When disableExceptionTracking is enabled (dont track exceptions) this value will be false.
-Optionalevents[Optional] The number of events that can be kept in memory before the SDK starts to drop events. By default, this is 10,000.
-OptionalexcludeProvide a way to exclude specific route from automatic tracking for XMLHttpRequest or Fetch request. For an ajax / fetch request that the request url matches with the regex patterns, auto tracking is turned off.
-OptionalisIf false, the SDK will send all telemetry using the Beacon API
-OptionalisDefault is false. If true, the SDK will track all Browser Link requests.
-OptionalisUse either disableCookiesUsage or specify a cookieCfg with the enabled value set. -If true, the SDK will not store or read any data from cookies. Default is false. As this field is being deprecated, when both -isCookieUseDisabled and disableCookiesUsage are used disableCookiesUsage will take precedent.
-false
-
-
-OptionalisDefault false. If false, retry on 206 (partial success), 408 (timeout), 429 (too many requests), 500 (internal server error), 503 (service unavailable), and 0 (offline, only if detected)
-OptionalisIf true, the SDK will not store or read any data from local and session storage. Default is false.
-OptionalmaxDefault 500 - controls how many ajax calls will be monitored per page view. Set to -1 to monitor all (unlimited) ajax calls on the page.
-OptionalmaxThe maximum number of times to look for the window.performance timings (if available), this -is required as not all browsers populate the window.performance before reporting the -end of the XHR request and for fetch requests this is added after its complete -Defaults to 3
-OptionalmaxHow long to batch telemetry for before sending (milliseconds)
-OptionalmaxMax size of telemetry batch. If batch exceeds limit, it is sent and a new batch is started
-OptionalnameAn optional value that will be used as name postfix for localStorage and session cookie name.
-OptionalonunloadDefault false. when tab is closed, the SDK will send all remaining telemetry using the Beacon API
-OptionalonunloadIf fetch keepalive is supported do not use it for sending events during unload, it may still fallback to fetch() without keepalive
-OptionaloverrideIf true, default behavior of trackPageView is changed to record end of page view duration interval when trackPageView is called. If false and no custom duration is provided to trackPageView, the page view performance is calculated using the navigation timing API. Default is false
-OptionalsamplingPercentage of events that will be sent. Default is 100, meaning all events are sent.
-OptionalsdkSets the sdk extension name. Only alphabetic characters are allowed. The extension name is added as a prefix to the 'ai.internal.sdkVersion' tag (e.g. 'ext_javascript:2.0.0'). Default is null.
-OptionalsessionAn optional value that will be used as name postfix for session cookie name. If undefined, namePrefix is used as name postfix for session cookie name.
-OptionalsessionA session is logged if it has continued for this amount of time in milliseconds. Default 24h.
-OptionalsessionA session is logged if the user is inactive for this amount of time in milliseconds. Default 30 mins.
-Optionalthrottle[Optional] Sets throttle mgr configuration by key
-OptionalurlOptionaluserAn optional value that will be used as name postfix for user cookie name. If undefined, no postfix is added on user cookie name.
-Optionaluser[Optional] Specifies a Highest Priority custom endpoint URL where telemetry data will be sent. -This URL takes precedence over the 'config.endpointUrl' and any endpoint in the connection string.
-ReadonlyapplicationApplication build.
-ReadonlyapplicationApplication id.
-ReadonlyapplicationApplication layer.
-ReadonlyapplicationApplication type id.
-ReadonlyapplicationApplication version. Information in the application context fields is always about the application that is sending the telemetry.
-ReadonlycloudReadonlycloudReadonlycloudReadonlycloudReadonlycloudName of the role the application is a part of. Maps directly to the role name in azure.
-ReadonlycloudName of the instance where the application is running. Computer name for on-premisis, instance name for Azure.
-ReadonlycloudReadonlydeviceReadonlydeviceThe browser name and version as reported by the browser.
-ReadonlydeviceReadonlydeviceUnique client device id. Computer name in most cases.
-ReadonlydeviceReadonlydeviceReadonlydeviceDevice locale using
ReadonlydeviceReadonlydeviceModel of the device the end user of the application is using. Used for client scenarios. If this field is empty then it is derived from the user agent.
-ReadonlydeviceReadonlydeviceReadonlydeviceOEMNameClient device OEM name taken from the browser.
-ReadonlydeviceOSReadonlydeviceOSVersionOperating system name and version of the device the end user of the application is using. If this field is empty then it is derived from the user agent. Example 'Windows 10 Pro 10.0.10586.0'
-ReadonlydeviceName of the instance where application is running. Computer name for on-premisis, instance name for Azure.
-ReadonlydeviceName of the role application is part of. Maps directly to the role name in azure.
-ReadonlydeviceReadonlydeviceThe type of the device the end user of the application is using. Used primarily to distinguish JavaScript telemetry from server side telemetry. Examples: 'PC', 'Phone', 'Browser'. 'PC' is the default value.
-ReadonlydeviceVMNameReadonlyinternalAgent version. Used to indicate the version of StatusMonitor installed on the computer if it is used for data collection.
-ReadonlyinternalThis is the node name used for billing purposes. Use it to override the standard detection of nodes.
-ReadonlyinternalThis identifies the source of the Sdk script (used to identify whether the SDK was loaded via the CDN)
-ReadonlyinternalSDK version. See https://github.com/microsoft/ApplicationInsights-Home/blob/master/SDK-AUTHORING.md#sdk-version-specification for information.
-ReadonlyinternalThis identifies the version of the snippet that was used to initialize the SDK
-ReadonlylocationThe city of the client device. If any of Country, Province, or City is specified, those values will be preferred over geolocation of the IP address field. Information in the location context fields is always about the end user. When telemetry is sent from a service, the location context is about the user that initiated the operation in the service.
-ReadonlylocationThe country of the client device. If any of Country, Province, or City is specified, those values will be preferred over geolocation of the IP address field. Information in the location context fields is always about the end user. When telemetry is sent from a service, the location context is about the user that initiated the operation in the service.
-ReadonlylocationThe IP address of the client device. IPv4 and IPv6 are supported. Information in the location context fields is always about the end user. When telemetry is sent from a service, the location context is about the user that initiated the operation in the service.
-ReadonlylocationThe province/state of the client device. If any of Country, Province, or City is specified, those values will be preferred over geolocation of the IP address field. Information in the location context fields is always about the end user. When telemetry is sent from a service, the location context is about the user that initiated the operation in the service.
-ReadonlyoperationThe correlation vector is a light weight vector clock which can be used to identify and order related events across clients and services.
-ReadonlyoperationA unique identifier for the operation instance. The operation.id is created by either a request or a page view. All other telemetry sets this to the value for the containing request or page view. Operation.id is used for finding all the telemetry items for a specific operation instance.
-ReadonlyoperationThe name (group) of the operation. The operation.name is created by either a request or a page view. All other telemetry items set this to the value for the containing request or page view. Operation.name is used for finding all the telemetry items for a group of operations (i.e. 'GET Home/Index').
-ReadonlyoperationThe unique identifier of the telemetry item's immediate parent.
-ReadonlyoperationReadonlyoperationName of synthetic source. Some telemetry from the application may represent a synthetic traffic. It may be web crawler indexing the web site, site availability tests or traces from diagnostic libraries like Application Insights SDK itself.
-ReadonlysessionSession ID - the instance of the user's interaction with the app. Information in the session context fields is always about the end user. When telemetry is sent from a service, the session context is about the user that initiated the operation in the service.
-ReadonlysessionBoolean value indicating whether the session identified by ai.session.id is first for the user or not.
-ReadonlysessionReadonlyuserReadonlyuserIn multi-tenant applications this is the account ID or name which the user is acting with. Examples may be subscription ID for Azure portal or blog name blogging platform.
-ReadonlyuserThe browser's user agent string as reported by the browser. This property will be used to extract informaiton regarding the customer's browser but will not be stored. Use custom properties to store the original user agent.
-ReadonlyuserReadonlyuserAuthenticated user id. The opposite of ai.user.id, this represents the user with a friendly name. Since it's PII information it is not collected by default by most SDKs.
-ReadonlyuserReadonlyuserAnonymous user id. Represents the end user of the application. When telemetry is sent from a service, the user context is about the user that initiated the operation in the service.
-ReadonlyuserStore region for UWP applications.
-Optionaladd[Optional] Flag to indicate whether the internal looking endpoints should be automatically
-added to the excludeRequestFromAutoTrackingPatterns collection. (defaults to true).
-This flag exists as the provided regex is generic and may unexpectedly match a domain that
-should not be excluded.
OptionaladdProvide a way to enrich dependencies logs with context at the beginning of api call. -Default is undefined.
-OptionalajaxThe amount of time to wait before re-attempting to find the windows.performance timings -for an ajax request, time is in milliseconds and is passed directly to setTimeout() -Defaults to 25.
-OptionalappOptionalcorrelationOptionalcorrelationOptionalenableOptionalenableFlag to enable looking up and including additional browser window.performance timings -in the reported ajax (XHR and fetch) reported metrics. -Defaults to false.
-OptionalenableOptionalenableOptionalexcludeProvide a way to exclude specific route from automatic tracking for XMLHttpRequest or Fetch request. -For an ajax / fetch request that the request url matches with the regex patterns, auto tracking is turned off. -Default is undefined.
-Optionalignore[Optional] Response and request headers to be excluded from AJAX & Fetch tracking data. -To override or discard the default, add an array with all headers to be excluded or -an empty array to the configuration.
-For example: ["Authorization", "X-API-Key", "WWW-Authenticate"]
import { ApplicationInsights } from '@microsoft/applicationinsights-web';
import { AjaxPlugin } from '@microsoft/applicationinsights-dependencies-js';
const dependencyPlugin = new AjaxPlugin();
const appInsights = new ApplicationInsights({
config: {
connectionString: 'InstrumentationKey=YOUR_INSTRUMENTATION_KEY_GOES_HERE',
extensions: [dependencyPlugin],
extensionConfig: {
[dependencyPlugin.identifier]: {
ignoreHeaders: [
"Authorization",
"X-API-Key",
"WWW-Authenticate"
]
}
}
}
});
appInsights.loadAppInsights();
appInsights.trackPageView(); // Manually call trackPageView to establish the current user/session/pageview
-
-
-OptionalmaxThe maximum number of times to look for the window.performance timings (if available), this -is required as not all browsers populate the window.performance before reporting the -end of the XHR request and for fetch requests this is added after its complete -Defaults to 3
-DependencyTelemetry telemetry interface
-OptionalcorrelationOptionaldataOptionaldurationOptionaliOptionalmeasurementsProperty bag to contain additional custom measurements (Part C)
-OptionalnameOptionalpropertiesProperty bag to contain additional custom properties (Part C)
-OptionalstartOptionalsuccessOptionaltargetOptionaltypeThe set of fields for a serializable object. -This defines the serialization order and a value of true/false -for each field defines whether the field is required or not.
-Telemetry data item.
-The application's instrumentation key. The key is typically represented as a GUID, but there are cases when it is not a guid. No code should rely on iKey being a GUID. Instrumentation key is case insensitive.
-Type name of telemetry data item.
-Sampling rate used in application. This telemetry item represents 1 / sampleRate actual telemetry items.
-Sequence field used to track absolute order of uploaded events.
-Key/value collection of context properties. See ContextTagKeys for information on available properties.
-Event date time when telemetry item was created. This is the wall clock time on the client when the event was generated. There is no guarantee that the client's time is accurate. This field must be formatted in UTC ISO 8601 format, with a trailing 'Z' character, as described publicly on https://en.wikipedia.org/wiki/ISO_8601#UTC. Note: the number of decimal seconds digits provided are variable (and unspecified). Consumers should handle this, i.e. managed code consumers should not use format 'O' for parsing as it specifies a fixed length. Example: 2009-06-15T13:45:30.0000000Z.
-Envelope version. For internal use only. By assigning this the default, it will not be serialized within the payload unless changed to a value other than #1.
-OptionalmeasurementsProperty bag to contain additional custom measurements (Part C)
-OptionalpropertiesProperty bag to contain additional custom properties (Part C)
-OptionalseverityOptionalerrorOptionalexceptionOptionalidUnique guid identifying this error
-OptionalmeasurementsProperty bag to contain additional custom measurements (Part C)
-OptionalpropertiesProperty bag to contain additional custom properties (Part C)
-OptionalseverityOptionaliOptionalmaxOptionalmeasurementsProperty bag to contain additional custom measurements (Part C)
-OptionalminOptionalpropertiesProperty bag to contain additional custom properties (Part C)
-OptionalsampleOptionalstd(optional) The standard deviation measurement in the sample, Defaults to undefined which results in zero.
-An instance of PageView represents a generic action on a page like a button click. It is also the base type for PageView.
-Request duration in format: DD.HH:MM:SS.MMMMMM. For a page view (PageViewData), this is the duration. For a page view with performance information (PageViewPerfData), this is the page load time. Must be less than 1000 days.
-Identifier of a page view instance. Used for correlation between page view and other telemetry items.
-Collection of custom measurements.
-Event name. Keep it low cardinality to allow proper grouping and useful metrics.
-Collection of custom properties.
-Request URL with all query string parameters
-Schema version
-OptionaldomDOM processing time in TimeSpan 'G' (general long) format: d:hh:mm:ss.fffffff
-OptionaldurationPerformance total in TimeSpan 'G' (general long) format: d:hh:mm:ss.fffffff". This represents the total page load time.
-OptionalmeasurementsProperty bag to contain additional custom measurements (Part C)
-Optionalnamename String - The name of the page. Defaults to the document title.
-OptionalnetworkSent request time in TimeSpan 'G' (general long) format: d:hh:mm:ss.fffffff
-OptionalperfPerformance total in TimeSpan 'G' (general long) format: d:hh:mm:ss.fffffff". This is total duration in timespan format.
-OptionalpropertiesProperty bag to contain additional custom properties (Part C)
-OptionalreceivedReceived response time in TimeSpan 'G' (general long) format: d:hh:mm:ss.fffffff.
-OptionalsentSent request time in TimeSpan 'G' (general long) format: d:hh:mm:ss.fffffff.
-Optionaluriurl String - a relative or absolute URL that identifies the page or other item. Defaults to the window location.
-OptionaldomDOM processing time in TimeSpan 'G' (general long) format: d:hh:mm:ss.fffffff
-OptionaldurationPerformance total in TimeSpan 'G' (general long) format: d:hh:mm:ss.fffffff". This represents the total page load time.
-OptionaldurationDuration in miliseconds
-OptionalidAn identifier assigned to each distinct impression for the purposes of correlating with pageview. -A new id is automatically generated on each pageview. You can manually specify this field if you -want to use a specific value instead.
-OptionalisField indicating whether this instance of PageViewPerformance is valid and should be sent
-OptionalmeasurementsProperty bag to contain additional custom measurements (Part C)
-Optionalnamename String - The name of the page. Defaults to the document title.
-OptionalnetworkSent request time in TimeSpan 'G' (general long) format: d:hh:mm:ss.fffffff
-OptionalperfPerformance total in TimeSpan 'G' (general long) format: d:hh:mm:ss.fffffff". This is total duration in timespan format.
-OptionalpropertiesProperty bag to contain additional custom properties (Part C)
-OptionalreceivedReceived response time in TimeSpan 'G' (general long) format: d:hh:mm:ss.fffffff.
-OptionalsentSent request time in TimeSpan 'G' (general long) format: d:hh:mm:ss.fffffff.
-Optionaluriurl String - a relative or absolute URL that identifies the page or other item. Defaults to the window location.
-OptionalverVersion of the part B schema, todo: set this value in trackpageView
-Pageview telemetry interface
-OptionaliiKey String - custom defined iKey.
-OptionalisisLoggedIn - boolean is user logged in
-OptionalmeasurementsProperty bag to contain additional custom measurements (Part C)
-Optionalnamename String - The string you used as the name in startTrackPage. Defaults to the document title.
-OptionalpagepageType String - page type
-OptionalpropertiesProperty bag to contain additional custom properties (Part C)
-Optionalduration?: numberThe number of milliseconds it took to load the page. Defaults to undefined. If set to default value, page load time is calculated internally.
-OptionalrefrefUri String - the URL of the source page where current page is loaded from
-OptionalstartTime first page view is triggered
-Optionaluriuri String - a relative or absolute URL that identifies the page or other item. Defaults to the window location.
-Pageview telemetry interface
-OptionaliiKey String - custom defined iKey.
-OptionalidAn identifier assigned to each distinct impression for the purposes of correlating with pageview. -A new id is automatically generated on each pageview. You can manually specify this field if you -want to use a specific value instead.
-OptionalisisLoggedIn - boolean is user logged in
-OptionalmeasurementsProperty bag to contain additional custom measurements (Part C)
-Optionalnamename String - The string you used as the name in startTrackPage. Defaults to the document title.
-OptionalpagepageType String - page type
-OptionalpropertiesProperty bag to contain additional custom properties (Part C)
-Optionalduration?: numberThe number of milliseconds it took to load the page. Defaults to undefined. If set to default value, page load time is calculated internally.
-OptionalrefrefUri String - the URL of the source page where current page is loaded from
-OptionalstartTime first page view is triggered
-Optionaluriuri String - a relative or absolute URL that identifies the page or other item. Defaults to the window location.
-OptionalverVersion of the part B schema, todo: set this value in trackpageView
-Request-Context appId format
-Request-Context header
-Target instrumentation header that is added to the response and retrieved by the -calling application when processing incoming responses.
-Request-Id header
-Sdk-Context header -If this header passed with appId in content then appId will be returned back by the backend.
-String to pass in header for requesting appId back from the backend.
-W3C distributed tracing protocol header
-W3C distributed tracing protocol state header
-OptionalacquisitionThe date at which this guid was genereated. -Per the spec the ID will be regenerated if more than acquisitionSpan milliseconds ellapse from this time.
-OptionalidThe session ID.
-OptionalrenewalThe date at which this session ID was last reported. -This value should be updated whenever telemetry is sent using this ID. -Per the spec the ID will be regenerated if more than renewalSpan milliseconds elapse from this time with no activity.
-An interface that identifies the automatic session manager
-The automatic Session which has been initialized from the automatic SDK cookies and storage
-Record the current state of the automatic session and store it in our cookie string format -into the browser's local storage. This is used to restore the session data when the cookie -expires.
-Update the automatic session cookie if required
-Identifies a simple interface to allow you to override the storage mechanism used -to track unsent and unacknowledged events. When provided it must provide both -the get and set item functions.
-application id obtained from breeze responses. Is used if appId is not specified by root config
-ReadonlyapplicationThe object describing a component tracked by this object.
-ReadonlydeviceThe object describing a device tracked by this object.
-session id obtained from session manager.
-ReadonlyinternalThe object describing internal settings.
-ReadonlylocationThe object describing a location tracked by this object.
-Optional ReadonlyosThe object describing os details tracked by this object.
-ReadonlysessionThe object describing a session tracked by this object.
-ReadonlysessionThe session manager that manages the automatic session from the cookies
-ReadonlytelemetryThe object describing a operation tracked by this object.
-ReadonlyuserThe object describing a user tracked by this object.
-Optional ReadonlywebThe object describing we details tracked by this object.
-OptionalnameName
-OptionalparentIDParent id
-OptionaltraceAn integer representation of the W3C TraceContext trace-flags. https://www.w3.org/TR/trace-context/#trace-flags
-OptionaltraceIDTrace id
-OptionaltraceIdentifies frequency of items sent -Default: send data on 28th every 3 month each year
-OptionaldayIdentifies days Interval from start date that items can be sent -Default: undefined
-OptionaldaysIdentifies days within each month that items can be sent -If both monthInterval and dayInterval are undefined, it will be default to [28]
-OptionalmonthIdentifies month interval that items can be sent -For example, if it is set to 2 and start date is in Jan, items will be sent out every two months (Jan, March, May etc.) -If both monthInterval and dayInterval are undefined, it will be set to 3
-Identifies limit number/percentage of items sent per time -If both are provided, minimum number between the two will be used
-Identifies object for local storage
-Identifies basic config
-OptionaldisabledIdentifies if throttle is disabled -Default: false
-OptionalintervalIdentifies frequency of items sent -Default: send data on 28th every 3 month each year
-OptionallimitIdentifies limit number/percentage of items sent per time -Default: sampling percentage 0.01% with one item sent per time
-Identifies throttle result
-This interface represents the components of a W3C traceparent header
-This is the ID of the current request as known by the caller (in some tracing systems, this is also -known as the parent-id, where a span is the execution of a client request). It is represented as an -16-character string of lowercase hexadecimal characters, for example, 00f067aa0ba902b7. -All bytes as zero (0000000000000000) is considered an invalid value.
-An 8-bit value of flags that controls tracing such as sampling, trace level, etc. These flags are -recommendations given by the caller rather than strict rules to follow. -As this is a bit field, you cannot interpret flags by decoding the hex value and looking at the resulting -number. For example, a flag 00000001 could be encoded as 01 in hex, or 09 in hex if present with the flag -00001000. A common mistake in bit fields is forgetting to mask when interpreting flags.
-This is the ID of the whole trace forest and is used to uniquely identify a distributed trace -through a system. It is represented as a 32-character string of lowercase hexadecimal characters, -for example, 4bf92f3577b34da6a3ce929d0e0e4736. -All characters as zero (00000000000000000000000000000000) is considered an invalid value.
-The version of the definition, this MUST be a string with a length of 2 and only contain lowercase -hexadecimal characters. A value of 'ff' is considered to be an invalid version.
-OptionaliOptionalmeasurementsProperty bag to contain additional custom measurements (Part C)
-OptionalpropertiesProperty bag to contain additional custom properties (Part C)
-OptionalseverityThe account acquisition date.
-The account ID.
-Authenticated user id
-The telemetry configuration.
-The user ID.
-OptionalisA flag indicating whether this represents a new user
-OptionalisA flag indicating whether the user cookie has been set
-The localId
-The account acquisition date.
-The account ID.
-Authenticated user id
-The telemetry configuration.
-The user ID.
-OptionalisA flag indicating whether this represents a new user
-OptionalisA flag indicating whether the user cookie has been set
-The localId
-Browser name, set at ingestion
-Language
-Browser ver, set at ingestion.
-Current domain. Leverages Window.location.hostname. populated to properties bag
-Whether event was fired manually, populated to properties bag
-Screen resolution, populated to properties bag
-User consent, populated to properties bag
-ConstConstConstConstConstConstConstThe EventPersistence contains a set of values that specify the event's persistence.
-ConstConstConstConstConstConstConstDefines the level of severity for the event.
-ConstFunction used to identify the get w parameter used to identify status bit to some channels
-Returns a value that indicates whether the instance has already been previously initialized.
-The current logger instance for this instance.
-ReadonlypluginThe formatted string of the installed plugins that contain a version number
-ReadonlypluginAn array of the installed plugins that provide a version
-Protected Optional_updateHook for Core extensions to allow them to update their own configuration before updating all of the plugins.
-The plugin update context
-The Update State
-boolean - True means the extension class will call updateState otherwise the Core will
-Watches and tracks status of initialization process
-ActiveStatus
-3.3.0 -If returned status is active, it means initialization process is completed. -If returned status is pending, it means the initialization process is waiting for promieses to be resolved. -If returned status is inactive, it means ikey is invalid or can 't get ikey or enpoint url from promsises.
-Adds a notification listener. The SDK calls methods on the listener when an appropriate notification is raised. -The added plugins must raise notifications. If the plugins do not implement the notifications, then no methods will be -called.
-An INotificationListener object.
-Add a new plugin to the installation
-The new plugin to add
-OptionalreplaceExisting: booleanshould any existing plugin be replaced, default is false
-OptionaldoAsync: booleanShould the add be performed asynchronously
-OptionaladdCb: ((added?: boolean) => void)[Optional] callback to call after the plugin has been added
-Optionaladded: booleanAdd a telemetry processor to decorate or drop telemetry events.
-The Telemetry Initializer function
-Add an unload handler that will be called when the SDK is being unloaded
-the handler
-Add this hook so that it is automatically removed during unloading
-The single hook or an array of IInstrumentHook objects
-Flush and send any batched / cached data immediately
-OptionalisAsync: booleanOptionalcallBack: ((flushComplete?: boolean) => void)if specified, notify caller when send is complete, the channel should return true to indicate to the caller that it will be called. -If the caller doesn't return true the caller should assume that it may never be called.
-OptionalflushComplete: booleanOptionalsendReason: SendRequestReasonspecify the reason that you are calling "flush" defaults to ManualFlush (1) if not specified
-Get the current cookie manager for this instance
-Get the current notification manager
-Get the current performance manager
-Find and return the (first) plugin with the specified identifier if present
-Return a new instance of the IProcessTelemetryContext for processing events
-Gets the current distributed trace context for this instance if available
-OptionalcreateNew: booleanOptional flag to create a new instance if one doesn't currently exist, defaults to true
-Optionallogger: IDiagnosticLoggerOptionalnotificationManager: INotificationManagerWatches and tracks changes for accesses to the current config, and if the accessed config changes the -handler will be recalled.
-A watcher handler instance that can be used to remove itself when being unloaded
-Enable the timer that checks the logger.queue for log messages to be flushed. -Note: Since 3.0.1 and 2.8.13 this is no longer an interval timer but is a normal -timer that is only started when this function is called and then subsequently -only if there are any logger.queue messages to be sent.
-OptionaleventName: stringProtectedreleaseRemoves all instances of the listener.
-INotificationListener to remove.
-Set the current cookie manager for this instance
-The manager, if set to null/undefined will cause the default to be created
-Set the current performance manager
-The performance manager
-Sets the current distributed trace context for this instance if available
-Unload and Tear down the SDK and any initialized plugins, after calling this the SDK will be considered
-to be un-initialized and non-operational, re-initializing the SDK should only be attempted if the previous
-unload call return true stating that all plugins reported that they also unloaded, the recommended
-approach is to create a new instance and initialize that instance.
-This is due to possible unexpected side effects caused by plugins not supporting unload / teardown, unable
-to successfully remove any global references or they may just be completing the unload process asynchronously.
-If you pass isAsync as true (also the default) and DO NOT pass a callback function then an IPromise
-will be returned which will resolve once the unload is complete. The actual implementation of the IPromise
-will be a native Promise (if supported) or the default as supplied by ts-async library
OptionalisAsync: booleanCan the unload be performed asynchronously (default)
-OptionalunloadComplete: ((unloadState: ITelemetryUnloadState) => void)An optional callback that will be called once the unload has completed
-OptionalcbTimeout: numberAn optional timeout to wait for any flush operations to complete before proceeding with the -unload. Defaults to 5 seconds.
-Nothing or if occurring asynchronously a IPromise -which will be resolved once the unload is complete, the IPromise -will only be returned when no callback is provided and isAsync is true
-Update the configuration used and broadcast the changes to all loaded plugins
-The new configuration is apply
-OptionalmergeExisting: booleanShould the new configuration merge with the existing or just replace it. Default is to true.
-AbstractBaseTelemetryPlugin provides a basic implementation of the ITelemetryPlugin interface so that plugins -can avoid implementation the same set of boiler plate code as well as provide a base -implementation so that new default implementations can be added without breaking all plugins.
-Protected Optional_doTeardown / Unload hook to allow implementations to perform some additional unload operations before the BaseTelemetryPlugin -finishes it's removal.
-OptionalunloadCtx: IProcessTelemetryUnloadContextThis is the context that should be used during unloading.
-OptionalunloadState: ITelemetryUnloadStateThe details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.
-OptionalasyncCallback: (() => void)An optional callback that the plugin must call if it returns true to inform the caller that it has completed any async unload/teardown operations.
-boolean - true if the plugin has or will call asyncCallback, this allows the plugin to perform any asynchronous operations.
-Protected Optional_doExtension hook to allow implementations to perform some additional update operations before the BaseTelemetryPlugin finishes it's removal
-OptionalupdateCtx: IProcessTelemetryUpdateContextThis is the context that should be used during updating.
-OptionalupdateState: ITelemetryUpdateStateThe details / state of the update process, it holds details like the current and previous configuration.
-OptionalasyncCallback: (() => void)An optional callback that the plugin must call if it returns true to inform the caller that it has completed any async update operations.
-boolean - true if the plugin has or will call asyncCallback, this allows the plugin to perform any asynchronous operations.
-Protected_getHelper to return the current IProcessTelemetryContext, if the passed argument exists this just -returns that value (helps with minification for callers), otherwise it will return the configured -context or a temporary one.
-OptionalcurrentCtx: IProcessTelemetryContext[Optional] The current execution context
-Protected Readonly_unloadExposes the underlying unload hook container instance for this extension to allow it to be passed down to any sub components of the class. -This should NEVER be exposed or called publically as it's scope is for internal use by BaseTelemetryPlugin and any derived class (which is why -it's scoped as protected)
-Holds the core instance that was used during initialization
-Returns the current diagnostic logger that can be used to log issues, if no logger is currently -assigned a new default one will be created and returned.
-Extension name
-Returns whether the plugin has been initialized
-Priority of the extension
-Call back for telemetry processing before it it is sent
-This is the current event being reported
-This is the context for the current request, ITelemetryPlugin instances -can optionally use this to access the current core instance or define / pass additional information -to later plugins (vs appending items to the telemetry item)
-ProtectedsetInternal helper to allow setting of the internal initialized setting for inherited instances and unit testing
-Set next extension for telemetry processing
-OptionalversionPlugin version (available in data.properties.version in common schema)
-Protected_addAdd this hook so that it is automatically removed during unloading
-The single hook or an array of IInstrumentHook objects
-Protected_addAdd an unload handler that will be called when the SDK is being unloaded
-the handler
-Initialize plugin loaded by SDK
-The config for the plugin to use
-The current App Insights core to use for initializing this plugin instance
-The complete set of extensions to be used for initializing the plugin
-OptionalpluginChain: ITelemetryPluginChain[Optional] specifies the current plugin chain which identifies the -set of plugins and the order they should be executed for the current request.
-AbstractprocessCall back for telemetry processing before it it is sent
-This is the current event being reported
-OptionalitemCtx: IProcessTelemetryContextThis is the context for the current request, ITelemetryPlugin instances -can optionally use this to access the current core instance or define / pass additional information -to later plugins (vs appending items to the telemetry item)
-Tear down the plugin and remove any hooked value, the plugin should be removed so that it is no longer initialized and -therefore could be re-initialized after being torn down. The plugin should ensure that once this has been called any further -processTelemetry calls are ignored and it just calls the processNext() with the provided context.
-OptionalunloadCtx: IProcessTelemetryUnloadContextThis is the context that should be used during unloading.
-OptionalunloadState: ITelemetryUnloadStateThe details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.
-boolean - true if the plugin has or will call processNext(), this for backward compatibility as previously teardown was synchronous and returned nothing.
-The the plugin should re-evaluate configuration and update any cached configuration settings.
-This is the context that should be used during updating.
-The details / state of the update process, it holds details like the current and previous configuration.
-boolean - true if the plugin has or will call updateCtx.processNext(), this allows the plugin to perform any asynchronous operations.
-Optionalconfig: IConfigurationLogs a message to the internal queue.
-{LoggingSeverity} - The severity of the log message
-{_InternalLogMessage} - The message to log.
-This method will throw exceptions in debug mode or attempt to log the error as a console warning.
-{LoggingSeverity} - The severity of the log message
-Optionalproperties: ObjectUnload and remove any state that this IDiagnosticLogger may be holding, this is generally called when the -owning SDK is being unloaded.
-OptionalisAsync: booleanCan the unload be performed asynchronously (default)
-If the unload occurs synchronously then nothing should be returned, if happening asynchronously then -the function should return an IPromise -/ Promise to allow any listeners to wait for the operation to complete.
-Class to manage sending notifications to all the listeners.
-Optionalconfig: IConfigurationAdds a notification listener.
-The notification listener to be added.
-Notification for events being discarded.
-The array of events that have been discarded by the SDK.
-The reason for which the SDK discarded the events. The EventsDiscardedReason -constant should be used to check the different values.
-Optionalevents[Optional] A function called when the events have been requested to be sent to the sever.
-The reason why the event batch is being sent.
-A flag which identifies whether the requests are being sent in an async or sync manner.
-Notification for events sent.
-The array of events that have been sent.
-OptionalofflineOptionaloffline[Optional] A function called when the offline events have been sent from the persistent storage
-payload data that is sent from the persistent storage
-Optionaloffline[Optional] A function called when the offline events have been stored to the persistent storage
-events that are stored in the persistent storage
-Optionalperf[Optional] This event is sent if you have enabled perf events, they are primarily used to track internal performance testing and debugging -the event can be displayed via the debug plugin extension.
-Removes all instances of the listener.
-AWTNotificationListener to remove.
-OptionalunloadUnload and remove any state that this INotificationManager may be holding, this is generally called when the -owning SDK is being unloaded.
-OptionalisAsync: booleanCan the unload be performed asynchronously (default)
-If the unload occurs synchronously then nothing should be returned, if happening asynchronously then -the function should return an IPromise -/ Promise to allow any listeners to wait for the operation to complete.
-This interface identifies the details of an internal performance event - it does not represent an outgoing reported event
-StaticChildrenStaticParentMark this event as completed, calculating the total execution time.
-OptionalexIdentifies the exclusive time spent in for this event (not including child events), -this will be undefined until the event is completed.
-OptionalgetGet the names additional context associated with this perf event
-Is this occurring from an asynchronous event
-Identifies whether this event is a child event of a parent
-The name of the event
-The payload (contents) of the perfEvent, may be null or only set after the event has completed depending on -the runtime environment.
-OptionalsetSet the named additional context to be associated with this perf event, this will replace any existing value
-The start time of the event in ms
-OptionaltimeIdentifies the total inclusive time spent for this event, including the time spent for child events, -this will be undefined until the event is completed
-This defines an internal performance manager for tracking and reporting the internal performance of the SDK -- It does -not represent or report any event to the server.
-Optionalmanager: INotificationManagerCreate a new event and start timing, the manager may return null/undefined to indicate that it does not -want to monitor this source event.
-The source name of the event
-Optionalpayload: anyOptionalisAsync: booleanIs the event occurring from a async event
-Complete the perfEvent and fire any notifications.
-Fire the event which will also complete the passed event
-This class will be removed!
-Creates a new Telemetry Item context with the current config, core and plugin execution chain
-The current config
-The current core instance
-OptionalstartAt: IPluginReturns the IAppInsightsCore instance for the current request
-Create a new context using the core and config from the current instance
-Optionalplugins: ITelemetryPluginChain | IPlugin[]The execution order to process the plugins, if null or not supplied -then the current execution order will be copied.
-OptionalstartAt: IPluginThe plugin to start processing from, if missing from the execution -order then the next plugin will be NOT set.
-Returns the current IDiagnosticsLogger for the current request
-Gets the current core config instance
-Gets the named config from either the named identifier extension or core config if neither exist then the -default value is returned
-The named extension identifier
-The config field name
-OptionaldefaultValue: The default value to return if no defined config exists
-Gets the named extension config
-Returns the next configured plugin proxy
-Helper to allow inherited classes to check and possibly shortcut executing code only -required if there is a nextPlugin
-Synchronously iterate over the context chain running the callback for each plugin, once -every plugin has been executed via the callback, any associated onComplete will be called.
-Set the function to call when the current chain has executed all processNext or unloadNext items.
-Call back for telemetry processing before it it is sent
-This is the current event being reported
-boolean (true) if there is no more plugins to process otherwise false or undefined (void)
-Helper to set the next plugin proxy
-Optionalproperties: ObjectConstConstThe EventsDiscardedReason enumeration contains a set of values that specify the reason for discarding an event.
-A manual flush request was received
-Maximum batch size would be exceeded
-The Maximum number of events have already been queued
-Events are being sent based on the normal event schedule / timer.
-The Channel was resumed
-The event(s) being sent as a retry
-The SDK is unloading
-The event(s) being sent are sync events
-No specific reason was specified
-Unload event is being processed
-ConstThe TelemetryUnloadReason enumeration contains the possible reasons for why a plugin is being unloaded / torndown().
-Teardown has been called without any context.
-This instance of the plugin is being removed and replaced
-Just this plugin is being removed
-The entire SDK is being unloaded
-ConstThe TelemetryUpdateReason enumeration contains a set of bit-wise values that specify the reason for update request.
-ConstConstConstactive mean ikey/endpoint promises is resolved and initializing with ikey/endpoint is successful
-inactive status means there might be rejected ikey/endpoint promises or ikey/endpoint resolved is not valid
-Waiting for promises to be resolved -NOTE: if status is set to be pending, incoming changes will be dropped until pending status is removed
-ConstThe eBatchDiscardedReason enumeration contains a set of values that specify the reason for discarding offline batches.
-Batches with lower number of critical events are dropped to free up storage space
-The batches in storage exceed max allowed time
-Status set to non-retryable after sending
-Unknown.
-ConstThe eEventsDiscardedReason enumeration contains a set of values that specify the reason for discarding an event.
-The event is invalid.
-The server is not accepting events from this instrumentation key.
-Status set to non-retryable.
-The event queue is full.
-The size of the event is too large.
-Unknown.
-ConstError will be sent as internal telemetry
-The Error will NOT be sent as an internal telemetry, and will only be shown in the browser -console if the logging level allows it.
-No Logging will be enabled
-Error will NOT be sent as internal telemetry, and will only be shown in browser console
-Add an instrumentation hook to the provided named "event" for the target class / object, this doesn't check whether the -named "event" is in fact a function and just assigns the instrumentation hook to the target[evtName]
-The target object
-The name of the event
-The callbacks to configure and call whenever the function is called
-OptionalcheckPrototype: booleanIf the function doesn't exist on the target should it attempt to hook the prototype function
-OptionalcheckParentProto: booleanIf the function doesn't exist on the target or it's prototype should it attempt to hook the parent's prototype
-Intercept the named prototype functions for the target class / object
-The target object
-The function name
-The callbacks to configure and call whenever the function is called
-If the function doesn't exist on the target should it attempt to hook the prototype function
-OptionalcheckParentProto: booleanIf the function doesn't exist on the target or it's prototype should it attempt to hook the parent's prototype
-Intercept the named functions for the target class / object
-The target object
-The function names to intercept and call
-The callbacks to configure and call whenever the function is called
-If the function doesn't exist on the target should it attempt to hook the prototype function
-OptionalcheckParentProto: booleanIf the function doesn't exist on the target or it's prototype should it attempt to hook the parent's prototype
-Intercept the named prototype functions for the target class / object
-The target object
-The function name
-The callbacks to configure and call whenever the function is called
-Intercept the named prototype functions for the target class / object
-The target object
-The function names to intercept and call
-The callbacks to configure and call whenever the function is called
-Get all of the registered events on the target object, this is primarily used for testing cleanup but may also be used by -applications to remove their own events
-The EventTarget that has registered events
-OptionaleventName: string[Optional] The name of the event to return the registered handlers and full name (with namespaces)
-OptionalevtNamespace: string | string[][Optional] Additional namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace, -if the eventName also includes a namespace the namespace(s) are merged into a single namespace
-Logs a message to the internal queue.
-The Diagnostic Logger instance to use.
-{LoggingSeverity} - The severity of the log message
-{_InternalLogMessage} - The message to log.
-Test hook for setting the maximum number of unload hooks and calling a monitor function when the hooks are added or removed -This allows for automatic test failure when the maximum number of unload hooks is exceeded
-OptionalmaxHooks: numberThe maximum number of unload hooks
-OptionaladdMonitor: ((state: string, hooks: (IUnloadHook | ILegacyUnloadHook)[]) => void)The monitor function to call when hooks are added or removed
-This is a helper method which will call throwInternal on the passed logger, will throw exceptions in -debug mode or attempt to log the error as a console warning. This helper is provided mostly to better -support minification as logger.throwInternal() will not compress the publish "throwInternal" used throughout -the code.
-The Diagnostic Logger instance to use.
-{LoggingSeverity} - The severity of the log message
-Optionalproperties: ObjectThis is a helper method which will call warnToConsole on the passed logger with the provided message.
-The Diagnostic Logger instance to use.
-{_InternalLogMessage} - The log message.
-Trys to add an event handler for the specified event to the window, body and document
-{string} - The name of the event
-{any} - The callback function that needs to be executed for the given event
-OptionalevtNamespace: string | string[][Optional] Namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace.
-Bind the listener to the array of events
-An string array of event names to bind the listener to
-The event callback to call when the event is triggered
-OptionalexcludeEvents: string[][Optional] An array of events that should not be hooked (if possible), unless no other events can be.
-OptionalevtNamespace: string | string[][Optional] Namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace.
-true - when at least one of the events was registered otherwise false
-Listen to the pagehide and visibility changing to 'hidden' events, because the 'visibilitychange' uses -an internal proxy to detect the visibility state you SHOULD use a unique namespace when if you plan to call -removePageShowEventListener as the remove ignores the listener argument for the 'visibilitychange' event.
-The event callback to call when a page hide event is triggered
-OptionalexcludeEvents: string[][Optional] An array of events that should not be hooked (if possible), unless no other events can be.
-OptionalevtNamespace: string | string[][Optional] A Namespace to append to the event listeners so they can be uniquely identified and removed -based on this namespace. This call also adds an additional unique "pageshow" namespace to the events -so that only the matching "removePageHideEventListener" can remove these events. -Suggestion: pass as true if you are also calling addPageUnloadEventListener as that also hooks pagehide
-true - when at least one of the events was registered otherwise false
-Listen to the pageshow and visibility changing to 'visible' events, because the 'visibilitychange' uses -an internal proxy to detect the visibility state you SHOULD use a unique namespace when if you plan to call -removePageShowEventListener as the remove ignores the listener argument for the 'visibilitychange' event.
-The event callback to call when a page is show event is triggered
-OptionalexcludeEvents: string[][Optional] An array of events that should not be hooked (if possible), unless no other events can be.
-OptionalevtNamespace: string | string[][Optional/Recommended] A Namespace to append to the event listeners so they can be uniquely -identified and removed based on this namespace. This call also adds an additional unique "pageshow" namespace to the events -so that only the matching "removePageShowEventListener" can remove these events.
-true - when at least one of the events was registered otherwise false
-Listen to the 'beforeunload', 'unload' and 'pagehide' events which indicates a page unload is occurring, -this does NOT listen to the 'visibilitychange' event as while it does indicate that the page is being hidden -it does not necessarily mean that the page is being completely unloaded, it can mean that the user is -just navigating to a different Tab and may come back (without unloading the page). As such you may also -need to listen to the 'addPageHideEventListener' and 'addPageShowEventListener' events.
-The event callback to call when a page unload event is triggered
-OptionalexcludeEvents: string[][Optional] An array of events that should not be hooked, unless no other events can be.
-OptionalevtNamespace: string | string[][Optional] Namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace.
-true - when at least one of the events was registered otherwise false
-Optionallogger: IDiagnosticLoggerCalls the provided callbackFn function once for each element in an array in ascending index order. It is not invoked for index properties
-that have been deleted or are uninitialized. And unlike the ES6 forEach() you CAN stop or break the iteration by returning -1 from the
-callbackFn function.
The range (number of elements) processed by arrForEach() is set before the first call to the callbackFn. Any elements added beyond the range
-or elements which as assigned to indexes already processed will not be visited by the callbackFn.
The array or array like object of elements to be searched.
-A synchronous function that accepts up to three arguments. arrForEach calls the callbackfn function one time for each element in the array.
OptionalthisArg: anyAn object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, null or undefined -the array will be used as the this value.
-arrForEach expects a synchronous function.
-arrForEach does not wait for promises. Make sure you are aware of the implications while using promises (or async functions) as forEach callback.
const items = ['item1', 'item2', 'item3'];
const copyItems = [];
// before using for loop
for (let i = 0; i < items.length; i++) {
copyItems.push(items[i]);
}
// before using forEach()
items.forEach((item) => {
copyItems.push(item);
});
// after
arrForEach(items, (item) => {
copyItems.push(item);
// May return -1 to abort the iteration
});
// Also supports input as an array like object
const items = { length: 3, 0: 'item1', 1: 'item2', 2: 'item3' };
-
-
-The arrIndexOf() method returns the first index at which a given element can be found in the array,
-or -1 if it is not present.
-arrIndexOf() compares searchElement to elements of the Array using strict equality (the same
-method used by the === or triple-equals operator).
const array = [2, 9, 9];
arrIndexOf(array, 2); // 0
arrIndexOf(array, 7); // -1
arrIndexOf(array, 9, 2); // 2
arrIndexOf(array, 2, -1); // -1
arrIndexOf(array, 2, -3); // 0
let indices: number[] = [];
const array = ['a', 'b', 'a', 'c', 'a', 'd'];
const element = 'a';
let idx = arrIndexOf(array, element);
while (idx !== -1) {
indices.push(idx);
idx = arrIndexOf(array, element, idx + 1);
}
console.log(indices);
// [0, 2, 4]
function updateVegetablesCollection (veggies, veggie) {
if (arrIndexOf(veggies, veggie) === -1) {
veggies.push(veggie);
console.log('New veggies collection is : ' + veggies);
} else {
console.log(veggie + ' already exists in the veggies collection.');
}
}
let veggies = ['potato', 'tomato', 'chillies', 'green-pepper'];
updateVegetablesCollection(veggies, 'spinach');
// New veggies collection is : potato,tomato,chillies,green-pepper,spinach
updateVegetablesCollection(veggies, 'spinach');
// spinach already exists in the veggies collection.
// Array Like
let arrayLike = {
length: 3,
0: "potato",
1: "tomato",
2: "chillies",
3: "green-pepper" // Not checked as index is > length
};
arrIndexOf(arrayLike, "potato"); // 0
arrIndexOf(arrayLike, "tomato"); // 1
arrIndexOf(arrayLike, "chillies"); 2
arrIndexOf(arrayLike, "green-pepper"); // -1
-
-
-The array or array like object of elements to be searched.
-The element to locate in the array.
-OptionalfromIndex: numberThe index to start the search at. If the index is greater than or equal to -the array's length, -1 is returned, which means the array will not be searched. If the provided -index value is a negative number, it is taken as the offset from the end of the array. -Note: if the provided index is negative, the array is still searched from front to back. If the -provided index is 0, then the whole array will be searched. Default: 0 (entire array is searched).
-The first index of the element in the array; -1 if not found.
-The arrMap() method creates a new array populated with the results of calling a provided function on every -element in the calling array.
-arrMap calls a provided callbackFn function once for each element in an array, in order, and constructs
-a new array from the results. callbackFn is invoked only for indexes of the array which have assigned
-values (including undefined).
It is not called for missing elements of the array; that is:
-0.3.3
-const numbers = [1, 4, 9];
const roots = arrMap(numbers, (num) => Math.sqrt(num));
// roots is now [1, 2, 3]
// numbers is still [1, 4, 9]
const kvArray = [{ key: 1, value: 10 },
{ key: 2, value: 20 },
{ key: 3, value: 30 }];
const reformattedArray = arrMap(kvArray, ({ key, value}) => ({ [key]: value }));
// reformattedArray is now [{1: 10}, {2: 20}, {3: 30}],
// kvArray is still:
// [{key: 1, value: 10},
// {key: 2, value: 20},
// {key: 3, value: 30}]
// Also supports Array Like objects with same output
const kvArray = {
length: 3,
0: { key: 1, value: 10 },
1: { key: 2, value: 20 },
2: { key: 3, value: 30 }
};
-
-
-The arrReduce() method executes a user-supplied "reducer" callback function on each element of the array, -in order, passing in the return value from the calculation on the preceding element. The final result of -running the reducer across all elements of the array is a single value.
-The first time that the callback is run there is no "return value of the previous calculation". If supplied, -an initial value may be used in its place. Otherwise the array element at index 0 is used as the initial -value and iteration starts from the next element (index 1 instead of index 0).
-const getMax = (a: number, b: number) => Math.max(a, b);
// callback is invoked for each element in the array starting at index 0
arrReduce([1, 100], getMax, 50); // 100
arrReduce([ 50], getMax, 10); // 50
// callback is invoked once for element at index 1
arrReduce([1, 100], getMax); // 100
// callback is not invoked
arrReduce([ 50], getMax); // 50
arrReduce([ ], getMax, 1); // 1
arrReduce([ ], getMax); // throws TypeError
// Also supports Array like objects
arrReduce({ length: 2, 0: 1, 1: 100 }, getMax, 50); // 100
arrReduce({ length: 1, 0: 50 }, getMax, 10); // 50
// callback is invoked once for element at index 1
arrReduce({ length: 2, 0: 1, 1: 100 }, getMax); // 100
// callback is not invoked
arrReduce({ length: 1, 0: 50 }, getMax); // 50
arrReduce({ length: 0 }, getMax, 1); // 1
-
-
-Identifies the type of array elements
-The array or array like object of elements to be searched.
-A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.
-OptionalinitialValue: T | RIf initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
-The value that results from running the "reducer" callback function to completion over the entire array.
-The asString() method returns a string representing the value by
-explicitly using String(value).
Binds the specified function to an event, so that the function gets called whenever the event fires on the object
-Object to add the event too.
-String that specifies any of the standard DHTML Events without "on" prefix and optional (dot "." prefixed) namespaces "click" "click.mynamespace".
-Pointer that specifies the function to call when event fires
-[Optional] Defaults to false
-True if the function was bound successfully to the event, otherwise false
-Mark the provided value so that if it's included into the configuration it will NOT have -its properties converted into a dynamic (reactive) object. If the object is not a plain object -or an array (ie. a class) this function has not affect as only Objects and Arrays are converted -into dynamic objects in the dynamic configuration.
-When you have tagged a value as both forceDynamicConversion and blocked force will take precedence.
-You should only need to use this function, if you are creating dynamic "classes" from objects -which confirm to the require interface. A common case for this is during unit testing where it's -easier to create mock extensions.
-If value is falsy (null / undefined / 0 / empty string etc) it will not be tagged and
-if there is an exception adding the property to the value (because its frozen etc) the
-exception will be swallowed
The object that you want to block from being converted into a -trackable dynamic object
-The original value
-// This is a valid "extension", but it is technically an object
// So when included in the config.extensions it WILL be cloned and then
// converted into a dynamic object, where all of its properties will become
// get/set object properties and will be tracked. While this WILL still
// function, when attempt to use a mocking framework on top of this the
// functions are now technically get accessors which return a function
// and this can cause some mocking frameworks to fail.
let mockChannel = {
pause: () => { },
resume: () => { },
teardown: () => { },
flush: (async: any, callBack: any) => { },
processTelemetry: (env: any) => { },
setNextPlugin: (next: any) => { },
initialize: (config: any, core: any, extensions: any) => { },
identifier: "testChannel",
priority: 1003
};
-
-
-Helper which returns an IConfigDefaultCheck instance identifying that value associated with this property -should not have it's properties converted into a dynamic config properties.
-The default value to apply it not provided or it's not valid
-a new IConfigDefaultCheck structure
-Helper which returns an IConfigDefaultCheck instance that will validate and convert the user -provided value to a boolean from a string or boolean value
-a new IConfigDefaultCheck structure
-Helper which returns an IConfigDefaultCheck instance that will validate that the user -provided value is a function.
-OptionaldefaultValue: VThe default value to apply it not provided or it's not valid
-a new IConfigDefaultCheck structure
-Helper which returns an IConfigDefaultCheck instance with the field defined as an object -that should be merged
-The default value to apply it not provided or it's not valid
-a new IConfigDefaultCheck structure
-Helper which returns an IConfigDefaultCheck instance with the provided field set function
-The IConfigCheckFn function to validate the user provided value
-The default value to apply it not provided or it's not valid
-a new IConfigDefaultCheck structure
-Helper which returns an IConfigDefaultCheck instance that will validate that the user -provided value is a function.
-OptionaldefaultValue: stringThe default string value to apply it not provided or it's not valid, defaults to an empty string
-a new IConfigDefaultCheck structure
-Helper which returns an IConfigDefaultCheck instance with the provided field validator
-The IConfigCheckFn function to validate the user provided value
-The default value to apply it not provided or it's not valid
-OptionalfallBackName: keyof T | keyof C | (keyof T | keyof C)[]The fallback configuration name if the current value is not available
-a new IConfigDefaultCheck structure
-Simpler helper to create a dynamic class that implements the interface and populates the values with the defaults. -Only instance properties (hasOwnProperty) values are copied from the defaults to the new instance
-Optionaldefaults: TSimple helper
-OptionalrootConfig: IConfigurationOptionallogger: IDiagnosticLoggerCreate or return a dynamic version of the passed config, if it is not already dynamic
-The config to be converted into a dynamic config
-OptionaldefaultConfig: IConfigDefaults<T, IConfiguration>The default values to apply on the config if the properties don't already exist
-Optionallogger: IDiagnosticLoggerOptionalinPlace: booleanShould the config be converted in-place into a dynamic config or a new instance returned, defaults to true
-The dynamic config handler for the config (whether new or existing)
-Creates a new Telemetry Item context with the current config, core and plugin execution chain
-The current core instance
-OptionalstartAt: IPluginIdentifies the next plugin to execute, if null there is no "next" plugin and if undefined it should assume the start of the chain
-Create a new ITraceParent instance using the provided values.
-OptionaltraceId: stringThe traceId to use, when invalid a new random W3C id will be generated.
-OptionalspanId: stringThe parent/span id to use, a new random value will be generated if it is invalid.
-Optionalflags: numberThe traceFlags to use, defaults to zero (0) if not supplied or invalid
-Optionalversion: stringThe version to used, defaults to version "01" if not supplied or invalid.
-Create a IUnloadHookContainer which can be used to remember unload hook functions to be executed during the component unloading -process.
-A new IUnloadHookContainer instance
-Create a 2 index map that maps an enum's key and value to the defined map value, X["key"] => mapValue and X[0] => mapValue. -Generic values
-Return the number of milliseconds that have elapsed since January 1, 1970 00:00:00 UTC.
-To offer protection against timing attacks and fingerprinting, the precision of utcNow() -might get rounded depending on browser settings. In Firefox, the privacy.reduceTimerPrecision -preference is enabled by default and defaults to 20µs in Firefox 59; in 60 it will be 2ms.
-A Number representing the milliseconds elapsed since the UNIX epoch.
-Perform a deep freeze on the object and all of it's contained values / properties by recursively calling
-objFreeze() on all enumerable properties of the object and on each property returned.
the object to be completly frozen.
-The originally passed in object.
-Removes an event handler for the specified event
-{string} - The name of the event, with optional namespaces or just the namespaces, -such as "click", "click.mynamespace" or ".mynamespace"
-{any} - The callback function that needs to be removed from the given event, when using a -namespace (with or without a qualifying event) this may be null to remove all previously attached event handlers -otherwise this will only remove events with this specific handler.
-[Optional] Defaults to false
-Helper function to wrap a function with a perf event
-The Performance Manager or a Performance provider source (may be null)
-The callback to create the source name for the event (if perf monitoring is enabled)
-The function to call and measure
-OptionalperfEvt: IPerfEventOptionaldetails: (() => any)A function to return the payload details
-OptionalisAsync: booleanIs the event / function being call asynchronously or synchronously
-Call the unload function on all targets handling any returned IPromise -/ Promise before calling the next targets unload
-An array of the targets to unload
-OptionalisAsync: booleanThe caller identifies whether it is expecting the operations to complete synchronously or asynchronously. Even -if the caller is not waiting the operation may still be performed asynchronously depending on the component and the reverse is -also true.
-Optionaldone: (() => void)Optional callback function to call once all of the unload functions have been called.
-Returns string representation of an object suitable for diagnostics logging.
-The object to be converted to a diagnostic string value
-Optionalformat: number | booleanIdentifies whether the JSON value should be formated
-true - Format with 4 spacesfalse (or not Truthy) - Do not formatA string representation of the object suitable for diagnostics logging
-let obj = { a: 1, b: "Hello", c: { d: 2, e: "Darkness" } };
let objStr = dumpObj(obj);
// objStr === "[object Object]: { a: 1, b: "Hello", c: { d: 2, e: "Darkness" } }"
let objStrFmt = dumpObj(obj, true);
// objStrFmt === "[object Object]: {\n a: 1,\n b: "Hello",\n c: {\n d: 2,\n e: "Darkness"\n }\n}"
let objStrFmt2 = dumpObj(obj, 2);
// objStrFmt2 === "[object Object]: {\n a: 1,\n b: "Hello",\n c: {\n d: 2,\n e: "Darkness"\n }\n}"
let objStrFmt3 = dumpObj(obj, 0);
// objStrFmt3 === "[object Object]: { a: 1, b: "Hello", c: { d: 2, e: "Darkness" } }"
let objStrFmt4 = dumpObj(obj, false);
// objStrFmt4 === "[object Object]: { a: 1, b: "Hello", c: { d: 2, e: "Darkness" } }"
let objStrFmt5 = dumpObj(obj, null);
// objStrFmt5 === "[object Object]: { a: 1, b: "Hello", c: { d: 2, e: "Darkness" } }"
let objStrFmt6 = dumpObj(obj, undefined);
// objStrFmt6 === "[object Object]: { a: 1, b: "Hello", c: { d: 2, e: "Darkness" } }"
let objStrFmt7 = dumpObj(obj, "");
// objStrFmt7 === "[object Object]: { a: 1, b: "Hello", c: { d: 2, e: "Darkness" } }"
let err = new Error("Hello Darkness");
let errStr = dumpObj(err);
// errStr === "[object Error]: { stack: 'Error: Hello Darkness\n at <anonymous>:1:13', message: 'Hello Darkness', name: 'Error'"
let errStrFmt = dumpObj(err, true);
// errStrFmt === "[object Error]: {\n stack: "Error: Hello Darkness\n at <anonymous>:1:13",\n message: "Hello Darkness",\n name: "Error"\n}"
let errStrFmt2 = dumpObj(err, 2);
// errStrFmt2 === "[object Error]: {\n stack: "Error: Hello Darkness\n at <anonymous>:1:13",\n message: "Hello Darkness",\n name: "Error"\n}"
let errStrFmt3 = dumpObj(err, 0);
// errStrFmt3 === "[object Error]: { stack: "Error: Hello Darkness\n at <anonymous>:1:13", message: "Hello Darkness", name: "Error" }"
-
-
-Removes an event handler for the specified event
-{string} - The name of the event, with optional namespaces or just the namespaces, -such as "click", "click.mynamespace" or ".mynamespace"
-{any} - The callback function that needs to be removed from the given event, when using a -namespace (with or without a qualifying event) this may be null to remove all previously attached event handlers -otherwise this will only remove events with this specific handler.
-OptionalevtNamespace: string | string[][Optional] Additional namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace, -if the eventName also includes a namespace the namespace(s) are merged into a single namespace
-[Optional] Defaults to false
-Binds the specified function to an event, so that the function gets called whenever the event fires on the object
-String that specifies any of the standard DHTML Events without "on" prefix, if may also include an optional (dot "." prefixed) -namespaces "click" "click.mynamespace" in addition to specific namespaces.
-Pointer that specifies the function to call when event fires
-OptionalevtNamespace: string | string[][Optional] Additional namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace, -if the eventName also includes a namespace the namespace(s) are merged into a single namespace
-[Optional] Defaults to false
-True if the function was bound successfully to the event, otherwise false
-Helper function to fetch the passed traceparent from the page, looking for it as a meta-tag or a Server-Timing header.
-OptionalselectIdx: numberIf the found value is comma separated which is the preferred entry to select, defaults to the first
-This is the reverse case of blockDynamicConversion in that this will tag an -object to indicate that it should always be converted into a dynamic trackable object -even when not an object or array. So all properties of this object will become -get / set accessor functions.
-When you have tagged a value as both forceDynamicConversion and blocked force will take precedence.
-If value is falsy (null / undefined / 0 / empty string etc) it will not be tagged and
-if there is an exception adding the property to the value (because its frozen etc) the
-exception will be swallowed.
The object that should be tagged and converted if included into a dynamic -configuration.
-The original value
-Optionalmessage: stringFormat the ITraceParent value as a string using the supported and know version formats. -So even if the passed traceParent is a later version the string value returned from this -function will convert it to only the known version formats. -This currently only supports version "00" and invalid "ff"
-The parsed traceParent value
-Get the current global performance manager that will be used with no performance manager is supplied.
-Returns the current global scope object, for a normal web page this will be the current -window, for a Web Worker this will be current worker global scope via "self". The internal -implementation returns the first available instance object in the following order
-OptionaluseCached: boolean[Optional] used for testing to bypass the cached lookup, when true this will
-cause the cached global to be reset.
Return the named global object if available, will return null if the object is not available.
-The globally named object, may be any valid property key (string, number or symbol)
-OptionaluseCached: boolean[Optional] used for testing to bypass the cached lookup, when true this will
-cause the cached global to be reset.
// This does not cause the evaluation to occur
window.myGlobal = "Hello";
let cachedValue = getInst("myGlobal");
// cachedValue === "Hello"
window.myGlobal = "Darkness";
// getInst("myGlobal") === "Darkness"
let promiseCls = getInst("Promise");
// May throw if the global is not supported by the runtime
// otherwise the Promise class.
-
-
-Returns the global location object if it is present otherwise null. -This helper is used to access the location object without causing an exception -"Uncaught ReferenceError: location is not defined"
-OptionalcheckForMock: booleanReturns the global performance Object if available, which can be used to
-gather performance information about the current document. It serves as the
-point of exposure for the Performance Timeline API, the High Resolution Time
-API, the Navigation Timing API, the User Timing API, and the Resource Timing API.
The global performance object if available.
-Checks if JSON object is available, this is required as we support the API running without a -window /document (eg. Node server, electron webworkers) and if we attempt to assign a history -object to a local variable or pass as an argument an "Uncaught ReferenceError: JSON is not defined" -exception will be thrown. -Defined as a function to support lazy / late binding environments.
-The objHasOwnProperty() method returns a boolean indicating whether the object -has the specified property as its own property (as opposed to inheriting it).
-The objHasOwnProperty() method returns true if the specified property is a direct -property of the object — even if the value is null or undefined. The method returns -false if the property is inherited, or has not been declared at all. Unlike the in -operator, this method does not check for the specified property in the object's -prototype chain.
-The method can be called on most JavaScript objects, because most objects descend -from Object, and hence inherit its methods. For example Array is an Object, so you -can use objHasOwnProperty() method to check whether an index exists:
-The object being evaluated
-The String or Symbol of the property to test
-true if the object has the specified property as own property; otherwise false
let example = {};
objHasOwnProperty(example, 'prop'); // false
example.prop = 'exists';
objHasOwnProperty(example, 'prop'); // true - 'prop' has been defined
example.prop = null;
objHasOwnProperty(example, 'prop'); // true - own property exists with value of null
example.prop = undefined;
objHasOwnProperty(example, 'prop'); // true - own property exists with value of undefined
-
-
-Initialize the queue of plugins
-The extensions
-Checks if the type of value is an Array.
-Checks if HTML5 Beacons are supported in the current environment.
-OptionaluseCached: boolean[Optional] used for testing to bypass the cached lookup, when true this will
-cause the cached global to be reset.
True if supported, false otherwise.
-Check if an object is of type Date
-Optionalfeature: stringOptionalcfg: TChecks if the Fetch API is supported in the current environment.
-OptionalwithKeepAlive: boolean[Optional] If True, check if fetch is available and it supports the keepalive feature, otherwise only check if fetch is supported
-True if supported, otherwise false
-Checks to see if the past value is a function value
-function myFunction() { }
isFunction(null); // false
isFunction(undefined); // false
isFunction("null"); // false
isFunction("undefined"); // false
isFunction("1"); // false
isFunction("aa"); // false
isFunction(new Date()); // false
isFunction(1); // false
isFunction(""); // false
isFunction(myFunction); // true
isFunction([]); // false
isFunction(new Array(1)); // false
-
-
-Checks if the provided value is null, undefined or contains the string value of "undefined".
-The value to check
-true if the value is null or undefined
isNullOrUndefined(null); // true
isNullOrUndefined(undefined); // true
isNullOrUndefined("undefined"); // true
let value = null;
isNullOrUndefined(value); // true
let value = undefined;
isNullOrUndefined(value); // true
isNullOrUndefined(""); // false
isNullOrUndefined(0); // false
isNullOrUndefined(new Date()); // false
isNullOrUndefined(true); // false
isNullOrUndefined(false); // false
-
-
-Is the parsed traceParent indicating that the trace is currently sampled.
-The parsed traceParent value
-Checks to see if the past value is a string value
-Checks if the provided value is undefined or contains the string value "undefined", -if you want to consider the string value as undefined see isStrictUndefined
-The value to check
-true if the value is undefined or "undefined", otherwise false
-isUndefined(undefined); // true
isUndefined("undefined"); // true
isUndefined(null); // false
isUndefined("null"); // false
isUndefined("1"); // false
isUndefined("aa"); // false
isUndefined(new Date()); // false
isUndefined(1); // false
isUndefined(""); // false
isUndefined(_dummyFunction); // false
isUndefined([]); // false
isUndefined(new Array(1)); // false
isUndefined(true); // false
isUndefined(false); // false
isUndefined("true"); // false
isUndefined("false"); // false
isUndefined(new Boolean(true)); // false
isUndefined(new Boolean(false)); // false
isUndefined(new Boolean("true")); // false
isUndefined(new Boolean("false")); // false
isUndefined(Boolean(true)); // false
isUndefined(Boolean(false)); // false
isUndefined(Boolean("true")); // false
isUndefined(Boolean("false")); // false
isUndefined(new RegExp("")); // false
isUndefined(new ArrayBuffer(0)); // false
isUndefined(new Error("Test Error"));// false
isUndefined(new TypeError("Test TypeError")); // false
isUndefined(new TestError("Test TestError")); // false
isUndefined(_dummyError()); // false
isUndefined(Promise.reject()); // false
isUndefined(Promise.resolve()); // false
isUndefined(new Promise(() => {})); // false
isUndefined(_simplePromise()); // false
isUndefined(_simplePromiseLike()); // false
isUndefined(Object.create(null)); // false
isUndefined(polyObjCreate(null)); // false
-
-
-Is the provided W3c span id (aka. parent id) a valid string representation, it must be a 16-character -string of lowercase hexadecimal characters, for example, 00f067aa0ba902b7. -If all characters are zero (0000000000000000) this is considered an invalid value.
-The W3c span id to be validated
-true if valid otherwise false
-Is the provided W3c Trace Id a valid string representation, it must be a 32-character string -of lowercase hexadecimal characters for example, 4bf92f3577b34da6a3ce929d0e0e4736. -If all characters as zero (00000000000000000000000000000000) it will be considered an invalid value.
-The W3c trace Id to be validated
-true if valid otherwise false
-Validates that the provided ITraceParent instance conforms to the currently supported specifications
-Generate a random 32-bit number between (0x000000..0xFFFFFFFF) or (-0x80000000..0x7FFFFFFF), using MWC (Multiply with carry) -instead of Math.random() defaults to un-signed. -Used as a replacement random generator for IE to avoid issues with older IE instances.
-Optionalsigned: booleanTrue to return a signed 32-bit number (-0x80000000..0x7FFFFFFF) otherwise an unsigned one (0x000000..0xFFFFFFFF)
-Generate random base64 id string. -The default length is 22 which is 132-bits so almost the same as a GUID but as base64 (the previous default was 5)
-Optional value to specify the length of the id to be generated, defaults to 22
-Validates that the string name conforms to the JS IdentifierName specification and if not -normalizes the name so that it would. This method does not identify or change any keywords -meaning that if you pass in a known keyword the same value will be returned. -This is a simplified version
-The name to validate
-Try to define get/set object property accessors for the target object/prototype, this will provide compatibility with -existing API definition when run within an ES5+ container that supports accessors but still enable the code to be loaded -and executed in an ES3 container, providing basic IE8 compatibility.
-The object on which to define the property.
-The name of the property to be defined or modified.
-OptionalgetProp: (() => V)The getter function to wire against the getter.
-OptionalsetProp: ((v: V) => void)The setter function to wire against the setter.
-Optionalconfigurable: booleanCan the value be changed, defaults to true
-Optionalenumerable: booleanShould this get property be enumerable, defaults to true.
-The object that was passed to the function
-It is recommended that you use objDefine instead objDefineAccessors as this internally creates -the ObjDefinePropDescriptor definition based on your provided arguments. And only using a minimum set of functions -reduces your overall bundle size.
-Pass in the objects to merge as arguments, this will only "merge" (extend) properties that are owned by the object. -It will NOT merge inherited or non-enumerable properties.
-The extended first object.
-Calls the provided callbackFn function once for each key in an object. This is equivelent to arrForEach(Object.keys(theObject), callbackFn) or
-if not using the array helper Object.keys(theObject).forEach(callbackFn) except that this helper avoid creating a temporary of the object
-keys before iterating over them and like the arrForEach helper you CAN stop or break the iteration by returning -1 from the callbackFn function.
A function that accepts up to two arguments, the key name and the current value of the property represented by the key.
-OptionalthisArg: any[Optional] An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, null or undefined -the object will be used as the this value.
-The objFreeze() method freezes an object. A frozen object can no longer be changed; freezing an object
-prevents new properties from being added to it, existing properties from being removed, prevents changing the
-enumerability, configurability, or writability of existing properties, and prevents the values of existing
-properties from being changed. In addition, freezing an object also prevents its prototype from being changed.
-objFreeze() returns the same object that was passed in.
Nothing can be added to or removed from the properties set of a frozen object. Any attempt to do so will fail, -either silently or by throwing a TypeError exception (most commonly, but not exclusively, when in strict mode).
-For data properties of a frozen object, values cannot be changed, the writable and configurable attributes are -set to false. Accessor properties (getters and setters) work the same (and still give the illusion that you are -changing the value). Note that values that are objects can still be modified, unless they are also frozen. As -an object, an array can be frozen; after doing so, its elements cannot be altered and no elements can be added -to or removed from the array.
-objFreeze() returns the same object that was passed into the function. It does not create a frozen copy.
The objKeys() method returns an array of a given object's own enumerable property names, iterated in
-the same order that a normal loop would.
objKeys() returns an array whose elements are strings corresponding to the enumerable properties found -directly upon object. The ordering of the properties is the same as that given by looping over the -properties of the object manually.
-// simple array
const arr = ['a', 'b', 'c'];
console.log(objKeys(arr)); // console: ['0', '1', '2']
// array-like object
const obj = { 0: 'a', 1: 'b', 2: 'c' };
console.log(objKeys(obj)); // console: ['0', '1', '2']
// array-like object with random key ordering
const anObj = { 100: 'a', 2: 'b', 7: 'c' };
console.log(objKeys(anObj)); // console: ['2', '7', '100']
// getFoo is a property which isn't enumerable
const myObj = objCreate({}, {
getFoo: {
value() { return this.foo; }
}
});
myObj.foo = 1;
console.log(objKeys(myObj)); // console: ['foo']
-
-
-The objSeal() method seals an object, preventing new properties from being added to it and marking all
-existing properties as non-configurable. Values of present properties can still be changed as long as they
-are writable.
The objToString() method returns a string representing the object. This explicitly
-always calls the Object.prototype.toString() method.
An object's toString() method is most commonly invoked when that object undergoes:
-The object to be converted into a string
-A string representation of the object
-Watch and track changes for accesses to the current config, the provided config MUST already be -a dynamic config or a child accessed via the dynamic config
-Optionallogger: IDiagnosticLoggerThe logger instance to use if there is no existing handler
-A watcher handler instance that can be used to remove itself when being unloaded
-Create and open an XMLHttpRequest object
-The request method
-The url
-OptionalwithCredentials: booleanOption flag indicating that credentials should be sent
-Optional flag indicating that the XHR object should be marked as disabled and not tracked (default is false)
-Optional flag indicating if the instance should be a synchronous request (defaults to false)
-Optionaltimeout: numberOptional value identifying the timeout value that should be assigned to the XHR request
-A new opened XHR request
-A helper function to assist with JIT performance for objects that have properties added / removed dynamically -this is primarily for chromium based browsers and has limited effects on Firefox and none of IE. Only call this -function after you have finished "updating" the object, calling this within loops reduces or defeats the benefits. -This helps when iterating using for..in, objKeys() and objForEach()
-The object to be optimized if possible
-Parses the response from the backend.
-XMLHttpRequest or XDomainRequest response
-OptionaldiagLog: IDiagnosticLoggerAttempt to parse the provided string as a W3C TraceParent header value (https://www.w3.org/TR/trace-context/#traceparent-header)
-The value to be parsed
-OptionalselectIdx: numberIf the found value is comma separated which is the preferred entry to select, defaults to the first
-Returns the number of milliseconds that has elapsed since the time origin, if
-the runtime does not support the performance API it will fallback to return
-the number of milliseconds since the unix epoch.
The number of milliseconds as a DOMHighResTimeStamp double value or
-an integer depending on the runtime.
Effectively assigns all enumerable properties (not just own properties) and functions (including inherited prototype) from -the source object to the target, it attempts to use proxy getters / setters (if possible) and proxy functions to avoid potential -implementation issues by assigning prototype functions as instance ones
-This method is the primary method used to "update" the snippet proxy with the ultimate implementations.
-Special ES3 Notes: -Updates (setting) of direct property values on the target or indirectly on the source object WILL NOT WORK PROPERLY, updates to the -properties of "referenced" object will work (target.context.newValue = 10 => will be reflected in the source.context as it's the -same object). ES3 Failures: assigning target.myProp = 3 -> Won't change source.myProp = 3, likewise the reverse would also fail.
-The target object to be assigned with the source properties and functions
-The source object which will be assigned / called by setting / calling the targets proxies
-OptionalchkSet: ((name: string, isFunc?: boolean, source?: S, target?: T) => boolean)An optional callback to determine whether a specific property/function should be proxied
-Creates a proxy function on the target which internally will call the source version with all arguments passed to the target method.
-The target object to be assigned with the source properties and functions
-The function name that will be added on the target
-The source object which will be assigned / called by setting / calling the targets proxies
-The function name on the source that will be proxied on the target
-OptionaloverwriteTarget: booleanIf false this will not replace any pre-existing name otherwise (the default) it will overwrite any existing name
Creates proxy functions on the target which internally will call the source version with all arguments passed to the target method.
-The target object to be assigned with the source properties and functions
-The source object which will be assigned / called by setting / calling the targets proxies
-An array of function names that will be proxied on the target
-OptionaloverwriteTarget: booleanIf false this will not replace any pre-existing name otherwise (the default) it will overwrite any existing name
-Trys to remove event handler(s) for the specified event/namespace to the window, body and document
-{string} - The name of the event, with optional namespaces or just the namespaces, -such as "click", "click.mynamespace" or ".mynamespace"
-{any} - - The callback function that needs to be removed from the given event, when using a -namespace (with or without a qualifying event) this may be null to remove all previously attached event handlers -otherwise this will only remove events with this specific handler.
-OptionalevtNamespace: string | string[][Optional] Namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace.
-Remove the listener from the array of events
-An string array of event names to bind the listener to
-The event callback to call when the event is triggered
-OptionalevtNamespace: string | string[][Optional] Namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace.
-Removes the pageHide event listeners added by addPageHideEventListener, because the 'visibilitychange' uses -an internal proxy to detect the visibility state you SHOULD use a unique namespace when calling addPageHideEventListener -as the remove ignores the listener argument for the 'visibilitychange' event.
-The specific listener to remove for the 'pageshow' event only (ignored for 'visibilitychange')
-OptionalevtNamespace: string | string[]The unique namespace used when calling addPageShowEventListener
-Removes the pageShow event listeners added by addPageShowEventListener, because the 'visibilitychange' uses -an internal proxy to detect the visibility state you SHOULD use a unique namespace when calling addPageShowEventListener -as the remove ignores the listener argument for the 'visibilitychange' event.
-The specific listener to remove for the 'pageshow' event only (ignored for 'visibilitychange')
-OptionalevtNamespace: string | string[]The unique namespace used when calling addPageShowEventListener
-Remove any matching 'beforeunload', 'unload' and 'pagehide' events that may have been added via addEventListener, -addEventListeners, addPageUnloadEventListener or addPageHideEventListener.
-The specific event callback to to be removed
-OptionalevtNamespace: string | string[][Optional] Namespace(s) uniquely identified and removed based on this namespace.
-true - when at least one of the events was registered otherwise false
-Run the unload function of the target object if it exists
-The target object that contains the unload function
-OptionalisAsync: booleanThe caller identifies whether it is expecting the operation to complete synchronously or asynchronously. Even -if the caller is not waiting the operation may still be performed asynchronously depending on the component and the reverse is -also true.
-The result of the target function
-Helper to return the ICookieMgr from the core (if not null/undefined) or a default implementation -associated with the configuration or a legacy default.
-Optionalconfig: IConfigurationOptionalconfig: IConfigurationSet the global performance manager to use when there is no core instance or it has not been initialized yet.
-The IPerfManager instance to use when no performance manager is supplied.
-Sets the provided value on the target instance using the field name when the provided chk function returns true, the chk -function will only be called if the new value is no equal to the original value.
-The target object
-The key of the target
-The value to set
-OptionalvalChk: ((value: T[K]) => boolean)[Optional] Callback to check the value that if supplied will be called check if the new value can be set
-OptionalsrcChk: ((value: T[K]) => boolean)[Optional] Callback to check to original value that if supplied will be called if the new value should be set (if allowed)
-The existing or new value, depending what was set
-This method lets you determine whether or not a string ends with another string. This method is case-sensitive.
-This method lets you determine whether or not a string begins with another string. This method is case-sensitive.
-The value to be checked
-The characters to be searched for at the start of the string
-Optionalposition: number[Optional] The position in this string at which to begin searching for searchString.
-Defaults to 0
true if the given characters are found at the beginning of the string; otherwise, false.
The trim() method removes whitespace from both ends of a string and returns a new string, -without modifying the original string. Whitespace in this context is all the whitespace -characters (space, tab, no-break space, etc.) and all the line terminator characters -(LF, CR, etc.).
-The string value to be trimmed.
-A new string representing str stripped of whitespace from both its beginning and end.
-If neither the beginning or end of str has any whitespace, a new string is still returned (essentially
-a copy of str), with no exception being thrown.
-To return a new string with whitespace trimmed from just one end, use strTrimStart() or strTrimEnd().
Throws an Aggregation Error which includes all of the errors that led to this error occurring
-The message describing the aggregation error (the sourceError details are added to this)
-An array of the errors that caused this situation
-Teardown / Unload helper to perform teardown/unloading operations for the provided components synchronously or asynchronously, this will call any -_doTeardown() or _doUnload() functions on the provided components to allow them to finish removal.
-The components you want to unload
-OptionalunloadCtx: IProcessTelemetryUnloadContextThis is the context that should be used during unloading.
-OptionalunloadState: ITelemetryUnloadStateThe details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.
-OptionalasyncCallback: (() => void)An optional callback that the plugin must call if it returns true to inform the caller that it has completed any async unload/teardown operations.
-boolean - true if the plugin has or will call asyncCallback, this allows the plugin to perform any asynchronous operations.
-Identifies an interface to a host that can provide an IPerfManager implementation
-OptionalactiveWatches and tracks status of initialization process
-ActiveStatus
-3.3.0 -If returned status is active, it means initialization process is completed. -If returned status is pending, it means the initialization process is waiting for promieses to be resolved. -If returned status is inactive, it means ikey is invalid or can 't get ikey or enpoint url from promsises.
-ReadonlyconfigFunction used to identify the get w parameter used to identify status bit to some channels
-OptionalisReturns a value that indicates whether the instance has already been previously initialized.
-ReadonlyloggerThe current logger instance for this instance.
-ReadonlypluginThe formatted string of the installed plugins that contain a version number
-ReadonlypluginAn array of the installed plugins that provide a version
-OptionaladdAdds a notification listener. The SDK calls methods on the listener when an appropriate notification is raised. -The added plugins must raise notifications. If the plugins do not implement the notifications, then no methods will be -called.
-An INotificationListener object.
-Add a new plugin to the installation
-The new plugin to add
-OptionalreplaceExisting: booleanshould any existing plugin be replaced, default is false
-OptionaldoAsync: booleanShould the add be performed asynchronously
-OptionaladdCb: ((added?: boolean) => void)[Optional] callback to call after the plugin has been added
-Optionaladded: booleanAdd a telemetry processor to decorate or drop telemetry events.
-The Telemetry Initializer function
-Add a handler that will be called when the SDK is being unloaded
-the handler
-Add this hook so that it is automatically removed during unloading
-The single hook or an array of IInstrumentHook objects
-Flush and send any batched / cached data immediately
-OptionalisAsync: booleanOptionalcallBack: ((flushComplete?: boolean) => void)if specified, notify caller when send is complete, the channel should return true to indicate to the caller that it will be called. -If the caller doesn't return true the caller should assume that it may never be called.
-OptionalflushComplete: booleanOptionalsendReason: SendRequestReasonspecify the reason that you are calling "flush" defaults to ManualFlush (1) if not specified
-OptionalcbTimeout: numberAn optional timeout to wait for any flush operations to complete before proceeding with the unload. Defaults to 5 seconds.
-Get the current cookie manager for this instance
-Get the current notification manager
-Get the current performance manager
-Find and return the (first) plugin with the specified identifier if present
-Return a new instance of the IProcessTelemetryContext for processing events
-Gets the current distributed trace context for this instance if available
-OptionalcreateNew: booleanOptional flag to create a new instance if one doesn't currently exist, defaults to true
-Optionallogger: IDiagnosticLoggerOptionalnotificationManager: INotificationManagerWatches and tracks changes for accesses to the current config, and if the accessed config changes the -handler will be recalled.
-A watcher handler instance that can be used to remove itself when being unloaded
-OptionalpollOptionalremoveRemoves all instances of the listener.
-INotificationListener to remove.
-Set the current cookie manager for this instance
-The manager, if set to null/undefined will cause the default to be created
-Set the current performance manager
-The performance manager
-Sets the current distributed trace context for this instance if available
-OptionalstopUnload and Tear down the SDK and any initialized plugins, after calling this the SDK will be considered
-to be un-initialized and non-operational, re-initializing the SDK should only be attempted if the previous
-unload call return true stating that all plugins reported that they also unloaded, the recommended
-approach is to create a new instance and initialize that instance.
-This is due to possible unexpected side effects caused by plugins not supporting unload / teardown, unable
-to successfully remove any global references or they may just be completing the unload process asynchronously.
-If you pass isAsync as true (also the default) and DO NOT pass a callback function then an IPromise
-will be returned which will resolve once the unload is complete. The actual implementation of the IPromise
-will be a native Promise (if supported) or the default as supplied by ts-async library
OptionalisAsync: booleanCan the unload be performed asynchronously (default)
-OptionalunloadComplete: ((unloadState: ITelemetryUnloadState) => void)An optional callback that will be called once the unload has completed
-OptionalcbTimeout: numberAn optional timeout to wait for any flush operations to complete before proceeding with the -unload. Defaults to 5 seconds.
-Nothing or if occurring asynchronously a IPromise -which will be resolved once the unload is complete, the IPromise -will only be returned when no callback is provided and isAsync is true
-Update the configuration used and broadcast the changes to all loaded plugins, this does NOT support updating, adding or removing -any the plugins (extensions or channels). It will notify each plugin (if supported) that the configuration has changed but it will -not remove or add any new plugins, you need to call addPlugin or getPlugin(identifier).remove();
-The new configuration is apply
-OptionalmergeExisting: booleanShould the new configuration merge with the existing or just replace it. Default is to merge.
-Optional ReadonlyappApp id returned by the backend - not necessary returned, but we don't need it with each response.
-ReadonlyerrorsList of errors for items which were not accepted
-ReadonlyitemsNumber of items succesfuly accepted by the backend
-ReadonlyitemsNumber of items received by the backend
-The current core instance for the request
-Create a new context using the core and config from the current instance, returns a new instance of the same type
-Optionalplugins: ITelemetryPluginChain | IPlugin[]The execution order to process the plugins, if null or not supplied -then the current execution order will be copied.
-OptionalstartAt: IPluginThe plugin to start processing from, if missing from the execution -order then the next plugin will be NOT set.
-THe current diagnostic logger for the request
-Gets the current core config instance
-Gets the named config from either the named identifier extension or core config if neither exist then the -default value is returned
-The named extension identifier
-The config field name
-OptionaldefaultValue: The default value to return if no defined config exists
-Gets the named extension config
-Returns the next configured plugin proxy
-Helper to allow plugins to check and possibly shortcut executing code only -required if there is a nextPlugin
-Synchronously iterate over the context chain running the callback for each plugin, once -every plugin has been executed via the callback, any associated onComplete will be called.
-Set the function to call when the current chain has executed all processNext or unloadNext items.
-The onComplete to call
-Optionalthat: anyThe "this" value to use for the onComplete call, if not provided or undefined defaults to the current context
-Rest...args: any[]Any additional arguments to pass to the onComplete function
-Helper to set the next plugin proxy
-Provides data transmission capabilities
-OptionalcoreThe App Insights core to use for backward compatibility. -Therefore the interface will be able to access the core without needing to cast to "any". -[optional] any 3rd party plugins which are already implementing this interface don't fail to compile.
-OptionalgetGet offline support
-IInternalOfflineSupport
-ReadonlyidentifierExtension name
-Initialize plugin loaded by SDK
-The config for the plugin to use
-The current App Insights core to use for initializing this plugin instance
-The complete set of extensions to be used for initializing the plugin
-OptionalpluginChain: ITelemetryPluginChain[Optional] specifies the current plugin chain which identifies the -set of plugins and the order they should be executed for the current request.
-OptionalisReturns a value that indicates whether the plugin has already been previously initialized. -New plugins should implement this method to avoid being initialized more than once.
-ReadonlypriorityPriority of the extension
-Call back for telemetry processing before it it is sent
-This is the current event being reported
-OptionalitemCtx: IProcessTelemetryContextThis is the context for the current request, ITelemetryPlugin instances -can optionally use this to access the current core instance or define / pass additional information -to later plugins (vs appending items to the telemetry item)
-OptionalsetSet next extension for telemetry processing, this is not optional as plugins should use the -processNext() function of the passed IProcessTelemetryContext instead. It is being kept for -now for backward compatibility only.
-OptionalteardownTear down the plugin and remove any hooked value, the plugin should be removed so that it is no longer initialized and -therefore could be re-initialized after being torn down. The plugin should ensure that once this has been called any further -processTelemetry calls are ignored and it just calls the processNext() with the provided context.
-OptionalunloadCtx: IProcessTelemetryUnloadContextThis is the context that should be used during unloading.
-OptionalunloadState: ITelemetryUnloadStateThe details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.
-boolean - true if the plugin has or will call processNext(), this for backward compatibility as previously teardown was synchronous and returned nothing.
-OptionalupdateThe the plugin should re-evaluate configuration and update any cached configuration settings or -plugins. If implemented this method will be called whenever a plugin is added or removed and if -the configuration has bee updated.
-This is the context that should be used during updating.
-The details / state of the update process, it holds details like the current and previous configuration.
-boolean - true if the plugin has or will call updateCtx.processNext(), this allows the plugin to perform any asynchronous operations.
-Optional ReadonlyversionPlugin version (available in data.properties.version in common schema)
-OptionalflushFlush to send data immediately; channel should default to sending data asynchronously. If executing asynchronously and
-you DO NOT pass a callback function then a IPromise
-will be returned which will resolve once the flush is complete. The actual implementation of the IPromise
-will be a native Promise (if supported) or the default as supplied by ts-async library
send data asynchronously when true
-OptionalcallBack: ((flushComplete?: boolean) => void)if specified, notify caller when send is complete, the channel should return true to indicate to the caller that it will be called. -If the caller doesn't return true the caller should assume that it may never be called.
-OptionalflushComplete: booleanOptionalsendReason: SendRequestReasonspecify the reason that you are calling "flush" defaults to ManualFlush (1) if not specified
-true to indicate that callback will be called after the flush is complete otherwise the caller
-should assume that any provided callback will never be called, Nothing or if occurring asynchronously a
-IPromise which will be resolved once the unload is complete,
-the IPromise will only be returned when no callback is provided
-and async is true.OptionalpauseOptionalresumeProvides data transmission capabilities
-OptionalcoreThe App Insights core to use for backward compatibility. -Therefore the interface will be able to access the core without needing to cast to "any". -[optional] any 3rd party plugins which are already implementing this interface don't fail to compile.
-OptionalgetGet offline support
-IInternalOfflineSupport
-ReadonlyidentifierExtension name
-Initialize plugin loaded by SDK
-The config for the plugin to use
-The current App Insights core to use for initializing this plugin instance
-The complete set of extensions to be used for initializing the plugin
-OptionalpluginChain: ITelemetryPluginChain[Optional] specifies the current plugin chain which identifies the -set of plugins and the order they should be executed for the current request.
-OptionalisReturns a value that indicates whether the plugin has already been previously initialized. -New plugins should implement this method to avoid being initialized more than once.
-ReadonlypriorityPriority of the extension
-Call back for telemetry processing before it it is sent
-This is the current event being reported
-OptionalitemCtx: IProcessTelemetryContextThis is the context for the current request, ITelemetryPlugin instances -can optionally use this to access the current core instance or define / pass additional information -to later plugins (vs appending items to the telemetry item)
-OptionalsetSet next extension for telemetry processing, this is not optional as plugins should use the -processNext() function of the passed IProcessTelemetryContext instead. It is being kept for -now for backward compatibility only.
-OptionalteardownTear down the plugin and remove any hooked value, the plugin should be removed so that it is no longer initialized and -therefore could be re-initialized after being torn down. The plugin should ensure that once this has been called any further -processTelemetry calls are ignored and it just calls the processNext() with the provided context.
-OptionalunloadCtx: IProcessTelemetryUnloadContextThis is the context that should be used during unloading.
-OptionalunloadState: ITelemetryUnloadStateThe details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.
-boolean - true if the plugin has or will call processNext(), this for backward compatibility as previously teardown was synchronous and returned nothing.
-OptionalupdateThe the plugin should re-evaluate configuration and update any cached configuration settings or -plugins. If implemented this method will be called whenever a plugin is added or removed and if -the configuration has bee updated.
-This is the context that should be used during updating.
-The details / state of the update process, it holds details like the current and previous configuration.
-boolean - true if the plugin has or will call updateCtx.processNext(), this allows the plugin to perform any asynchronous operations.
-Optional ReadonlyversionPlugin version (available in data.properties.version in common schema)
-OptionalflushFlush to send data immediately; channel should default to sending data asynchronously. If executing asynchronously and
-you DO NOT pass a callback function then a IPromise
-will be returned which will resolve once the flush is complete. The actual implementation of the IPromise
-will be a native Promise (if supported) or the default as supplied by ts-async library
send data asynchronously when true
-OptionalcallBack: ((flushComplete?: boolean) => void)if specified, notify caller when send is complete, the channel should return true to indicate to the caller that it will be called. -If the caller doesn't return true the caller should assume that it may never be called.
-OptionalflushComplete: booleanOptionalsendReason: SendRequestReasonspecify the reason that you are calling "flush" defaults to ManualFlush (1) if not specified
-true to indicate that callback will be called after the flush is complete otherwise the caller
-should assume that any provided callback will never be called, Nothing or if occurring asynchronously a
-IPromise which will be resolved once the unload is complete,
-the IPromise will only be returned when no callback is provided
-and async is true.OptionalpauseOptionalresumeThe default values with a check function
-OptionalblkBlock the value associated with this property from having it's properties / values converted into -dynamic properties, this is generally used to block objects or arrays provided by external libraries -which may be a plain object with readonly (non-configurable) or const properties.
-OptionaldfUse this check to determine the default fallback, default only checked whether the property isDefined,
-therefore null; "" are considered to be valid values.
OptionalfbThe default fallback key if the main key is not present, this is the key value from the config
-OptionalisCallback function to check if the user-supplied value is valid, if not the default will be applied
-OptionalmrgSpecify that any provided value should have the default value(s) merged into the value rather than -just using either the default of user provided values. Mergeed objects will automatically be marked -as referenced.
-OptionalrdSet this field of the target as read-only, which will block this single named property from -ever being changed for the target instance. -This does NOT freeze or seal the instance, it just stops the direct re-assignment of the named property, -if the value is a non-primitive (ie. an object or array) it's properties will still be mutable.
-OptionalrefSet this field of the target as referenced, which will cause any object or array instance -to be updated in-place rather than being entirely replaced. All other values will continue to be replaced. -This is required for nested default objects to avoid multiple repetitive updates to listeners
-OptionalsetOptional function to allow converting and setting of the default value
-OptionalvThe default value to apply if the user-supplied value is not valid
-Configuration provided to SDK core
-Optional ReadonlychannelsChannel queues that is setup by caller in desired order. -If channels are provided here, core will ignore any channels that are already setup, example if there is a SKU with an initialized channel
-OptionalconnectionConnection string of resource. Either this or instrumentationKey must be specified.
-Optionalcookie[Optional] A Cookie Manager configuration which includes hooks to allow interception of the get, set and delete cookie -operations. If this configuration is specified any specified enabled and domain properties will take precedence over the -cookieDomain and disableCookiesUsage values.
-OptionalcookieOptionalcookieOptionalcreate[Optional] Callback function that will be called to create a the IPerfManager instance when required and enablePerfMgr
-is enabled, this enables you to override the default creation of a PerfManager() without needing to setPerfMgr()
-after initialization.
OptionaldiagnosticSet the timer interval (in ms) for internal logging queue, this is the -amount of time to wait after logger.queue messages are detected to be sent. -Note: since 3.0.1 and 2.8.13 the diagnostic logger timer is a normal timeout timer -and not an interval timer. So this now represents the timer "delay" and not -the frequency at which the events are sent.
-Optionaldisable[Optional] A boolean that indicated whether to disable the use of cookies by the SDK. If true, the SDK will not store or -read any data from cookies. Cookie usage can be re-enabled after initialization via the core.getCookieMgr().enable().
-Optionaldisable[Optional] A flag for performance optimization to disable attempting to use the Chrome Debug Extension, if disabled and the extension is installed -this will not send any notifications.
-OptionaldisableOptionaldisable[Optional] An array of page show events that you would like to be ignored, special note there must be at lease one valid show event -hooked, if you list all or the runtime environment only supports a listed (disabled) event it will STILL be hooked, if required by the SDK. -Page Show events include "pageshow" and "visibilitychange" (with 'visible' state)
-Optionaldisable[Optional] An array of the page unload events that you would like to be ignored, special note there must be at least one valid unload -event hooked, if you list all or the runtime environment only supports a listed "disabled" event it will still be hooked, if required by the SDK. -Unload events include "beforeunload", "unload", "visibilitychange" (with 'hidden' state) and "pagehide"
-OptionalenableIf enabled, uncaught exceptions will be thrown to help with debugging
-Optionalenable[Optional] When enabled this will create local perfEvents based on sections of the code that have been instrumented -to emit perfEvents (via the doPerf()) when this is enabled. This can be used to identify performance issues within -the SDK, the way you are using it or optionally your own instrumented code. -The provided IPerfManager implementation does NOT send any additional telemetry events to the server it will only fire -the new perfEvent() on the INotificationManager which you can listen to. -This also does not use the window.performance API, so it will work in environments where this API is not supported.
-OptionalenableWParamAdd "&w=0" parameter to support UA Parsing when web-workers don't have access to Document. -Default is false
-OptionalendpointEndpoint where telemetry data is sent
-Optionalexp[Optional] Set additional configuration for exceptions, such as more scripts to include in the exception telemetry.
-OptionalextensionExtension configs loaded in SDK
-Optional ReadonlyextensionsAdditional plugins that should be loaded by core at runtime
-OptionalfeatureCustom optional value to opt in features
-Optionalid[Optional] Identifies the default length used to generate random session and user id's if non currently exists for the user / session. -Defaults to 22, previous default value was 5, if you need to keep the previous maximum length you should set this value to 5.
-OptionalinitIf your connection string, instrumentation key and endpoint url are promises, -this config is to manually set in memory proxy track calls count limit before promises finished. -Default: 100
-OptionalinitIf your connection string, instrumentation key and endpoint url are promises, -this config is to manually set timeout for those promises. -Default: 50000ms
-OptionalinstrumentationInstrumentation key of resource. Either this or connectionString must be specified.
-OptionalloggingConsole logging level. All logs with a severity level higher -than the configured level will be printed to console. Otherwise -they are suppressed. ie Level 2 will print both CRITICAL and -WARNING logs to console, level 1 prints only CRITICAL.
-Note: Logs sent as telemetry to instrumentation key will also -be logged to console if their severity meets the configured loggingConsoleLevel
-0: ALL console logging off -1: logs to console: severity >= CRITICAL -2: logs to console: severity >= WARNING
-OptionalloggingTelemtry logging level to instrumentation key. All logs with a severity -level higher than the configured level will sent as telemetry data to -the configured instrumentation key.
-0: ALL iKey logging off -1: logs to iKey: severity >= CRITICAL -2: logs to iKey: severity >= WARNING
-OptionalmaxMaximum number of iKey transmitted logging telemetry per page view
-Optionalperf[Optional] Fire every single performance event not just the top level root performance event. Defaults to false.
-OptionalstorageCustom optional value that will be added as a prefix for storage name.
-Delete/Remove the named cookie if cookie support is available and enabled. -Note: Not using "delete" as the name because it's a reserved word which would cause issues on older browsers
-The name of the cookie
-Optionalpath: string[optional] Path to set for the cookie, if not supplied will default to "/"
-Purge the cookie from the system if cookie support is available, this function ignores the enabled setting of the manager -so any cookie will be removed. -Note: Not using "delete" as the name because it's a reserved word which would cause issues on older browsers
-The name of the cookie
-Optionalpath: string[optional] Path to set for the cookie, if not supplied will default to "/"
-Set the named cookie with the value and optional domain and optional
-The name of the cookie
-The value of the cookie (Must already be encoded)
-OptionalmaxAgeSec: number[optional] The maximum number of SECONDS that this cookie should survive
-Optionaldomain: string[optional] The domain to set for the cookie
-Optionalpath: string[optional] Path to set for the cookie, if not supplied will default to "/"
-OptionalunloadUnload and remove any state that this ICookieMgr may be holding, this is generally called when the -owning SDK is being unloaded.
-OptionalisAsync: booleanCan the unload be performed asynchronously (default)
-If the unload occurs synchronously then nothing should be returned, if happening asynchronously then -the function should return an IPromise -/ Promise to allow any listeners to wait for the operation to complete.
-OptionalupdateOptional Callback hook to allow the cookie manager to update it's configuration, not generally implemented now that -dynamic configuration is supported
-Configuration definition for instance based cookie management configuration
-OptionalblockedSpecify the cookie name(s) to never be written, this will cause any cookie name to never be created or updated, -they will still be read unless also included in the ignoreCookies and may still be explicitly purged or deleted. -If not provided defaults to the same list provided in ignoreCookies. (Since v2.8.8)
-OptionaldelHook function to delete the named cookie with the specified value, separated from -setCookie to avoid the need to parse the value to determine whether the cookie is being -added or removed.
-The name of the cookie
-The value to set to expire the cookie
-OptionaldomainCustom cookie domain. This is helpful if you want to share Application Insights cookies across subdomains.
-OptionalenabledDefaults to true, A boolean that indicates whether the use of cookies by the SDK is enabled by the current instance. -If false, the instance of the SDK initialized by this configuration will not store or read any data from cookies
-OptionalgetHook function to fetch the named cookie value.
-The name of the cookie
-OptionalignoreSpecify the cookie name(s) to be ignored, this will cause any matching cookie name to never be read or written.
-They may still be explicitly purged or deleted. You do not need to repeat the name in the blockedCookies
-configuration.(Since v2.8.8)
OptionalpathSpecifies the path to use for the cookie, defaults to '/'
-OptionalsetHook function to set the named cookie with the specified value.
-The name of the cookie
-The value to set for the cookie
-0: OFF -1: only critical (default) -2: critical + info
-The internal logging queue
-OptionaldebugOptionalerrorThis will write an error to the console if possible. -Provided by the default DiagnosticLogger instance, and internally the SDK will fall back to warnToConsole, however, -direct callers MUST check for its existence on the logger as you can provide your own IDiagnosticLogger instance.
-The error message
-OptionallogLogs a message to the internal queue.
-The severity of the log message
-The message to log.
-This method will throw exceptions in debug mode or attempt to log the error as a console warning.
-The severity of the log message
-Optionalproperties: ObjectOptionalisUserAct: booleanOptionalunloadUnload and remove any state that this IDiagnosticLogger may be holding, this is generally called when the -owning SDK is being unloaded.
-OptionalisAsync: booleanCan the unload be performed asynchronously (default)
-If the unload occurs synchronously then nothing should be returned, if happening asynchronously then -the function should return an IPromise -/ Promise to allow any listeners to wait for the operation to complete.
-OptionalupdateOptional Callback hook to allow the diagnostic logger to update it's configuration
-Returns the unique identifier for a trace. All requests / spans from the same trace share the same traceId. -Must be read from incoming headers or generated according to the W3C TraceContext specification, -in a hex representation of 16-byte array. A.k.a. trace-id, TraceID or Distributed TraceID
-Self-generated 8-bytes identifier of the incoming request. Must be a hex representation of 8-byte array. -Also know as the parentId, used to link requests together -https://www.w3.org/TR/trace-context/#parent-id
-Set the unique identifier for a trace. All requests / spans from the same trace share the same traceId. -Must be conform to the W3C TraceContext specification, in a hex representation of 16-byte array. -A.k.a. trace-id, TraceID or Distributed TraceID https://www.w3.org/TR/trace-context/#trace-id
-This interface identifies the config which can track changes
-Set the value that is or will be assigned to this named property of the target will not have it's
-properties converted into dynamic properties, this means that any changes the values properties will
-not be monitored for changes and therefore will not cause any listeners to be notified in any value
-is changed. If the value associated with the target[name] is change this is still dynamic and will
-cause listeners to be notified.
let localValue = target[name]; // If within a listener this will cause the listener to be called again
target[name] = newValue; // This will notify listeners that accessed target[name]
// This will not cause lsiteners to be called because propa is not converted and value of target[name]
// did not change.
target[name].propa = 1;
target[name].propb = 2;
// If within a listener this will caused the listener to be called again only if target[name] is reassigned
// not if the value associated with propa is changed.
let localValue = target[name].propa;
-
-
-Link back to the configuration object that should be used to get/set values
-The logger instance to use to logger any issues
-Helper to call any listeners that are waiting to be notified
-Set this named property of the target as read-only, which will block this single named property from -ever being changed for the target instance. -This does NOT freeze or seal the instance, it just stops the direct re-assignment of the named property, -if the value is a non-primitive (ie. an object or array) it's properties will still be mutable.
-Set this named property of the target as referenced, which will cause any object or array instances -to be updated in-place rather than being entirely replaced. All other values will continue to be replaced.
-Set the value against the provided config/name with the value, the property -will be converted to be dynamic (if not already) as long as the provided config -is already a tracked dynamic object.
-Set default values for the config if not present.
-ReadonlyuidUnique Id for this config handler
-Watch and track changes for accesses to the current config anb
-Callback function for collecting logs to be included in telemetry data.
-The length of logs to generate is controlled by the maxLogs parameter.
This callback is called before telemetry data is sent, allowing for dynamic customization of the logs.
-An object with the following property:
-OptionalinclIf set to true, when exception is sent out, the SDK will also send out all scripts basic info that are loaded on the page. -Notice: This would increase the size of the exception telemetry.
-Optionalblockdefine if should block any changes from cdn cfg, if set to true, cfgValue will be applied under all scenarios
-Optionalmodesets feature opt-in mode
-OptionaloffIdentifies configuration override values when given feature is disabled -NOTE: should use flat string for fields, for example, if you want to set value for extensionConfig.Ananlytics.disableAjaxTrackig in configurations, -you should use "extensionConfig.Ananlytics.disableAjaxTrackig" as field name: {["extensionConfig.Analytics.disableAjaxTrackig"]:1} -Default: undefined
-OptionalonIdentifies configuration override values when given feature is enabled -NOTE: should use flat string for fields, for example, if you want to set value for extensionConfig.Ananlytics.disableAjaxTrackig in configurations, -you should use "extensionConfig.Ananlytics.disableAjaxTrackig" as field name: {["extensionConfig.Analytics.disableAjaxTrackig"]:1} -Default: undefined
-This returns an object that the hook function can use to store hook specific -context, it it not shared with any other hook instances and is unique for the -current call. -A hook implementation can use this to pass / share context between different -hook callbacks eg. request/response requst/hookErrors etc.
-OptionalerrThe error (exception) which occurred while executing the original method
-OptionalevtThe Event object from (window.event) at the start of the original call
-OptionalrsltThe result of the original method, only populated after the original method has returned
-Allows the hook functions to replace the original arguments
-The argument index (0 based)
-The new value for the argument
-The holder of the specific instance callback
-The callbacks to call for the instrumented function, you must provide at least the request and/or response callbacks, both are not required. -You must always supply the error callback
-OptionalfnThe callback to call if the original function causes an exception, even if you -supply a callback the original exception will still be thrown
-OptionalhkThe callback to call if the hook function causes an exception
-Optionalns[Optional] Namespace details (same as the namespace used for events), useful for debugging and testing to -identify the source of the instrumented hooks
-OptionalreqThe hook callback to call before the original function is called
-OptionalrspThe hook callback to call after the original function was called
-Internal Interface
-OptionalbatchBatch an array of strings into one string
-array of strings
-a string represent all items in the given array
-OptionalcreateCreate 1ds payload data
-ITelemetryItems
-IPayloadData
-Create payload data
-data
-IPayloadData
-Get current endpoint url
-endpoint
-OptionalserializeSerialize an item into a string
-telemetry item
-OptionalconvertUndefined: anyconvert undefined to a custom-defined object
-Serialized string
-OptionalshouldIf the item should be processed by offline channel
-telemetry item
-should process or not
-Identifies whether the plugin is enabled and can process events. This is slightly different from isInitialized as the plugin may be initialized but disabled -via the setEnabled() or it may be a shared plugin which has had it's teardown function called from another instance..
-boolean = true if the plugin is in a state where it is operational.
-You can optionally enable / disable a plugin from processing events.
-Setting enabled to true will not necessarily cause the isEnabled() to also return true
-as the plugin must also have been successfully initialized and not had it's teardown method called
-(unless it's also been re-initialized)
An interface used for the notification listener.
-Optionalevents[Optional] A function called when events are discarded.
-The array of events that have been discarded.
-The reason for discarding the events. The EventsDiscardedReason -constant should be used to check the different values.
-Optionalevents[Optional] A function called when the events have been requested to be sent to the sever.
-The reason why the event batch is being sent.
-OptionalisAsync: booleanA flag which identifies whether the requests are being sent in an async or sync manner.
-Optionalevents[Optional] A function called when events are sent.
-The array of events that have been sent.
-Optionalperf[Optional] This event is sent if you have enabled perf events, they are primarily used to track internal performance testing and debugging -the event can be displayed via the debug plugin extension.
-OptionalofflineOptionaloffline[Optional] A function called when the offline events have been sent from the persistent storage
-payload data that is sent from the persistent storage
-Optionaloffline[Optional] A function called when the offline events have been stored to the persistent storage
-items that are stored in the persistent storage
-OptionalunloadUnload and remove any state that this INotificationListener may be holding, this is generally called when the -owning Manager is being unloaded.
-OptionalisAsync: booleanCan the unload be performed asynchronously (default)
-If the unload occurs synchronously then nothing should be returned, if happening asynchronously then -the function should return an IPromise -/ Promise to allow any listeners to wait for the operation to complete.
-Class to manage sending notifications to all the listeners.
-Adds a notification listener.
-The notification listener to be added.
-Notification for events being discarded.
-The array of events that have been discarded by the SDK.
-The reason for which the SDK discarded the events. The EventsDiscardedReason -constant should be used to check the different values.
-Optionalevents[Optional] A function called when the events have been requested to be sent to the sever.
-The reason why the event batch is being sent.
-A flag which identifies whether the requests are being sent in an async or sync manner.
-Notification for events sent.
-The array of events that have been sent.
-OptionalofflineOptionaloffline[Optional] A function called when the offline events have been sent from the persistent storage
-payload data that is sent from the persistent storage
-Optionaloffline[Optional] A function called when the offline events have been stored to the persistent storage
-items that are stored in the persistent storage
-Optionalperf[Optional] This event is sent if you have enabled perf events, they are primarily used to track internal performance testing and debugging -the event can be displayed via the debug plugin extension.
-The perf event details
-Removes all instances of the listener.
-AWTNotificationListener to remove.
-OptionalunloadUnload and remove any state that this INotificationManager may be holding, this is generally called when the -owning SDK is being unloaded.
-OptionalisAsync: booleanCan the unload be performed asynchronously (default)
-If the unload occurs synchronously then nothing should be returned, if happening asynchronously then -the function should return an IPromise -/ Promise to allow any listeners to wait for the operation to complete.
-IPayloadData describes interface of payload sent via POST channel
-This interface identifies the details of an internal performance event - it does not represent an outgoing reported event
-OptionalchildThe child perf events that are contained within the total time of this event.
-Mark this event as completed, calculating the total execution time.
-OptionalexIdentifies the exclusive time spent in for this event (not including child events), -this will be undefined until the event is completed.
-OptionalgetGet the names additional context associated with this perf event
-Is this occurring from an asynchronous event
-Identifies whether this event is a child event of a parent
-The name of the performance event
-OptionalparentThe Parent event that was started before this event was created
-The payload (contents) of the perfEvent, may be null or only set after the event has completed depending on -the runtime environment.
-OptionalsetSet the named additional context to be associated with this perf event, this will replace any existing value
-The start time of the performance event
-OptionaltimeIdentifies the total inclusive time spent for this event, including the time spent for child events, -this will be undefined until the event is completed
-This defines an internal performance manager for tracking and reporting the internal performance of the SDK -- It does -not represent or report any event to the server.
-Create a new event and start timing, the manager may return null/undefined to indicate that it does not -want to monitor this source event.
-The source name of the event
-OptionalpayloadDetails: (() => any)An optional callback function to fetch the payload details for the event.
-OptionalisAsync: booleanIs the event occurring from a async event
-Complete the perfEvent and fire any notifications.
-Fire the event which will also complete the passed event
-Identifies an interface to a host that can provide an IPerfManager implementation
-Get the current performance manager
-Set the current performance manager
-The performance manager
-OptionalcoreThe App Insights core to use for backward compatibility. -Therefore the interface will be able to access the core without needing to cast to "any". -[optional] any 3rd party plugins which are already implementing this interface don't fail to compile.
-ReadonlyidentifierExtension name
-Initialize plugin loaded by SDK
-The config for the plugin to use
-The current App Insights core to use for initializing this plugin instance
-The complete set of extensions to be used for initializing the plugin
-OptionalpluginChain: ITelemetryPluginChain[Optional] specifies the current plugin chain which identifies the -set of plugins and the order they should be executed for the current request.
-OptionalisReturns a value that indicates whether the plugin has already been previously initialized. -New plugins should implement this method to avoid being initialized more than once.
-OptionalteardownTear down the plugin and remove any hooked value, the plugin should be removed so that it is no longer initialized and -therefore could be re-initialized after being torn down. The plugin should ensure that once this has been called any further -processTelemetry calls are ignored and it just calls the processNext() with the provided context.
-This is the context that should be used during unloading.
-OptionalunloadState: ITelemetryUnloadStateThe details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.
-boolean - true if the plugin has or will call processNext(), this for backward compatibility as previously teardown was synchronous and returned nothing.
-Optional ReadonlyversionPlugin version (available in data.properties.version in common schema)
-The current context for the current call to processTelemetry(), used to support sharing the same plugin instance -between multiple AppInsights instances
-The current core instance for the request
-Create a new context using the core and config from the current instance, returns a new instance of the same type
-Optionalplugins: ITelemetryPluginChain | IPlugin[]The execution order to process the plugins, if null or not supplied -then the current execution order will be copied.
-OptionalstartAt: IPluginThe plugin to start processing from, if missing from the execution -order then the next plugin will be NOT set.
-THe current diagnostic logger for the request
-Gets the current core config instance
-Gets the named config from either the named identifier extension or core config if neither exist then the -default value is returned
-The named extension identifier
-The config field name
-OptionaldefaultValue: The default value to return if no defined config exists
-Gets the named extension config
-Returns the next configured plugin proxy
-Helper to allow plugins to check and possibly shortcut executing code only -required if there is a nextPlugin
-Synchronously iterate over the context chain running the callback for each plugin, once -every plugin has been executed via the callback, any associated onComplete will be called.
-Set the function to call when the current chain has executed all processNext or unloadNext items.
-The onComplete to call
-Optionalthat: anyThe "this" value to use for the onComplete call, if not provided or undefined defaults to the current context
-Rest...args: any[]Any additional arguments to pass to the onComplete function
-Call back for telemetry processing before it it is sent
-This is the current event being reported
-boolean (true) if there is no more plugins to process otherwise false or undefined (void)
-Helper to set the next plugin proxy
-The current context for the current call to teardown() implementations, used to support when plugins are being removed -or the SDK is being unloaded.
-The current core instance for the request
-Create a new context using the core and config from the current instance, returns a new instance of the same type
-Optionalplugins: ITelemetryPluginChain | IPlugin[]The execution order to process the plugins, if null or not supplied -then the current execution order will be copied.
-OptionalstartAt: IPluginThe plugin to start processing from, if missing from the execution -order then the next plugin will be NOT set.
-THe current diagnostic logger for the request
-Gets the current core config instance
-Gets the named config from either the named identifier extension or core config if neither exist then the -default value is returned
-The named extension identifier
-The config field name
-OptionaldefaultValue: The default value to return if no defined config exists
-Gets the named extension config
-Returns the next configured plugin proxy
-Helper to allow plugins to check and possibly shortcut executing code only -required if there is a nextPlugin
-Synchronously iterate over the context chain running the callback for each plugin, once -every plugin has been executed via the callback, any associated onComplete will be called.
-Set the function to call when the current chain has executed all processNext or unloadNext items.
-The onComplete to call
-Optionalthat: anyThe "this" value to use for the onComplete call, if not provided or undefined defaults to the current context
-Rest...args: any[]Any additional arguments to pass to the onComplete function
-This Plugin has finished unloading, so unload the next one
-boolean (true) if there is no more plugins to process otherwise false or undefined (void)
-Helper to set the next plugin proxy
-The current context for the current call to the plugin update() implementations, used to support the notifications -for when plugins are added, removed or the configuration was changed.
-The current core instance for the request
-Create a new context using the core and config from the current instance, returns a new instance of the same type
-Optionalplugins: ITelemetryPluginChain | IPlugin[]The execution order to process the plugins, if null or not supplied -then the current execution order will be copied.
-OptionalstartAt: IPluginThe plugin to start processing from, if missing from the execution -order then the next plugin will be NOT set.
-THe current diagnostic logger for the request
-Gets the current core config instance
-Gets the named config from either the named identifier extension or core config if neither exist then the -default value is returned
-The named extension identifier
-The config field name
-OptionaldefaultValue: The default value to return if no defined config exists
-Gets the named extension config
-Returns the next configured plugin proxy
-Helper to allow plugins to check and possibly shortcut executing code only -required if there is a nextPlugin
-Synchronously iterate over the context chain running the callback for each plugin, once -every plugin has been executed via the callback, any associated onComplete will be called.
-Set the function to call when the current chain has executed all processNext or unloadNext items.
-The onComplete to call
-Optionalthat: anyThe "this" value to use for the onComplete call, if not provided or undefined defaults to the current context
-Rest...args: any[]Any additional arguments to pass to the onComplete function
-This Plugin has finished unloading, so unload the next one
-The update State
-boolean (true) if there is no more plugins to process otherwise false or undefined (void)
-Helper to set the next plugin proxy
-Add a telemetry processor to decorate or drop telemetry events.
-The Telemetry Initializer function
-An alternate interface which provides automatic removal during unloading of the component
-Telemety item supported in Core
-OptionalbaseBased on schema for part B
-OptionalbaseTelemetry type used for part B
-OptionaldataCustom data
-OptionalextSystem context properties of the telemetry item, example: ip address, city etc
-OptionaliIdentifier of the resource that uniquely identifies which resource data is sent to
-Unique name of the telemetry item
-OptionaltagsSystem context property extensions that are not global (not in ctx)
-OptionaltimeTimestamp when item was sent
-OptionalverCommonSchema Version of this SDK
-Configuration provided to SDK core
-OptionalcoreThe App Insights core to use for backward compatibility. -Therefore the interface will be able to access the core without needing to cast to "any". -[optional] any 3rd party plugins which are already implementing this interface don't fail to compile.
-ReadonlyidentifierExtension name
-Initialize plugin loaded by SDK
-The config for the plugin to use
-The current App Insights core to use for initializing this plugin instance
-The complete set of extensions to be used for initializing the plugin
-OptionalpluginChain: ITelemetryPluginChain[Optional] specifies the current plugin chain which identifies the -set of plugins and the order they should be executed for the current request.
-OptionalisReturns a value that indicates whether the plugin has already been previously initialized. -New plugins should implement this method to avoid being initialized more than once.
-ReadonlypriorityPriority of the extension
-Call back for telemetry processing before it it is sent
-This is the current event being reported
-OptionalitemCtx: IProcessTelemetryContextThis is the context for the current request, ITelemetryPlugin instances -can optionally use this to access the current core instance or define / pass additional information -to later plugins (vs appending items to the telemetry item)
-OptionalsetSet next extension for telemetry processing, this is not optional as plugins should use the -processNext() function of the passed IProcessTelemetryContext instead. It is being kept for -now for backward compatibility only.
-OptionalteardownTear down the plugin and remove any hooked value, the plugin should be removed so that it is no longer initialized and -therefore could be re-initialized after being torn down. The plugin should ensure that once this has been called any further -processTelemetry calls are ignored and it just calls the processNext() with the provided context.
-This is the context that should be used during unloading.
-OptionalunloadState: ITelemetryUnloadStateThe details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.
-boolean - true if the plugin has or will call processNext(), this for backward compatibility as previously teardown was synchronous and returned nothing.
-OptionalupdateThe the plugin should re-evaluate configuration and update any cached configuration settings or -plugins. If implemented this method will be called whenever a plugin is added or removed and if -the configuration has bee updated.
-This is the context that should be used during updating.
-The details / state of the update process, it holds details like the current and previous configuration.
-boolean - true if the plugin has or will call updateCtx.processNext(), this allows the plugin to perform any asynchronous operations.
-Optional ReadonlyversionPlugin version (available in data.properties.version in common schema)
-Configuration provided to SDK core
-Returns the next plugin
-Returns the underlying plugin that is being proxied for the processTelemetry call
-Call back for telemetry processing before it it is sent
-This is the current event being reported
-OptionalitemCtx: IProcessTelemetryContextThis is the context for the current request, ITelemetryPlugin instances -can optionally use this to access the current core instance or define / pass additional information -to later plugins (vs appending items to the telemetry item)
-OptionalunloadThis plugin is being unloaded and should remove any hooked events and cleanup any global/scoped values, after this -call the plugin will be removed from the telemetry processing chain and will no longer receive any events..
-The unload context to use for this call.
-The details of the unload operation
-OptionalupdateThe the plugin should re-evaluate configuration and update any cached configuration settings or -plugins. If implemented this method will be called whenever a plugin is added or removed and if -the configuration has bee updated.
-This is the context that should be used during updating.
-The details / state of the update process, it holds details like the current and previous configuration.
-boolean - true if the plugin has or will call updateCtx.processNext(), this allows the plugin to perform any asynchronous operations.
-OptionaladdedThis holds a collection of plugins that have been added (if the reason identifies that one or more plugins have been added)
-OptionalcfgThis is a new active configuration that should be used
-OptionalmergeWas the new config requested to be merged with the existing config
-OptionalnewIf this is a configuration update this was the previous configuration that was used
-OptionaloldThe detected changes
-Identifies the reason for the update notification, this is a bitwise numeric value
-OptionalremovedThis holds a collection of plugins that have been removed (if the reason identifies that one or more plugins have been removed)
-This interface represents the components of a W3C traceparent header
-This is the ID of the current request as known by the caller (in some tracing systems, this is also -known as the parent-id, where a span is the execution of a client request). It is represented as an -16-character string of lowercase hexadecimal characters, for example, 00f067aa0ba902b7. -All bytes as zero (0000000000000000) is considered an invalid value.
-An 8-bit value of flags that controls tracing such as sampling, trace level, etc. These flags are -recommendations given by the caller rather than strict rules to follow. -As this is a bit field, you cannot interpret flags by decoding the hex value and looking at the resulting -number. For example, a flag 00000001 could be encoded as 01 in hex, or 09 in hex if present with the flag -00001000. A common mistake in bit fields is forgetting to mask when interpreting flags.
-This is the ID of the whole trace forest and is used to uniquely identify a distributed trace -through a system. It is represented as a 32-character string of lowercase hexadecimal characters, -for example, 4bf92f3577b34da6a3ce929d0e0e4736. -All characters as zero (00000000000000000000000000000000) is considered an invalid value.
-The version of the definition, this MUST be a string with a length of 2 and only contain lowercase -hexadecimal characters. A value of 'ff' is considered to be an invalid version.
-Interface which identifiesAdd this hook so that it is automatically removed during unloading
-Optional_doTeardown / Unload hook to allow implementations to perform some additional unload operations before the BaseTelemetryPlugin -finishes it's removal.
-OptionalunloadCtx: IProcessTelemetryUnloadContextThis is the context that should be used during unloading.
-OptionalunloadState: ITelemetryUnloadStateThe details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.
-OptionalasyncCallback: (() => void)An optional callback that the plugin must call if it returns true to inform the caller that it has completed any async unload/teardown operations.
-boolean - true if the plugin has or will call asyncCallback, this allows the plugin to perform any asynchronous operations.
-The current config object
-Set this named property of the target as read-only, which will block this single named property from -ever being changed for the target instance. -This does NOT freeze or seal the instance, it just stops the direct re-assignment of the named property, -if the value is a non-primitive (ie. an object or array) it's properties will still be mutable.
-Set this named property of the target as referenced, which will cause any object or array instance -to be updated in-place rather than being entirely replaced. All other values will continue to be replaced.
-Set the value against the provided config/name with the value, the property -will be converted to be dynamic (if not already) as long as the provided config -is already a tracked dynamic object.
-Set default values for the config if not present.
-The configuration object to set default on (if missing)
-The default values to apply to the config
-An interface which provides automatic removal during unloading of the component
-ReadonlyresponseOptionaluseCapture: booleanOptionaluseCapture: booleanOptionaluseCapture: booleanRemoves the event listener in target's event listener list with the same type, callback, and options.
-Removes the event listener in target's event listener list with the same type, callback, and options.
-Optionaloptions: boolean | EventListenerOptionsThe IXHROverride interface overrides the way HTTP requests are sent.
-ConstConstThe eBatchDiscardedReason enumeration contains a set of values that specify the reason for discarding offline batches.
-ConstThe EventsDiscardedReason enumeration contains a set of values that specify the reason for discarding an event.
-ConstConstConstConstConstConstConstProtected Optional_doTeardown / Unload hook to allow implementations to perform some additional unload operations before the BaseTelemetryPlugin -finishes it's removal.
-OptionalunloadCtx: IProcessTelemetryUnloadContextThis is the context that should be used during unloading.
-OptionalunloadState: ITelemetryUnloadStateThe details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.
-OptionalasyncCallback: (() => void)An optional callback that the plugin must call if it returns true to inform the caller that it has completed any async unload/teardown operations.
-boolean - true if the plugin has or will call asyncCallback, this allows the plugin to perform any asynchronous operations.
-Protected Optional_doExtension hook to allow implementations to perform some additional update operations before the BaseTelemetryPlugin finishes it's removal
-OptionalupdateCtx: IProcessTelemetryUpdateContextThis is the context that should be used during updating.
-OptionalupdateState: ITelemetryUpdateStateThe details / state of the update process, it holds details like the current and previous configuration.
-OptionalasyncCallback: (() => void)An optional callback that the plugin must call if it returns true to inform the caller that it has completed any async update operations.
-boolean - true if the plugin has or will call asyncCallback, this allows the plugin to perform any asynchronous operations.
-Protected_getHelper to return the current IProcessTelemetryContext, if the passed argument exists this just -returns that value (helps with minification for callers), otherwise it will return the configured -context or a temporary one.
-OptionalcurrentCtx: IProcessTelemetryContext[Optional] The current execution context
-Protected Readonly_unloadExposes the underlying unload hook container instance for this extension to allow it to be passed down to any sub components of the class. -This should NEVER be exposed or called publically as it's scope is for internal use by BaseTelemetryPlugin and any derived class (which is why -it's scoped as protected)
-Holds the core instance that was used during initialization
-Returns the current diagnostic logger that can be used to log issues, if no logger is currently -assigned a new default one will be created and returned.
-StaticidentifierReturns whether the plugin has been initialized
-Priority of the extension
-Call back for telemetry processing before it it is sent
-This is the current event being reported
-This is the context for the current request, ITelemetryPlugin instances -can optionally use this to access the current core instance or define / pass additional information -to later plugins (vs appending items to the telemetry item)
-ProtectedsetInternal helper to allow setting of the internal initialized setting for inherited instances and unit testing
-Set next extension for telemetry processing
-OptionalversionPlugin version (available in data.properties.version in common schema)
-Protected_addAdd this hook so that it is automatically removed during unloading
-The single hook or an array of IInstrumentHook objects
-Protected_addTear down the plugin and remove any hooked value, the plugin should be removed so that it is no longer initialized and -therefore could be re-initialized after being torn down. The plugin should ensure that once this has been called any further -processTelemetry calls are ignored and it just calls the processNext() with the provided context.
-OptionalunloadCtx: IProcessTelemetryUnloadContextThis is the context that should be used during unloading.
-OptionalunloadState: ITelemetryUnloadStateThe details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.
-boolean - true if the plugin has or will call processNext(), this for backward compatibility as previously teardown was synchronous and returned nothing.
-The the plugin should re-evaluate configuration and update any cached configuration settings.
-This is the context that should be used during updating.
-The details / state of the update process, it holds details like the current and previous configuration.
-boolean - true if the plugin has or will call updateCtx.processNext(), this allows the plugin to perform any asynchronous operations.
-Protected Optional_doTeardown / Unload hook to allow implementations to perform some additional unload operations before the BaseTelemetryPlugin -finishes it's removal.
-OptionalunloadCtx: IProcessTelemetryUnloadContextThis is the context that should be used during unloading.
-OptionalunloadState: ITelemetryUnloadStateThe details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.
-OptionalasyncCallback: (() => void)An optional callback that the plugin must call if it returns true to inform the caller that it has completed any async unload/teardown operations.
-boolean - true if the plugin has or will call asyncCallback, this allows the plugin to perform any asynchronous operations.
-Protected Optional_doExtension hook to allow implementations to perform some additional update operations before the BaseTelemetryPlugin finishes it's removal
-OptionalupdateCtx: IProcessTelemetryUpdateContextThis is the context that should be used during updating.
-OptionalupdateState: ITelemetryUpdateStateThe details / state of the update process, it holds details like the current and previous configuration.
-OptionalasyncCallback: (() => void)An optional callback that the plugin must call if it returns true to inform the caller that it has completed any async update operations.
-boolean - true if the plugin has or will call asyncCallback, this allows the plugin to perform any asynchronous operations.
-Protected_getHelper to return the current IProcessTelemetryContext, if the passed argument exists this just -returns that value (helps with minification for callers), otherwise it will return the configured -context or a temporary one.
-OptionalcurrentCtx: IProcessTelemetryContext[Optional] The current execution context
-Protected Readonly_unloadExposes the underlying unload hook container instance for this extension to allow it to be passed down to any sub components of the class. -This should NEVER be exposed or called publically as it's scope is for internal use by BaseTelemetryPlugin and any derived class (which is why -it's scoped as protected)
-Holds the core instance that was used during initialization
-Returns the current diagnostic logger that can be used to log issues, if no logger is currently -assigned a new default one will be created and returned.
-StaticidentifierReturns whether the plugin has been initialized
-Call back for telemetry processing before it it is sent
-This is the current event being reported
-This is the context for the current request, ITelemetryPlugin instances -can optionally use this to access the current core instance or define / pass additional information -to later plugins (vs appending items to the telemetry item)
-ProtectedsetInternal helper to allow setting of the internal initialized setting for inherited instances and unit testing
-Set next extension for telemetry processing
-OptionalversionPlugin version (available in data.properties.version in common schema)
-Protected_addAdd this hook so that it is automatically removed during unloading
-The single hook or an array of IInstrumentHook objects
-Protected_addAdd an dependency telemetry initializer callback function to allow populating additional properties or drop the request.
-It is called after the dependency call has completed and any available performance details are available. A dependency
-initializer is similar to the TelemetryInitializer function but it allows you to block the reporting of the dependency
-request so that it doesn't count against the maxAjaxCallsPerView.
The Dependency Telemetry Initializer function
-Add an ajax listener which is called just prior to the request being sent and before the correlation headers are added, to allow you -to access the headers and modify the values used to generate the distributed tracing correlation headers.
-The Telemetry Initializer function
-Optionalinput: string | RequestOptionalinit: RequestInitOptionalxhr: XMLHttpRequestInstrumentedTear down the plugin and remove any hooked value, the plugin should be removed so that it is no longer initialized and -therefore could be re-initialized after being torn down. The plugin should ensure that once this has been called any further -processTelemetry calls are ignored and it just calls the processNext() with the provided context.
-OptionalunloadCtx: IProcessTelemetryUnloadContextThis is the context that should be used during unloading.
-OptionalunloadState: ITelemetryUnloadStateThe details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.
-boolean - true if the plugin has or will call processNext(), this for backward compatibility as previously teardown was synchronous and returned nothing.
-ProtectedtrackProtected function to allow sub classes the chance to add additional properties to the dependency event -before it's sent. This function calls track, so sub-classes must call this function after they have -populated their properties.
-Optionalproperties: { OptionalsystemProperties: { The the plugin should re-evaluate configuration and update any cached configuration settings.
-This is the context that should be used during updating.
-The details / state of the update process, it holds details like the current and previous configuration.
-boolean - true if the plugin has or will call updateCtx.processNext(), this allows the plugin to perform any asynchronous operations.
-OptionaltraceCtx: IDistributedTraceContextOptionalasyncOptionalcontextThe listener assigned context values that will be passed to any dependency initializer
-OptionalerrorThe trace context to use for reporting the remote dependency call
-OptionalperfThe spanId to use for the dependency call
-OptionaltraceThe traceFlags to use for the dependency call
-The traceId to use for the dependency call
-Add an ajax listener which is called just prior to the request being sent and before the correlation headers are added, to allow you -to access the headers and modify the values used to generate the distributed tracing correlation headers. (added in v2.8.4)
-The Telemetry Initializer function
-Optionalaborted[Optional] A flag that indicates whether the client request was manually aborted by the abort()
OptionalcontextThe context that the application can assigned via the dependency listener(s)
-The DependencyTelemetry event that will be passed to the trackDependencyDataInternal function.
OptionalpropertiesAdditional properties to be added to the event
-OptionalsysAdditional system properties to be added to the event.
-Optionalaborted[Optional] A flag that indicates whether the client request was manually aborted by the abort(),
-as listeners are called just before the request is sent it is unlikely that an application would have
-called abort before send this is also available in the dependency initializer.
Optionalcontext[Optional] Context that the application can assign that will also be passed to any dependency initializer
-The current core instance
-OptionalinitProvided only if the dependency request is a fetch call, this is the init argument being used, -re-assigning this value does not change the value used for the request, however, changing properties -of this object will be used.
-OptionalinputProvided only if the dependency request is a fetch call, this is the input argument being used, -re-assigning this value has not affect on the value used for the request, however, when this is a Request -object changing the value of the Request will be used for the outbound request.
-OptionalspanSelf-generated 8-bytes identifier of the incoming request. Must be a hex representation of 8-byte array. -Also know as the parentId, used to link requests together
-OptionaltraceAn integer representation of the W3C TraceContext trace-flags. -https://www.w3.org/TR/trace-context/#trace-flags
-OptionaltraceReturns the unique identifier for a trace. All requests / spans from the same trace share the same traceId. -Must be read from incoming headers or generated according to the W3C TraceContext specification, -in a hex representation of 16-byte array. A.k.a. trace-id, TraceID or Distributed TraceID
-OptionalxhrProvided only if the dependency request is an XHR call
-Add an ajax listener which is called just prior to the request being sent and before the correlation headers are added, to allow you -to access the headers and modify the values used to generate the distributed tracing correlation headers. (added in v2.8.4)
-The Telemetry Initializer function
-ReadonlyDONEReadonlyHEADERS_ReadonlyLOADINGReadonlyOPENEDReadonlyUNSENTReadonlyreadyReturns client's state.
-ReadonlyresponseReturns the response body.
-ReadonlyresponseReturns response as text.
-Throws an "InvalidStateError" DOMException if responseType is not the empty string or "text".
-Returns the response type.
-Can be set to change the response type. Values are: the empty string (default), "arraybuffer", "blob", "document", "json", and "text".
-When set: setting to "document" is ignored if current global object is not a Window object.
-When set: throws an "InvalidStateError" DOMException if state is loading or done.
-When set: throws an "InvalidAccessError" DOMException if the synchronous flag is set and current global object is a Window object.
-ReadonlyresponseURLReadonlyresponseXMLReturns the response as document.
-Throws an "InvalidStateError" DOMException if responseType is not the empty string or "document".
-ReadonlystatusReadonlystatusCan be set to a time in milliseconds. When set to a non-zero value will cause fetching to terminate after the given time has passed. When the time has passed, the request has not yet completed, and this's synchronous flag is unset, a timeout event will then be dispatched, or a "TimeoutError" DOMException will be thrown otherwise (for the send() method).
-When set: throws an "InvalidAccessError" DOMException if the synchronous flag is set and current global object is a Window object.
-ReadonlyuploadReturns the associated XMLHttpRequestUpload object. It can be used to gather transmission information when data is transferred to a server.
-True when credentials are to be included in a cross-origin request. False when they are to be excluded in a cross-origin request and when cookies are to be ignored in its response. Initially false.
-When set: throws an "InvalidStateError" DOMException if state is not unsent or opened, or if the send() flag is set.
-Optionaloptions: boolean | AddEventListenerOptionsSets the request method, request URL, and synchronous flag.
-Throws a "SyntaxError" DOMException if either method is not a valid method or url cannot be parsed.
-Throws a "SecurityError" DOMException if method is a case-insensitive match for CONNECT, TRACE, or TRACK.
Throws an "InvalidAccessError" DOMException if async is false, current global object is a Window object, and the timeout attribute is not zero or the responseType attribute is not the empty string.
-Optionalusername: stringOptionalpassword: stringOptionaloptions: boolean | EventListenerOptionsInitiates the request. The body argument provides the request body, if any, and is ignored if the request method is GET or HEAD.
-Throws an "InvalidStateError" DOMException if either state is not opened or the send() flag is set.
-Optionalbody: Document | XMLHttpRequestBodyInitCombines a header in author request headers.
-Throws an "InvalidStateError" DOMException if either state is not opened or the send() flag is set.
-Throws a "SyntaxError" DOMException if name is not a header name or if value is not a header value.
-ConstAn internal interface which defines a in memory batch
-Optionalevts: IPostTransmissionTelemetryItem[]OptionalevtsLimitInMem: numberEnqueue the payload
-create current buffer to a new endpoint
-if not defined, current endpoint will be used
-Optionalevts: IPostTransmissionTelemetryItem[] | ITelemetryItem[]new events to be added
-OptionalevtsLimitInMem: numberReturns items stored in the buffer
-Split this batch into 2 with any events > fromEvent returned in the new batch and all other -events are kept in the current batch.
-The first event to remove from the current batch.
-OptionalnumEvts: numberThe number of events to be removed from the current batch and returned in the new one. Defaults to all trailing events
-Class that implements storing of events using the WebStorage Api ((window||globalThis||self).localstorage, (window||globalThis||self).sessionStorage).
-Creates a WebStorageProvider using the provider storageType
-Optionalid: stringOptionalunloadHookContainer: IUnloadHookContainerStores the value into the storage using the specified key.
-The key value to use for the value
-The actual event of the request
-This is the context for the current request, ITelemetryPlugin instances -can optionally use this to access the current core instance or define / pass additional information -to later plugins (vs appending items to the telemetry item)
-Removes all entries from the storage provider, if there are any.
-Optionaldisable: booleanGet all of the currently cached events from the storage mechanism
-Optionalcnt: numberGet all of the currently cached events from the storage mechanism
-Initializes the provider using the config
-The provider context that should be used to initialize the provider
-True if the provider is initialized and available for use otherwise false
-Removes the value associated with the provided key
-The events to be removed
-Optionallogger: IDiagnosticLoggerOptionalunloadHookContainer: IUnloadHookContainerOptionalcb: ((res: IOfflineBatchCleanResponse) => void)Initializes the provider using the config
-True if the provider is initialized and available for use otherwise false
-Optionalcb: OfflineBatchCallbackOptionalsync: booleanOptionalxhrOverride: IXHROverrideOptionalcnt: numberOptionalcb: OfflineBatchStoreCallbackOptionalsync: booleanProtected Optional_doTeardown / Unload hook to allow implementations to perform some additional unload operations before the BaseTelemetryPlugin -finishes it's removal.
-OptionalunloadCtx: IProcessTelemetryUnloadContextThis is the context that should be used during unloading.
-OptionalunloadState: ITelemetryUnloadStateThe details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.
-OptionalasyncCallback: (() => void)An optional callback that the plugin must call if it returns true to inform the caller that it has completed any async unload/teardown operations.
-boolean - true if the plugin has or will call asyncCallback, this allows the plugin to perform any asynchronous operations.
-Protected Optional_doExtension hook to allow implementations to perform some additional update operations before the BaseTelemetryPlugin finishes it's removal
-OptionalupdateCtx: IProcessTelemetryUpdateContextThis is the context that should be used during updating.
-OptionalupdateState: ITelemetryUpdateStateThe details / state of the update process, it holds details like the current and previous configuration.
-OptionalasyncCallback: (() => void)An optional callback that the plugin must call if it returns true to inform the caller that it has completed any async update operations.
-boolean - true if the plugin has or will call asyncCallback, this allows the plugin to perform any asynchronous operations.
-Protected_getHelper to return the current IProcessTelemetryContext, if the passed argument exists this just -returns that value (helps with minification for callers), otherwise it will return the configured -context or a temporary one.
-OptionalcurrentCtx: IProcessTelemetryContext[Optional] The current execution context
-Protected Readonly_unloadExposes the underlying unload hook container instance for this extension to allow it to be passed down to any sub components of the class. -This should NEVER be exposed or called publically as it's scope is for internal use by BaseTelemetryPlugin and any derived class (which is why -it's scoped as protected)
-Holds the core instance that was used during initialization
-Returns the current diagnostic logger that can be used to log issues, if no logger is currently -assigned a new default one will be created and returned.
-Returns whether the plugin has been initialized
-Call back for telemetry processing before it it is sent
-This is the current event being reported
-This is the context for the current request, ITelemetryPlugin instances -can optionally use this to access the current core instance or define / pass additional information -to later plugins (vs appending items to the telemetry item)
-ProtectedsetInternal helper to allow setting of the internal initialized setting for inherited instances and unit testing
-Set next extension for telemetry processing
-Protected_addAdd this hook so that it is automatically removed during unloading
-The single hook or an array of IInstrumentHook objects
-Protected_addNo op
-OptionalcallBack: ((flushComplete?: boolean) => void)OptionalflushComplete: booleanOptionalsendReason: SendRequestReasonThe function does the initial set up. It adds a notification listener to determine which events to remove.
-The core configuration.
-The AppInsights core.
-An array of all the plugins being used.
-OptionalpluginChain: ITelemetryPluginChainProcess an event to add it to the local storage and then pass it to the next plugin.
-OptionalitemCtx: IProcessTelemetryContextThis is the context for the current request, ITelemetryPlugin instances -can optionally use this to access the current core instance or define / pass additional information -to later plugins (vs appending items to the telemetry item)
-Tear down the plugin and remove any hooked value, the plugin should be removed so that it is no longer initialized and -therefore could be re-initialized after being torn down. The plugin should ensure that once this has been called any further -processTelemetry calls are ignored and it just calls the processNext() with the provided context.
-OptionalunloadCtx: IProcessTelemetryUnloadContextThis is the context that should be used during unloading.
-OptionalunloadState: ITelemetryUnloadStateThe details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.
-boolean - true if the plugin has or will call processNext(), this for backward compatibility as previously teardown was synchronous and returned nothing.
-The the plugin should re-evaluate configuration and update any cached configuration settings.
-This is the context that should be used during updating.
-The details / state of the update process, it holds details like the current and previous configuration.
-boolean - true if the plugin has or will call updateCtx.processNext(), this allows the plugin to perform any asynchronous operations.
-Pause the sending (transmission) of events, this will cause all events to be batched only until the maximum limits are -hit at which point new events are dropped. Will also cause events to NOT be sent during page unload, so if Session storage -is disabled events will be lost.
-Trigger the immediate send of buffered data; If executing asynchronously (the default) this may (not required) return
-an IPromise that will resolve once the
-send is complete. The actual implementation of the IPromise will be a native Promise (if supported) or the default
-as supplied by ts-async library
Indicates if the events should be sent asynchronously
-OptionalforcedSender: SenderFunction{SenderFunction} - Indicates the forcedSender, undefined if not passed
-OptionalsendReason: SendRequestReasonClass that implements storing of events using the WebStorage Api ((window||globalThis||self).localstorage, (window||globalThis||self).sessionStorage).
-Creates a WebStorageProvider using the provider storageType
-The type of Storage provider, normal values are "localStorage" or "sessionStorage"
-Optionalid: stringOptionalunloadHookContainer: IUnloadHookContainerStores the value into the storage using the specified key.
-The key value to use for the value
-The actual event of the request
-This is the context for the current request, ITelemetryPlugin instances -can optionally use this to access the current core instance or define / pass additional information -to later plugins (vs appending items to the telemetry item)
-Removes all entries from the storage provider, if there are any.
-Get all of the currently cached events from the storage mechanism
-Optionalcnt: numberGet the Next one cached batch from the storage mechanism
-Initializes the provider using the config
-The provider context that should be used to initialize the provider
-True if the provider is initialized and available for use otherwise false
-Removes the value associated with the provided key
-The events to be removed
-ConstIdentifies the Storage Providers used by the LocalStorageChannel
-Identifies that the provider that uses (window||globalThis||self).indexedDB
-Identifies that the provider that uses (window||globalThis||self).localStorage
-Identifies that the provider that uses (window||globalThis||self).sessionStorage
-ConstAn internal interface which defines a in memory batch
-Enqueue the payload
-Returns the number of elements in the buffer
-Returns items stored in the buffer
-Split this batch into 2 with any events > fromEvent returned in the new batch and all other -events are kept in the current batch.
-The first event to remove from the current batch.
-OptionalnumEvts: numberThe number of events to be removed from the current batch and returned in the new one. Defaults to all trailing events
-create current buffer to a new endpoint with current logger
-new endpoint
-Optionalevts: IPostTransmissionTelemetryItem[] | ITelemetryItem[]new events to be added
-OptionalevtsLimitInMem: numbernew evtsLimitInMem
-An internal interface which defines a common provider context that is used to pass multiple values when initializing provider instances
-OptionalendpointIdentifies endpoint url.
-OptionalidIdentifies the unique identifier to be used for this provider instance, when not provided a new Guid will be generated for this instance. -This value must be unique across all instances to avoid polluting events between browser / tabs instances as they may share the same persistent storage. -The primary use case for setting this value is for unit testing.
-OptionalitemIdentifies the context for the current event
-OptionalnotificationIdentifies Notification Manager
-Identifies the local storage config that should be used to initialize the provider
-Optionalcb: ((res: IOfflineBatchCleanResponse) => void)Optionalcb: OfflineBatchCallbackOptionalsync: booleanOptionalxhrOverride: IXHROverrideOptionalcnt: numberOptionalcb: OfflineBatchStoreCallbackOptionalsync: booleanThe IOfflineChannelConfiguration interface defines the configuration options for offline channel, -supports offline events storage, retrieval and re-sending.
-OptionalEventsIdentifies the maximum event batch count when cleaning or releasing space for persistent storage per time. -default 10
-Optionalauto[Optional] Identifies if events that have existed in storage longer than the maximum allowed time (configured in inStorageMaxTime) should be cleaned after connection with storage. -If not provided, default is false
-Optionalevents[Optional] Identifies the maximum number of events to store in memory before sending to persistent storage.
-Optionalin[Optional] Identifies the maximum time in ms that items should be in memory before being saved into storage.
-Optionalin[Optional] Identifies the maximum time in ms that items should be in persistent storage. -default: 10080000 (around 2.8 hours) for versions <= 3.3.0 -default: 604800000 (around 7days) for versions > 3.3.0
-Optionalindexed[Optional] The IndexedDb database name that should be used when storing events using (window||globalThis||self).indexedDb.
-OptionalmaxIdentifies the maximum size per batch in bytes that is saved in persistent storage. -default 63000
-OptionalmaxIdentifies the maximum critical events count for an event batch to be able to drop when releasing space for persistent storage per time. -default 2
-Optionalmax[Optional] Identifies the maximum retry times for an event batch. -default: 1
-OptionalmaxIdentifies the interval time in ms that previously stored offline event batches should be sent under online status. -default 15000
-Optionalmax[Optional] The max size in bytes that should be used for storing events(default up to 5 Mb) in local/session storage. -The maximum size in bytes that should be used for storing events in storage If not specified, the system will use up to 5 MB
-Optionalmin[Optional] Identifies the minimum level that will be cached in the offline channel. Valid values of this -setting are defined by the EventPersistence enum, currently Normal (1) and Critical (2) with the default -value being Normal (1), which means all events without a persistence level set or with invalid persistence level will be marked as Normal(1) events.
-OptionaloverrideIdentifies overridden for the Instrumentation key when the offline channel calls processTelemetry.
-OptionalprimaryIdentifies online channel IDs in order. The first available one will be used. -default is [AppInsightsChannelPlugin, PostChannel]
-Optionalproviders[Optional] Identifies the StorageProviders that should be used by the system if available, the first available -provider will be used. Valid available values are defined by the eStorageProviders enum. Only the first 5 entries -are processed, so if this value contains more than 5 elements they will be ignored. -Note: LocalStorage will be used to save unload events even if it is not in the providers list -Default order is [StorageProviders.LocalStorage, StorageProviders.IndexedDB]
-OptionalsenderIdentifies offline sender properties. If not defined, settings will be the same as the online channel configured in primaryOnlineChannelId.
-Optionalstorage[Optional] The storage key prefix that should be used when storing events in persistent storage.
-Stores the value into the storage using the specified key.
-The key value to use for the value
-The actual event of the request
-This is the context for the current request, ITelemetryPlugin instances -can optionally use this to access the current core instance or define / pass additional information -to later plugins (vs appending items to the telemetry item)
-Either the added element (for synchronous operation) or a Promise for an asynchronous processing
-Removes all entries from the storage provider, if there are any.
-Either the removed item array (for synchronous operation) or a Promise for an asynchronous processing
-Get all stored batches from the storage.
-Optionalcnt: numberbatch numbers if it is defined, it will returns given number of batches. -if cnt is not defined, it will return all available batches
-Get Next batch from the storage
-Initializes the provider using the config
-The provider context that should be used to initialize the provider
-True if the provider is initialized and available for use otherwise false
-Removes the value associated with the provided key
-The events to be removed
-Either the removed item array (for synchronous operation) or a Promise for an asynchronous processing
-OptionalalwaysIdentifies if provided httpXhrOverride will always be used -default false
-OptionalhttpXHROverride[Optional] The HTTP override that should be used to send requests, as an IXHROverride object.
-OptionalretryIdentifies status codes for re-sending event batches -Default: [401, 403, 408, 429, 500, 502, 503, 504]
-Optionaltransports[Optional] Either an array or single value identifying the requested TransportType type(s) that should be used for sending events -If not defined, the same transports will be used in the channel with the primaryOnlineChannelId
-OptionalbaseBased on schema for part B
-OptionalbaseTelemetry type used for part B
-OptionaldataCustom data
-OptionalextSystem context properties of the telemetry item, example: ip address, city etc
-OptionaliIdentifier of the resource that uniquely identifies which resource data is sent to
-Unique name of the telemetry item
-Optionalpersistence[Optional] An EventPersistence value, that specifies the persistence for the event. The EventPersistence constant
-OptionaltagsSystem context property extensions that are not global (not in ctx)
-OptionaltimeTimestamp when item was sent
-OptionalverCommonSchema Version of this SDK
-An internal interface which defines a common storage item
-OptionalattempOptionalcriticalOptionaldisableOptionaldisableOptionalheadersOptionaliOptionalidOptionalisOptionalsendOptionalsyncOptionaltimeoutConstConstConstConstProtected Optional_doTeardown / Unload hook to allow implementations to perform some additional unload operations before the BaseTelemetryPlugin -finishes it's removal.
-OptionalunloadCtx: IProcessTelemetryUnloadContextThis is the context that should be used during unloading.
-OptionalunloadState: ITelemetryUnloadStateThe details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.
-OptionalasyncCallback: (() => void)An optional callback that the plugin must call if it returns true to inform the caller that it has completed any async unload/teardown operations.
-boolean - true if the plugin has or will call asyncCallback, this allows the plugin to perform any asynchronous operations.
-Protected Optional_doExtension hook to allow implementations to perform some additional update operations before the BaseTelemetryPlugin finishes it's removal
-OptionalupdateCtx: IProcessTelemetryUpdateContextThis is the context that should be used during updating.
-OptionalupdateState: ITelemetryUpdateStateThe details / state of the update process, it holds details like the current and previous configuration.
-OptionalasyncCallback: (() => void)An optional callback that the plugin must call if it returns true to inform the caller that it has completed any async update operations.
-boolean - true if the plugin has or will call asyncCallback, this allows the plugin to perform any asynchronous operations.
-Protected_getHelper to return the current IProcessTelemetryContext, if the passed argument exists this just -returns that value (helps with minification for callers), otherwise it will return the configured -context or a temporary one.
-OptionalcurrentCtx: IProcessTelemetryContext[Optional] The current execution context
-Protected Readonly_unloadExposes the underlying unload hook container instance for this extension to allow it to be passed down to any sub components of the class. -This should NEVER be exposed or called publically as it's scope is for internal use by BaseTelemetryPlugin and any derived class (which is why -it's scoped as protected)
-Holds the core instance that was used during initialization
-Returns the current diagnostic logger that can be used to log issues, if no logger is currently -assigned a new default one will be created and returned.
-Returns whether the plugin has been initialized
-Call back for telemetry processing before it it is sent
-This is the current event being reported
-This is the context for the current request, ITelemetryPlugin instances -can optionally use this to access the current core instance or define / pass additional information -to later plugins (vs appending items to the telemetry item)
-ProtectedsetInternal helper to allow setting of the internal initialized setting for inherited instances and unit testing
-Set next extension for telemetry processing
-Protected_addAdd this hook so that it is automatically removed during unloading
-The single hook or an array of IInstrumentHook objects
-Protected_addProcess the event and add it to an internal queue if handshake in process
-The event to process
-OptionalitemCtx: IProcessTelemetryContextThis is the context for the current request, ITelemetryPlugin instances -can optionally use this to access the current core instance or define / pass additional information -to later plugins (vs appending items to the telemetry item)
-Tear down the plugin and remove any hooked value, the plugin should be removed so that it is no longer initialized and -therefore could be re-initialized after being torn down. The plugin should ensure that once this has been called any further -processTelemetry calls are ignored and it just calls the processNext() with the provided context.
-OptionalunloadCtx: IProcessTelemetryUnloadContextThis is the context that should be used during unloading.
-OptionalunloadState: ITelemetryUnloadStateThe details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.
-boolean - true if the plugin has or will call processNext(), this for backward compatibility as previously teardown was synchronous and returned nothing.
-The the plugin should re-evaluate configuration and update any cached configuration settings.
-This is the context that should be used during updating.
-The details / state of the update process, it holds details like the current and previous configuration.
-boolean - true if the plugin has or will call updateCtx.processNext(), this allows the plugin to perform any asynchronous operations.
-Interface for OS Plugin SDK config -@maxTimeout: Maximum time to wait for the OS plugin to return the OS information -@mergeOsNameVersion: Whether to merge the OS name and version into one field
-Optionalconfig: IPerfMarkMeasureConfigurationOptionalmanager: INotificationManagerCreate a new event and start timing, the manager may return null/undefined to indicate that it does not -want to monitor this source event.
-The source name of the event
-Optionalpayload: anyOptionalisAsync: booleanIs the event occurring from a async event
-Complete the perfEvent and fire any notifications.
-Fire the event which will also complete the passed event
-Helper function to wrap a function with a perf event
-The Performance Manager or a Performance provider source (may be null)
-The callback to create the source name for the event (if perf monitoring is enabled)
-The function to call and measure
-OptionalperfEvt: IPerfEventOptionaldetails: (() => any)A function to return the payload details
-OptionalisAsync: booleanIs the event / function being call asynchronously or synchronously
-Class to manage sending notifications to all the listeners.
-Notification for events being discarded.
-The array of events that have been discarded by the SDK.
-The reason for which the SDK discarded the events. The EventsDiscardedReason -constant should be used to check the different values.
-Optionalevents[Optional] A function called when the events have been requested to be sent to the sever.
-The reason why the event batch is being sent.
-A flag which identifies whether the requests are being sent in an async or sync manner.
-OptionalofflineOptionalofflineOptionalofflineOptionalperf[Optional] This event is sent if you have enabled perf events, they are primarily used to track internal performance testing and debugging -the event can be displayed via the debug plugin extension.
-The perf event details
-OptionalunloadUnload and remove any state that this INotificationManager may be holding, this is generally called when the -owning SDK is being unloaded.
-OptionalisAsync: booleanCan the unload be performed asynchronously (default)
-If the unload occurs synchronously then nothing should be returned, if happening asynchronously then -the function should return an IPromise -/ Promise to allow any listeners to wait for the operation to complete.
-This interface identifies the details of an internal performance event - it does not represent an outgoing reported event
-OptionalchildThe child perf events that are contained within the total time of this event.
-Mark this event as completed, calculating the total execution time.
-OptionalexIdentifies the exclusive time spent in for this event (not including child events), -this will be undefined until the event is completed.
-OptionalgetGet the names additional context associated with this perf event
-Is this occurring from an asynchronous event
-Identifies whether this event is a child event of a parent
-The name of the performance event
-OptionalparentThe Parent event that was started before this event was created
-The payload (contents) of the perfEvent, may be null or only set after the event has completed depending on -the runtime environment.
-OptionalsetSet the named additional context to be associated with this perf event, this will replace any existing value
-The start time of the performance event
-OptionaltimeIdentifies the total inclusive time spent for this event, including the time spent for child events, -this will be undefined until the event is completed
-This defines an internal performance manager for tracking and reporting the internal performance of the SDK -- It does -not represent or report any event to the server.
-Create a new event and start timing, the manager may return null/undefined to indicate that it does not -want to monitor this source event.
-The source name of the event
-OptionalpayloadDetails: (() => any)An optional callback function to fetch the payload details for the event.
-OptionalisAsync: booleanIs the event occurring from a async event
-Complete the perfEvent and fire any notifications.
-Fire the event which will also complete the passed event
-Identifies an interface to a host that can provide an IPerfManager implementation
-Get the current performance manager
-Set the current performance manager
-The performance manager
-PerfMarkMeasure Configuration
-OptionalmarkIdentifies the prefix for the "end" mark of a perf event, defaults to "ai.prfmrk.end.", the event name is appended for the mark
-OptionalmarkProvides a mapping between the internal perf names and the value used to create the mark, -when a map is provided but no mapping is present that event will be ignored.
-OptionalmarkIdentifies the prefix for the mark, defaults to "ai.prfmrk.", the event name is appended for the mark
-OptionalmeasureProvides a mapping between the internal perf names and the value used to create the measure, -when no measureNameMap is provided this will default to using the markNameMap and -when a map is provided but no mapping is present that event will be ignored.
-OptionalmeasureIdentifies the prefix for the mark, defaults to "ai.prfmsr.", the event name is appended for the measure name
-OptionaluniqueMake the marks and measures unique by appending a numeric value to the prefix value, defaults to false. -Marks and measure for the same perfEvent will be assigned the same unique numeric value
-OptionaluseShould the Performance manager create a mark when the event is fired, defaults to false
-OptionaluseShould the Performance manager create and use window.performance.mark(), defaults to true
-OptionaluseShould the Performance manager create and use window.performance.measure(), defaults to true
-Protected Optional_doTeardown / Unload hook to allow implementations to perform some additional unload operations before the BaseTelemetryPlugin -finishes it's removal.
-OptionalunloadCtx: IProcessTelemetryUnloadContextThis is the context that should be used during unloading.
-OptionalunloadState: ITelemetryUnloadStateThe details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.
-OptionalasyncCallback: (() => void)An optional callback that the plugin must call if it returns true to inform the caller that it has completed any async unload/teardown operations.
-boolean - true if the plugin has or will call asyncCallback, this allows the plugin to perform any asynchronous operations.
-Protected Optional_doExtension hook to allow implementations to perform some additional update operations before the BaseTelemetryPlugin finishes it's removal
-OptionalupdateCtx: IProcessTelemetryUpdateContextThis is the context that should be used during updating.
-OptionalupdateState: ITelemetryUpdateStateThe details / state of the update process, it holds details like the current and previous configuration.
-OptionalasyncCallback: (() => void)An optional callback that the plugin must call if it returns true to inform the caller that it has completed any async update operations.
-boolean - true if the plugin has or will call asyncCallback, this allows the plugin to perform any asynchronous operations.
-Protected_getHelper to return the current IProcessTelemetryContext, if the passed argument exists this just -returns that value (helps with minification for callers), otherwise it will return the configured -context or a temporary one.
-OptionalcurrentCtx: IProcessTelemetryContext[Optional] The current execution context
-Protected Readonly_unloadExposes the underlying unload hook container instance for this extension to allow it to be passed down to any sub components of the class. -This should NEVER be exposed or called publically as it's scope is for internal use by BaseTelemetryPlugin and any derived class (which is why -it's scoped as protected)
-Holds the core instance that was used during initialization
-Returns the current diagnostic logger that can be used to log issues, if no logger is currently -assigned a new default one will be created and returned.
-Returns whether the plugin has been initialized
-Call back for telemetry processing before it it is sent
-This is the current event being reported
-This is the context for the current request, ITelemetryPlugin instances -can optionally use this to access the current core instance or define / pass additional information -to later plugins (vs appending items to the telemetry item)
-ProtectedsetInternal helper to allow setting of the internal initialized setting for inherited instances and unit testing
-Set next extension for telemetry processing
-OptionalversionPlugin version (available in data.properties.version in common schema)
-Protected_addAdd this hook so that it is automatically removed during unloading
-The single hook or an array of IInstrumentHook objects
-Protected_addTear down the plugin and remove any hooked value, the plugin should be removed so that it is no longer initialized and -therefore could be re-initialized after being torn down. The plugin should ensure that once this has been called any further -processTelemetry calls are ignored and it just calls the processNext() with the provided context.
-OptionalunloadCtx: IProcessTelemetryUnloadContextThis is the context that should be used during unloading.
-OptionalunloadState: ITelemetryUnloadStateThe details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.
-boolean - true if the plugin has or will call processNext(), this for backward compatibility as previously teardown was synchronous and returned nothing.
-The the plugin should re-evaluate configuration and update any cached configuration settings.
-This is the context that should be used during updating.
-The details / state of the update process, it holds details like the current and previous configuration.
-boolean - true if the plugin has or will call updateCtx.processNext(), this allows the plugin to perform any asynchronous operations.
-OptionalacquisitionThe date at which this guid was generated. -Per the spec the ID will be regenerated if more than acquisitionSpan milliseconds elapsed from this time.
-OptionalidThe session ID.
-OptionalrenewalThe date at which this session ID was last reported. -This value should be updated whenever telemetry is sent using this ID. -Per the spec the ID will be regenerated if more than renewalSpan milliseconds elapse from this time with no activity.
-Optionalcore: IAppInsightsCore<IConfiguration>OptionalunloadHookContainer: IUnloadHookContainerThe automatic Session which has been initialized from the automatic SDK cookies and storage
-OptionalpreviousTraceCtx: IDistributedTraceContextOptionalunloadHookContainer: IUnloadHookContainerapplication id obtained from breeze responses. Is used if appId is not specified by root config
-The object describing a component tracked by this object.
-The object describing a device tracked by this object.
-session id obtained from session manager.
-The object describing internal settings.
-The object describing a location tracked by this object.
-The object describing os details tracked by this object.
-The object describing a session tracked by this object.
-The session manager that manages the automatic session from the cookies
-The object describing a operation tracked by this object.
-The object describing a user tracked by this object.
-The object describing we details tracked by this object.
-Optionalid: stringOptionalparentId: stringOptionalname: stringOptionallogger: IDiagnosticLoggerName
-Parent id
-An integer representation of the W3C TraceContext trace-flags. https://www.w3.org/TR/trace-context/#trace-flags
-Trace id
-application id obtained from breeze responses. Is used if appId is not specified by root config
-ReadonlyapplicationThe object describing a component tracked by this object.
-ReadonlydeviceThe object describing a device tracked by this object.
-session id obtained from session manager.
-ReadonlyinternalThe object describing internal settings.
-ReadonlylocationThe object describing a location tracked by this object.
-Optional ReadonlyosThe object describing os details tracked by this object.
-ReadonlysessionThe object describing a session tracked by this object.
-ReadonlysessionThe session manager that manages the automatic session from the cookies
-ReadonlytelemetryThe object describing a operation tracked by this object.
-ReadonlyuserThe object describing a user tracked by this object.
-Optional ReadonlywebThe object describing we details tracked by this object.
-OptionalcookieOptional ReadonlygetOptional ReadonlyidOptional ReadonlynameOptional ReadonlysessionOptional ReadonlysessionOptional ReadonlysessionProtected Optional_doTeardown / Unload hook to allow implementations to perform some additional unload operations before the BaseTelemetryPlugin -finishes it's removal.
-OptionalunloadCtx: IProcessTelemetryUnloadContextThis is the context that should be used during unloading.
-OptionalunloadState: ITelemetryUnloadStateThe details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.
-OptionalasyncCallback: (() => void)An optional callback that the plugin must call if it returns true to inform the caller that it has completed any async unload/teardown operations.
-boolean - true if the plugin has or will call asyncCallback, this allows the plugin to perform any asynchronous operations.
-Protected Optional_doExtension hook to allow implementations to perform some additional update operations before the BaseTelemetryPlugin finishes it's removal
-OptionalupdateCtx: IProcessTelemetryUpdateContextThis is the context that should be used during updating.
-OptionalupdateState: ITelemetryUpdateStateThe details / state of the update process, it holds details like the current and previous configuration.
-OptionalasyncCallback: (() => void)An optional callback that the plugin must call if it returns true to inform the caller that it has completed any async update operations.
-boolean - true if the plugin has or will call asyncCallback, this allows the plugin to perform any asynchronous operations.
-Protected_getHelper to return the current IProcessTelemetryContext, if the passed argument exists this just -returns that value (helps with minification for callers), otherwise it will return the configured -context or a temporary one.
-OptionalcurrentCtx: IProcessTelemetryContext[Optional] The current execution context
-Protected Readonly_unloadExposes the underlying unload hook container instance for this extension to allow it to be passed down to any sub components of the class. -This should NEVER be exposed or called publically as it's scope is for internal use by BaseTelemetryPlugin and any derived class (which is why -it's scoped as protected)
-Holds the core instance that was used during initialization
-Returns the current diagnostic logger that can be used to log issues, if no logger is currently -assigned a new default one will be created and returned.
-ReadonlyidentifierReturns whether the plugin has been initialized
-ReadonlypriorityCall back for telemetry processing before it it is sent
-This is the current event being reported
-This is the context for the current request, ITelemetryPlugin instances -can optionally use this to access the current core instance or define / pass additional information -to later plugins (vs appending items to the telemetry item)
-ProtectedsetInternal helper to allow setting of the internal initialized setting for inherited instances and unit testing
-Set next extension for telemetry processing
-OptionalversionPlugin version (available in data.properties.version in common schema)
-Protected_addAdd this hook so that it is automatically removed during unloading
-The single hook or an array of IInstrumentHook objects
-Protected_addFlush any batched events immediately; Will not flush if the paused and channel should default to sending data asynchronously.
-If executing asynchronously and you DO NOT pass a callback function then a IPromise
-will be returned which will resolve once the flush is complete. The actual implementation of the IPromise
-will be a native Promise (if supported) or the default as supplied by ts-async library
if specified, notify caller when send is complete, the channel should return true to indicate to the caller that it will be called. -If the caller doesn't return true the caller should assume that it may never be called.
-OptionalflushComplete: booleanspecify the reason that you are calling "flush" defaults to ManualFlush (1) if not specified
-OptionalcbTimeout: numbertrue to indicate that callback will be called after the flush is complete otherwise the caller
-should assume that any provided callback will never be called, Nothing or if occurring asynchronously a
-IPromise which will be resolved once the unload is complete,
-the IPromise will only be returned when no callback is provided
-and isAsync is true.Pause the sending (transmission) of events, this will cause all events to be batched only until the maximum limits are -hit at which point new events are dropped. Will also cause events to NOT be sent during page unload, so if Session storage -is disabled events will be lost. -SessionStorage Limit is 2000 events, In-Memory (Array) Storage is 10,000 events (can be configured via the eventsLimitInMem).
-Tear down the plugin and remove any hooked value, the plugin should be removed so that it is no longer initialized and -therefore could be re-initialized after being torn down. The plugin should ensure that once this has been called any further -processTelemetry calls are ignored and it just calls the processNext() with the provided context.
-OptionalunloadCtx: IProcessTelemetryUnloadContextThis is the context that should be used during unloading.
-OptionalunloadState: ITelemetryUnloadStateThe details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.
-boolean - true if the plugin has or will call processNext(), this for backward compatibility as previously teardown was synchronous and returned nothing.
-The the plugin should re-evaluate configuration and update any cached configuration settings.
-This is the context that should be used during updating.
-The details / state of the update process, it holds details like the current and previous configuration.
-boolean - true if the plugin has or will call updateCtx.processNext(), this allows the plugin to perform any asynchronous operations.
-OptionalignoreBy default the TeeChannel will use the core configuration channels (starting at index 1 channels[1.xxx]) as separate tee'd channel chains
-for processing events. This configuration allow you to ignore any additional core channels and only use the teeChannels
-Defaults to false
OptionalteeChannel queues that is setup by caller in desired order. -If channels are provided here, core will ignore any channels that are already setup, example if there is a SKU with an initialized channel
-Function used to identify the get w parameter used to identify status bit to some channels
-Returns a value that indicates whether the instance has already been previously initialized.
-The current logger instance for this instance.
-ReadonlypluginThe formatted string of the installed plugins that contain a version number
-ReadonlypluginAn array of the installed plugins that provide a version
-Protected Optional_updateHook for Core extensions to allow them to update their own configuration before updating all of the plugins.
-The plugin update context
-The Update State
-boolean - True means the extension class will call updateState otherwise the Core will
-Watches and tracks status of initialization process
-ActiveStatus
-3.3.0 -If returned status is active, it means initialization process is completed. -If returned status is pending, it means the initialization process is waiting for promieses to be resolved. -If returned status is inactive, it means ikey is invalid or can 't get ikey or enpoint url from promsises.
-Adds a notification listener. The SDK calls methods on the listener when an appropriate notification is raised. -The added plugins must raise notifications. If the plugins do not implement the notifications, then no methods will be -called.
-An INotificationListener object.
-Add a new plugin to the installation
-The new plugin to add
-OptionalreplaceExisting: booleanshould any existing plugin be replaced, default is false
-OptionaldoAsync: booleanShould the add be performed asynchronously
-OptionaladdCb: ((added?: boolean) => void)[Optional] callback to call after the plugin has been added
-Optionaladded: booleanAdd a telemetry processor to decorate or drop telemetry events.
-The Telemetry Initializer function
-Add this hook so that it is automatically removed during unloading
-The single hook or an array of IInstrumentHook objects
-Flush and send any batched / cached data immediately
-OptionalisAsync: booleanOptionalcallBack: ((flushComplete?: boolean) => void)if specified, notify caller when send is complete, the channel should return true to indicate to the caller that it will be called. -If the caller doesn't return true the caller should assume that it may never be called.
-OptionalflushComplete: booleanOptionalsendReason: SendRequestReasonspecify the reason that you are calling "flush" defaults to ManualFlush (1) if not specified
-Find and return the (first) plugin with the specified identifier if present
-Watches and tracks changes for accesses to the current config, and if the accessed config changes the -handler will be recalled.
-A watcher handler instance that can be used to remove itself when being unloaded
-Enable the timer that checks the logger.queue for log messages to be flushed. -Note: Since 3.0.1 and 2.8.13 this is no longer an interval timer but is a normal -timer that is only started when this function is called and then subsequently -only if there are any logger.queue messages to be sent.
-OptionaleventName: stringProtectedreleaseUnload and Tear down the SDK and any initialized plugins, after calling this the SDK will be considered
-to be un-initialized and non-operational, re-initializing the SDK should only be attempted if the previous
-unload call return true stating that all plugins reported that they also unloaded, the recommended
-approach is to create a new instance and initialize that instance.
-This is due to possible unexpected side effects caused by plugins not supporting unload / teardown, unable
-to successfully remove any global references or they may just be completing the unload process asynchronously.
-If you pass isAsync as true (also the default) and DO NOT pass a callback function then an IPromise
-will be returned which will resolve once the unload is complete. The actual implementation of the IPromise
-will be a native Promise (if supported) or the default as supplied by ts-async library
OptionalisAsync: booleanCan the unload be performed asynchronously (default)
-OptionalunloadComplete: ((unloadState: ITelemetryUnloadState) => void)An optional callback that will be called once the unload has completed
-OptionalcbTimeout: numberAn optional timeout to wait for any flush operations to complete before proceeding with the -unload. Defaults to 5 seconds.
-Nothing or if occurring asynchronously a IPromise -which will be resolved once the unload is complete, the IPromise -will only be returned when no callback is provided and isAsync is true
-Update the configuration used and broadcast the changes to all loaded plugins
-The new configuration is apply
-OptionalmergeExisting: booleanShould the new configuration merge with the existing or just replace it. Default is to true.
-Creates an instance of ApplicationInsights.
-Add a new plugin to the installation
-The new plugin to add
-should any existing plugin be replaced
-Should the add be performed asynchronously
-OptionaladdCb: ((added?: boolean) => void)Optionaladded: booleanFind and return the (first) plugin with the specified identifier if present
-Watches and tracks changes for accesses to the current config, and if the accessed config changes the -handler will be recalled.
-A watcher handler instance that can be used to remove itself when being unloaded
-Send a manually constructed custom event
-Unload and Tear down the SDK and any initialized plugins, after calling this the SDK will be considered
-to be un-initialized and non-operational, re-initializing the SDK should only be attempted if the previous
-unload call return true stating that all plugins reported that they also unloaded, the recommended
-approach is to create a new instance and initialize that instance.
-This is due to possible unexpected side effects caused by plugins not supporting unload / teardown, unable
-to successfully remove any global references or they may just be completing the unload process asynchronously.
OptionalisAsync: booleanCan the unload be performed asynchronously (default)
-OptionalunloadComplete: ((unloadState: ITelemetryUnloadState) => void)An optional callback that will be called once the unload has completed
-OptionalcbTimeout: numberAn optional timeout to wait for any flush operations to complete before proceeding with the -unload. Defaults to 5 seconds.
-Nothing or if occurring asynchronously a IPromise -which will be resolved once the unload is complete, the IPromise -will only be returned when no callback is provided and isAsync is true
-Update the configuration used and broadcast the changes to all loaded plugins
-The new configuration is apply
-OptionalmergeExisting: booleanShould the new configuration merge with the existing or just replace it. Default is to merge.
-AppId of this component parsed from some backend response.
-A send buffer object
-Protected Optional_doTeardown / Unload hook to allow implementations to perform some additional unload operations before the BaseTelemetryPlugin -finishes it's removal.
-OptionalunloadCtx: IProcessTelemetryUnloadContextThis is the context that should be used during unloading.
-OptionalunloadState: ITelemetryUnloadStateThe details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.
-OptionalasyncCallback: (() => void)An optional callback that the plugin must call if it returns true to inform the caller that it has completed any async unload/teardown operations.
-boolean - true if the plugin has or will call asyncCallback, this allows the plugin to perform any asynchronous operations.
-Protected Optional_doExtension hook to allow implementations to perform some additional update operations before the BaseTelemetryPlugin finishes it's removal
-OptionalupdateCtx: IProcessTelemetryUpdateContextThis is the context that should be used during updating.
-OptionalupdateState: ITelemetryUpdateStateThe details / state of the update process, it holds details like the current and previous configuration.
-OptionalasyncCallback: (() => void)An optional callback that the plugin must call if it returns true to inform the caller that it has completed any async update operations.
-boolean - true if the plugin has or will call asyncCallback, this allows the plugin to perform any asynchronous operations.
-Protected_getHelper to return the current IProcessTelemetryContext, if the passed argument exists this just -returns that value (helps with minification for callers), otherwise it will return the configured -context or a temporary one.
-OptionalcurrentCtx: IProcessTelemetryContext[Optional] The current execution context
-Protected_sampleA method which will cause data to be send to the url
-Readonly_senderThe configuration for this sender instance
-Protected Readonly_unloadExposes the underlying unload hook container instance for this extension to allow it to be passed down to any sub components of the class. -This should NEVER be exposed or called publically as it's scope is for internal use by BaseTelemetryPlugin and any derived class (which is why -it's scoped as protected)
-Holds the core instance that was used during initialization
-Returns the current diagnostic logger that can be used to log issues, if no logger is currently -assigned a new default one will be created and returned.
-ReadonlyidentifierReturns whether the plugin has been initialized
-ReadonlypriorityCall back for telemetry processing before it it is sent
-This is the current event being reported
-This is the context for the current request, ITelemetryPlugin instances -can optionally use this to access the current core instance or define / pass additional information -to later plugins (vs appending items to the telemetry item)
-ProtectedsetInternal helper to allow setting of the internal initialized setting for inherited instances and unit testing
-Set next extension for telemetry processing
-OptionalversionPlugin version (available in data.properties.version in common schema)
-Protected_addAdd this hook so that it is automatically removed during unloading
-The single hook or an array of IInstrumentHook objects
-Protected_addStaticconstructOptionalconvertUndefined: anyFlush to send data immediately; channel should default to sending data asynchronously. If executing asynchronously (the default) and
-you DO NOT pass a callback function then a IPromise
-will be returned which will resolve once the flush is complete. The actual implementation of the IPromise
-will be a native Promise (if supported) or the default as supplied by ts-async library
Optionalasync: booleansend data asynchronously when true
-OptionalcallBack: ((flushComplete?: boolean) => void)if specified, notify caller when send is complete, the channel should return true to indicate to the caller that it will be called. -If the caller doesn't return true the caller should assume that it may never be called.
-OptionalflushComplete: booleantrue to indicate that callback will be called after the flush is complete otherwise the caller
-should assume that any provided callback will never be called, Nothing or if occurring asynchronously a
-IPromise which will be resolved once the unload is complete,
-the IPromise will only be returned when no callback is provided
-and async is true.OptionalpluginChain: ITelemetryPluginChainPause the sending (transmission) of events, this will cause all events to be batched only until the maximum limits are -hit at which point new events are dropped. Will also cause events to NOT be sent during page unload, so if Session storage -is disabled events will be lost. -SessionStorage Limit is 2000 events, In-Memory (Array) Storage is 10,000 events (can be configured via the eventsLimitInMem).
-OptionalitemCtx: IProcessTelemetryContextTear down the plugin and remove any hooked value, the plugin should be removed so that it is no longer initialized and -therefore could be re-initialized after being torn down. The plugin should ensure that once this has been called any further -processTelemetry calls are ignored and it just calls the processNext() with the provided context.
-OptionalunloadCtx: IProcessTelemetryUnloadContextThis is the context that should be used during unloading.
-OptionalunloadState: ITelemetryUnloadStateThe details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.
-boolean - true if the plugin has or will call processNext(), this for backward compatibility as previously teardown was synchronous and returned nothing.
-Trigger the immediate send of buffered data; If executing asynchronously (the default) this may (not required) return
-an IPromise that will resolve once the
-send is complete. The actual implementation of the IPromise will be a native Promise (if supported) or the default
-as supplied by ts-async library
Optionalasync: booleanIndicates if the events should be sent asynchronously
-OptionalforcedSender: SenderFunction{SenderFunction} - Indicates the forcedSender, undefined if not passed
-OptionalsendReason: SendRequestReasonThe the plugin should re-evaluate configuration and update any cached configuration settings.
-This is the context that should be used during updating.
-The details / state of the update process, it holds details like the current and previous configuration.
-boolean - true if the plugin has or will call updateCtx.processNext(), this allows the plugin to perform any asynchronous operations.
-ConstThe EventsDiscardedReason enumeration contains a set of values that specify the reason for discarding an event.
-A manual flush request was received
-Maximum batch size would be exceeded
-The Maximum number of events have already been queued
-Events are being sent based on the normal event schedule / timer.
-The Channel was resumed
-The event(s) being sent as a retry
-The SDK is unloading
-The event(s) being sent are sync events
-No specific reason was specified
-Unload event is being processed
-ConstConstDefines the level of severity for the event.
-Calls the provided callbackFn function once for each element in an array in ascending index order. It is not invoked for index properties
-that have been deleted or are uninitialized. And unlike the ES6 forEach() you CAN stop or break the iteration by returning -1 from the
-callbackFn function.
The range (number of elements) processed by arrForEach() is set before the first call to the callbackFn. Any elements added beyond the range
-or elements which as assigned to indexes already processed will not be visited by the callbackFn.
The array or array like object of elements to be searched.
-A synchronous function that accepts up to three arguments. arrForEach calls the callbackfn function one time for each element in the array.
OptionalthisArg: anyAn object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, null or undefined -the array will be used as the this value.
-arrForEach expects a synchronous function.
-arrForEach does not wait for promises. Make sure you are aware of the implications while using promises (or async functions) as forEach callback.
const items = ['item1', 'item2', 'item3'];
const copyItems = [];
// before using for loop
for (let i = 0; i < items.length; i++) {
copyItems.push(items[i]);
}
// before using forEach()
items.forEach((item) => {
copyItems.push(item);
});
// after
arrForEach(items, (item) => {
copyItems.push(item);
// May return -1 to abort the iteration
});
// Also supports input as an array like object
const items = { length: 3, 0: 'item1', 1: 'item2', 2: 'item3' };
-
-
-Checks if the provided value is null, undefined or contains the string value of "undefined".
-The value to check
-true if the value is null or undefined
isNullOrUndefined(null); // true
isNullOrUndefined(undefined); // true
isNullOrUndefined("undefined"); // true
let value = null;
isNullOrUndefined(value); // true
let value = undefined;
isNullOrUndefined(value); // true
isNullOrUndefined(""); // false
isNullOrUndefined(0); // false
isNullOrUndefined(new Date()); // false
isNullOrUndefined(true); // false
isNullOrUndefined(false); // false
-
-
-Creates proxy functions on the target which internally will call the source version with all arguments passed to the target method.
-The target object to be assigned with the source properties and functions
-The source object which will be assigned / called by setting / calling the targets proxies
-An array of function names that will be proxied on the target
-OptionaloverwriteTarget: booleanIf false this will not replace any pre-existing name otherwise (the default) it will overwrite any existing name
-OptionalactiveWatches and tracks status of initialization process
-ActiveStatus
-3.3.0 -If returned status is active, it means initialization process is completed. -If returned status is pending, it means the initialization process is waiting for promieses to be resolved. -If returned status is inactive, it means ikey is invalid or can 't get ikey or enpoint url from promsises.
-ReadonlyconfigFunction used to identify the get w parameter used to identify status bit to some channels
-OptionalisReturns a value that indicates whether the instance has already been previously initialized.
-ReadonlyloggerThe current logger instance for this instance.
-ReadonlypluginThe formatted string of the installed plugins that contain a version number
-ReadonlypluginAn array of the installed plugins that provide a version
-OptionaladdAdds a notification listener. The SDK calls methods on the listener when an appropriate notification is raised. -The added plugins must raise notifications. If the plugins do not implement the notifications, then no methods will be -called.
-An INotificationListener object.
-Add a new plugin to the installation
-The new plugin to add
-OptionalreplaceExisting: booleanshould any existing plugin be replaced, default is false
-OptionaldoAsync: booleanShould the add be performed asynchronously
-OptionaladdCb: ((added?: boolean) => void)[Optional] callback to call after the plugin has been added
-Optionaladded: booleanAdd a telemetry processor to decorate or drop telemetry events.
-The Telemetry Initializer function
-Add this hook so that it is automatically removed during unloading
-The single hook or an array of IInstrumentHook objects
-Flush and send any batched / cached data immediately
-OptionalisAsync: booleanOptionalcallBack: ((flushComplete?: boolean) => void)if specified, notify caller when send is complete, the channel should return true to indicate to the caller that it will be called. -If the caller doesn't return true the caller should assume that it may never be called.
-OptionalflushComplete: booleanOptionalsendReason: SendRequestReasonspecify the reason that you are calling "flush" defaults to ManualFlush (1) if not specified
-OptionalcbTimeout: numberAn optional timeout to wait for any flush operations to complete before proceeding with the unload. Defaults to 5 seconds.
-Find and return the (first) plugin with the specified identifier if present
-Watches and tracks changes for accesses to the current config, and if the accessed config changes the -handler will be recalled.
-A watcher handler instance that can be used to remove itself when being unloaded
-OptionalpollOptionalremoveOptionalstopUnload and Tear down the SDK and any initialized plugins, after calling this the SDK will be considered
-to be un-initialized and non-operational, re-initializing the SDK should only be attempted if the previous
-unload call return true stating that all plugins reported that they also unloaded, the recommended
-approach is to create a new instance and initialize that instance.
-This is due to possible unexpected side effects caused by plugins not supporting unload / teardown, unable
-to successfully remove any global references or they may just be completing the unload process asynchronously.
-If you pass isAsync as true (also the default) and DO NOT pass a callback function then an IPromise
-will be returned which will resolve once the unload is complete. The actual implementation of the IPromise
-will be a native Promise (if supported) or the default as supplied by ts-async library
OptionalisAsync: booleanCan the unload be performed asynchronously (default)
-OptionalunloadComplete: ((unloadState: ITelemetryUnloadState) => void)An optional callback that will be called once the unload has completed
-OptionalcbTimeout: numberAn optional timeout to wait for any flush operations to complete before proceeding with the -unload. Defaults to 5 seconds.
-Nothing or if occurring asynchronously a IPromise -which will be resolved once the unload is complete, the IPromise -will only be returned when no callback is provided and isAsync is true
-Update the configuration used and broadcast the changes to all loaded plugins, this does NOT support updating, adding or removing -any the plugins (extensions or channels). It will notify each plugin (if supported) that the configuration has changed but it will -not remove or add any new plugins, you need to call addPlugin or getPlugin(identifier).remove();
-The new configuration is apply
-OptionalmergeExisting: booleanShould the new configuration merge with the existing or just replace it. Default is to merge.
-Configuration provided to SDK core
-Optional ReadonlychannelsChannel queues that is setup by caller in desired order. -If channels are provided here, core will ignore any channels that are already setup, example if there is a SKU with an initialized channel
-OptionalconnectionConnection string of resource. Either this or instrumentationKey must be specified.
-Optionalcookie[Optional] A Cookie Manager configuration which includes hooks to allow interception of the get, set and delete cookie -operations. If this configuration is specified any specified enabled and domain properties will take precedence over the -cookieDomain and disableCookiesUsage values.
-OptionalcookieOptionalcookieOptionalcreate[Optional] Callback function that will be called to create a the IPerfManager instance when required and enablePerfMgr
-is enabled, this enables you to override the default creation of a PerfManager() without needing to setPerfMgr()
-after initialization.
OptionaldiagnosticSet the timer interval (in ms) for internal logging queue, this is the -amount of time to wait after logger.queue messages are detected to be sent. -Note: since 3.0.1 and 2.8.13 the diagnostic logger timer is a normal timeout timer -and not an interval timer. So this now represents the timer "delay" and not -the frequency at which the events are sent.
-Optionaldisable[Optional] A boolean that indicated whether to disable the use of cookies by the SDK. If true, the SDK will not store or -read any data from cookies. Cookie usage can be re-enabled after initialization via the core.getCookieMgr().enable().
-Optionaldisable[Optional] A flag for performance optimization to disable attempting to use the Chrome Debug Extension, if disabled and the extension is installed -this will not send any notifications.
-OptionaldisableOptionaldisable[Optional] An array of page show events that you would like to be ignored, special note there must be at lease one valid show event -hooked, if you list all or the runtime environment only supports a listed (disabled) event it will STILL be hooked, if required by the SDK. -Page Show events include "pageshow" and "visibilitychange" (with 'visible' state)
-Optionaldisable[Optional] An array of the page unload events that you would like to be ignored, special note there must be at least one valid unload -event hooked, if you list all or the runtime environment only supports a listed "disabled" event it will still be hooked, if required by the SDK. -Unload events include "beforeunload", "unload", "visibilitychange" (with 'hidden' state) and "pagehide"
-OptionalenableIf enabled, uncaught exceptions will be thrown to help with debugging
-Optionalenable[Optional] When enabled this will create local perfEvents based on sections of the code that have been instrumented -to emit perfEvents (via the doPerf()) when this is enabled. This can be used to identify performance issues within -the SDK, the way you are using it or optionally your own instrumented code. -The provided IPerfManager implementation does NOT send any additional telemetry events to the server it will only fire -the new perfEvent() on the INotificationManager which you can listen to. -This also does not use the window.performance API, so it will work in environments where this API is not supported.
-OptionalenableWParamAdd "&w=0" parameter to support UA Parsing when web-workers don't have access to Document. -Default is false
-OptionalendpointEndpoint where telemetry data is sent
-Optionalexp[Optional] Set additional configuration for exceptions, such as more scripts to include in the exception telemetry.
-OptionalextensionExtension configs loaded in SDK
-Optional ReadonlyextensionsAdditional plugins that should be loaded by core at runtime
-OptionalfeatureCustom optional value to opt in features
-Optionalid[Optional] Identifies the default length used to generate random session and user id's if non currently exists for the user / session. -Defaults to 22, previous default value was 5, if you need to keep the previous maximum length you should set this value to 5.
-OptionalinitIf your connection string, instrumentation key and endpoint url are promises, -this config is to manually set in memory proxy track calls count limit before promises finished. -Default: 100
-OptionalinitIf your connection string, instrumentation key and endpoint url are promises, -this config is to manually set timeout for those promises. -Default: 50000ms
-OptionalinstrumentationInstrumentation key of resource. Either this or connectionString must be specified.
-OptionalloggingConsole logging level. All logs with a severity level higher -than the configured level will be printed to console. Otherwise -they are suppressed. ie Level 2 will print both CRITICAL and -WARNING logs to console, level 1 prints only CRITICAL.
-Note: Logs sent as telemetry to instrumentation key will also -be logged to console if their severity meets the configured loggingConsoleLevel
-0: ALL console logging off -1: logs to console: severity >= CRITICAL -2: logs to console: severity >= WARNING
-OptionalloggingTelemtry logging level to instrumentation key. All logs with a severity -level higher than the configured level will sent as telemetry data to -the configured instrumentation key.
-0: ALL iKey logging off -1: logs to iKey: severity >= CRITICAL -2: logs to iKey: severity >= WARNING
-OptionalmaxMaximum number of iKey transmitted logging telemetry per page view
-Optionalperf[Optional] Fire every single performance event not just the top level root performance event. Defaults to false.
-OptionalstorageCustom optional value that will be added as a prefix for storage name.
-DependencyTelemetry telemetry interface
-OptionalcorrelationOptionaldataOptionaldurationOptionaliOptionalmeasurementsProperty bag to contain additional custom measurements (Part C)
-OptionalnameOptionalpropertiesProperty bag to contain additional custom properties (Part C)
-OptionalstartOptionalsuccessOptionaltargetOptionaltypeIdentifies whether the plugin is enabled and can process events. This is slightly different from isInitialized as the plugin may be initialized but disabled -via the setEnabled() or it may be a shared plugin which has had it's teardown function called from another instance..
-boolean = true if the plugin is in a state where it is operational.
-You can optionally enable / disable a plugin from processing events.
-Setting enabled to true will not necessarily cause the isEnabled() to also return true
-as the plugin must also have been successfully initialized and not had it's teardown method called
-(unless it's also been re-initialized)
OptionaliOptionalmaxOptionalmeasurementsProperty bag to contain additional custom measurements (Part C)
-OptionalminOptionalpropertiesProperty bag to contain additional custom properties (Part C)
-OptionalsampleOptionalstd(optional) The standard deviation measurement in the sample, Defaults to undefined which results in zero.
-OptionaldomDOM processing time in TimeSpan 'G' (general long) format: d:hh:mm:ss.fffffff
-OptionaldurationPerformance total in TimeSpan 'G' (general long) format: d:hh:mm:ss.fffffff". This represents the total page load time.
-OptionalmeasurementsProperty bag to contain additional custom measurements (Part C)
-Optionalnamename String - The name of the page. Defaults to the document title.
-OptionalnetworkSent request time in TimeSpan 'G' (general long) format: d:hh:mm:ss.fffffff
-OptionalperfPerformance total in TimeSpan 'G' (general long) format: d:hh:mm:ss.fffffff". This is total duration in timespan format.
-OptionalpropertiesProperty bag to contain additional custom properties (Part C)
-OptionalreceivedReceived response time in TimeSpan 'G' (general long) format: d:hh:mm:ss.fffffff.
-OptionalsentSent request time in TimeSpan 'G' (general long) format: d:hh:mm:ss.fffffff.
-Optionaluriurl String - a relative or absolute URL that identifies the page or other item. Defaults to the window location.
-Pageview telemetry interface
-OptionaliiKey String - custom defined iKey.
-OptionalisisLoggedIn - boolean is user logged in
-OptionalmeasurementsProperty bag to contain additional custom measurements (Part C)
-Optionalnamename String - The string you used as the name in startTrackPage. Defaults to the document title.
-OptionalpagepageType String - page type
-OptionalpropertiesProperty bag to contain additional custom properties (Part C)
-Optionalduration?: numberThe number of milliseconds it took to load the page. Defaults to undefined. If set to default value, page load time is calculated internally.
-OptionalrefrefUri String - the URL of the source page where current page is loaded from
-OptionalstartTime first page view is triggered
-Optionaluriuri String - a relative or absolute URL that identifies the page or other item. Defaults to the window location.
-OptionalcoreThe App Insights core to use for backward compatibility. -Therefore the interface will be able to access the core without needing to cast to "any". -[optional] any 3rd party plugins which are already implementing this interface don't fail to compile.
-ReadonlyidentifierExtension name
-Initialize plugin loaded by SDK
-The config for the plugin to use
-The current App Insights core to use for initializing this plugin instance
-The complete set of extensions to be used for initializing the plugin
-OptionalpluginChain: ITelemetryPluginChain[Optional] specifies the current plugin chain which identifies the -set of plugins and the order they should be executed for the current request.
-OptionalisReturns a value that indicates whether the plugin has already been previously initialized. -New plugins should implement this method to avoid being initialized more than once.
-OptionalteardownTear down the plugin and remove any hooked value, the plugin should be removed so that it is no longer initialized and -therefore could be re-initialized after being torn down. The plugin should ensure that once this has been called any further -processTelemetry calls are ignored and it just calls the processNext() with the provided context.
-This is the context that should be used during unloading.
-OptionalunloadState: ITelemetryUnloadStateThe details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.
-boolean - true if the plugin has or will call processNext(), this for backward compatibility as previously teardown was synchronous and returned nothing.
-Optional ReadonlyversionPlugin version (available in data.properties.version in common schema)
-Optionalalways[Optional] By default during unload (or when you specify to use sendBeacon() or sync fetch (with keep-alive) for an event) the SDK -ignores any provided httpXhrOverride and attempts to use sendBeacon() or fetch(with keep-alive) when they are available. -When this configuration option is true any provided httpXhrOverride will always be used, so any provided httpXhrOverride will -also need to "handle" the synchronous unload scenario.
-Specify the storage buffer type implementation.
-(Optional) Provide user an option to convert undefined field to user defined value.
-(Optional) The ability for the user to provide extra headers
-Optionaldisable[Optional] Disable events splitting during sendbeacon. -Default: false
-The master off switch. Do not send any data if set to TRUE
-Don't use XMLHttpRequest or XDomainRequest (for IE < 9) by default instead attempt to use fetch() or sendBeacon. -If no other transport is available it will still use XMLHttpRequest
-The JSON format (normal vs line delimited). True means line delimited JSON.
-Optionalenable(Optional) Enable the sender to return a promise so that manually flushing (and general sending) can wait for the request to finish. -Note: Enabling this may cause unhandled promise rejection errors to occur if you do not listen and handle any rejection response, -this should only be for manual flush attempts. -Defaults to false
-Store a copy of a send buffer in the session storage
-The url to which payloads will be sent
-(Optional) The number of events that can be kept in memory before the SDK starts to drop events. By default, this is 10,000.
-OptionalhttpXHROverride[Optional] The HTTP override that should be used to send requests, as an IXHROverride object. -By default during the unload of a page or if the event specifies that it wants to use sendBeacon() or sync fetch (with keep-alive), -this override will NOT be called. -If alwaysUseXhrOverride configuration value is set to true, the override will always be used. -The payload data (first argument) now also includes any configured 'timeout' (defaults to undefined) and whether you should avoid -creating any synchronous XHR requests 'disableXhr' (defaults to false/undefined)
-(Optional) Override the instrumentation key that this channel instance sends to
-Is retry handler disabled. -If enabled, retry on 206 (partial success), 408 (timeout), 429 (too many requests), 500 (internal server error) and 503 (service unavailable).
-The maximum interval allowed between calls to batchInvoke
-The maximum size of a batch in bytes
-Optionalmax(Optional) The specific max retry count for each telemetry item. -Default: 10 -if it is set to 0, means no retry allowed -if it is set to undefined, means no limit for retry times
-Is beacon disabled on page unload. -If enabled, flush events through beaconSender.
-If fetch keepalive is supported do not use it for sending events during unload, it may still fallback to fetch() without keepalive
-Optionalretry(Optional) The specific error codes that will cause a retry of sending data to the backend.
-Optionaltransports[Optional] Either an array or single value identifying the requested TransportType type that should be used. -This is used during initialization to identify the requested send transport, it will be ignored if a httpXHROverride is provided.
-Optionalunload[Optional] Either an array or single value identifying the requested TransportType type(s) that should be used during unload or events -marked as sendBeacon. This is used during initialization to identify the requested send transport, it will be ignored if a httpXHROverride -is provided and alwaysUseXhrOverride is true.
-Telemety item supported in Core
-OptionalbaseBased on schema for part B
-OptionalbaseTelemetry type used for part B
-OptionaldataCustom data
-OptionalextSystem context properties of the telemetry item, example: ip address, city etc
-OptionaliIdentifier of the resource that uniquely identifies which resource data is sent to
-Unique name of the telemetry item
-OptionaltagsSystem context property extensions that are not global (not in ctx)
-OptionaltimeTimestamp when item was sent
-OptionalverCommonSchema Version of this SDK
-Configuration provided to SDK core
-OptionalcoreThe App Insights core to use for backward compatibility. -Therefore the interface will be able to access the core without needing to cast to "any". -[optional] any 3rd party plugins which are already implementing this interface don't fail to compile.
-ReadonlyidentifierExtension name
-Initialize plugin loaded by SDK
-The config for the plugin to use
-The current App Insights core to use for initializing this plugin instance
-The complete set of extensions to be used for initializing the plugin
-OptionalpluginChain: ITelemetryPluginChain[Optional] specifies the current plugin chain which identifies the -set of plugins and the order they should be executed for the current request.
-OptionalisReturns a value that indicates whether the plugin has already been previously initialized. -New plugins should implement this method to avoid being initialized more than once.
-ReadonlypriorityPriority of the extension
-Call back for telemetry processing before it it is sent
-This is the current event being reported
-OptionalitemCtx: IProcessTelemetryContextThis is the context for the current request, ITelemetryPlugin instances -can optionally use this to access the current core instance or define / pass additional information -to later plugins (vs appending items to the telemetry item)
-OptionalsetSet next extension for telemetry processing, this is not optional as plugins should use the -processNext() function of the passed IProcessTelemetryContext instead. It is being kept for -now for backward compatibility only.
-OptionalteardownTear down the plugin and remove any hooked value, the plugin should be removed so that it is no longer initialized and -therefore could be re-initialized after being torn down. The plugin should ensure that once this has been called any further -processTelemetry calls are ignored and it just calls the processNext() with the provided context.
-This is the context that should be used during unloading.
-OptionalunloadState: ITelemetryUnloadStateThe details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.
-boolean - true if the plugin has or will call processNext(), this for backward compatibility as previously teardown was synchronous and returned nothing.
-OptionalupdateThe the plugin should re-evaluate configuration and update any cached configuration settings or -plugins. If implemented this method will be called whenever a plugin is added or removed and if -the configuration has bee updated.
-This is the context that should be used during updating.
-The details / state of the update process, it holds details like the current and previous configuration.
-boolean - true if the plugin has or will call updateCtx.processNext(), this allows the plugin to perform any asynchronous operations.
-Optional ReadonlyversionPlugin version (available in data.properties.version in common schema)
-OptionaliOptionalmeasurementsProperty bag to contain additional custom measurements (Part C)
-OptionalpropertiesProperty bag to contain additional custom properties (Part C)
-OptionalseverityConstDefines the level of severity for the event.
-ConstConstApplication Insights API
-ReadonlyappReadonlyconfigAccess to the Dynamic Configuration for the current instance
-ReadonlycontextReadonlycoreReadonlypluginThe formatted string of the installed plugins that contain a version number
-ReadonlypluginAn array of the installed plugins that provide a version
-Add an dependency telemetry initializer callback function to allow populating additional properties or drop the request.
-It is called after the dependency call has completed and any available performance details are available. A dependency
-initializer is similar to the TelemetryInitializer function but it allows you to block the reporting of the dependency
-request so that it doesn't count against the maxAjaxCallsPerView.
The Dependency Telemetry Initializer function
-Add an ajax listener which is called just prior to the request being sent and before the correlation headers are added, to allow you -to access the headers and modify the values used to generate the distributed tracing correlation headers. (added in v2.8.4)
-The Telemetry Initializer function
-Add a new plugin to the installation
-The new plugin to add
-OptionalreplaceExisting: booleanshould any existing plugin be replaced, default is false
-OptionaldoAsync: booleanShould the add be performed asynchronously
-OptionaladdCb: ((added?: boolean) => void)[Optional] callback to call after the plugin has been added
-Optionaladded: booleanAttempt to flush data immediately; If executing asynchronously (the default) and
-you DO NOT pass a callback function then a IPromise
-will be returned which will resolve once the flush is complete. The actual implementation of the IPromise
-will be a native Promise (if supported) or the default as supplied by ts-async library
Optionalasync: booleansend data asynchronously when true
-OptionalcallBack: (() => void)if specified, notify caller when send is complete, the channel should return true to indicate to the caller that it will be called. -If the caller doesn't return true the caller should assume that it may never be called.
-true to indicate that callback will be called after the flush is complete otherwise the caller
-should assume that any provided callback will never be called, Nothing or if occurring asynchronously a
-IPromise which will be resolved once the unload is complete,
-the IPromise will only be returned when no callback is provided
-and async is true.Initialize this instance of ApplicationInsights
-MUST always be false, it is no longer supported from v3.x onwards
-Optionallogger: IDiagnosticLoggerOptionalnotificationManager: INotificationManagerWatches and tracks changes for accesses to the current config, and if the accessed config changes the -handler will be recalled.
-A watcher handler instance that can be used to remove itself when being unloaded
-Set the authenticated user id and the account id. Used for identifying a specific signed-in user. Parameters must not contain whitespace or ,;=|
-The method will only set the authenticatedUserId and accountId in the current page view. To set them for the whole session, you should set storeInCookie = true
OptionalaccountId: stringOptionalstoreInCookie: boolean = falseStarts the timer for tracking a page load time. Use this instead of trackPageView if you want to control when the page view timer starts and stops,
-but don't want to calculate the duration yourself. This method doesn't send any telemetry. Call stopTrackPage to log the end of the page view
-and send the event.
Optionalname: stringA string that idenfities this item, unique within this HTML document. Defaults to the document title.
-Log an extended event that you started timing with startTrackEvent.
The string you used to identify this event in startTrackEvent.
Optionalproperties: { map[string, string] - additional data used to filter events and metrics in the portal. Defaults to empty.
-Optionalmeasurements: { map[string, number] - metrics associated with this event, displayed in Metrics Explorer on the portal. Defaults to empty.
-Stops the timer that was started by calling startTrackPage and sends the pageview load time telemetry with the specified properties and measurements.
-The duration of the page view will be the time between calling startTrackPage and stopTrackPage.
Optionalname: stringThe string you used as the name in startTrackPage. Defaults to the document title.
-Optionalurl: stringString - a relative or absolute URL that identifies the page or other item. Defaults to the window location.
-Optionalproperties: { map[string, string] - additional data used to filter pages and metrics in the portal. Defaults to empty.
-Optionalmeasurements: { map[string, number] - metrics associated with this page, displayed in Metrics Explorer on the portal. Defaults to empty.
-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, just use the name and average fields
-of IMetricTelemetry.
If you take measurements frequently, you can reduce the telemetry bandwidth by
-aggregating multiple measurements and sending the resulting average and modifying
-the sampleCount field of IMetricTelemetry.
input object argument. Only name and average are mandatory.
OptionalcustomProperties: ICustomPropertiesUnload and Tear down the SDK and any initialized plugins, after calling this the SDK will be considered
-to be un-initialized and non-operational, re-initializing the SDK should only be attempted if the previous
-unload call return true stating that all plugins reported that they also unloaded, the recommended
-approach is to create a new instance and initialize that instance.
-This is due to possible unexpected side effects caused by plugins not supporting unload / teardown, unable
-to successfully remove any global references or they may just be completing the unload process asynchronously.
-If you pass isAsync as true and do not provide
-If you pass isAsync as true (also the default) and DO NOT pass a callback function then an IPromise
-will be returned which will resolve once the unload is complete. The actual implementation of the IPromise
-will be a native Promise (if supported) or the default as supplied by ts-async library
OptionalisAsync: booleanCan the unload be performed asynchronously (default)
-OptionalunloadComplete: ((unloadState: ITelemetryUnloadState) => void)An optional callback that will be called once the unload has completed
-OptionalcbTimeout: numberAn optional timeout to wait for any flush operations to complete before proceeding with the -unload. Defaults to 5 seconds.
-Nothing or if occurring asynchronously a IPromise -which will be resolved once the unload is complete, the IPromise -will only be returned when no callback is provided and isAsync is true
-Update the configuration used and broadcast the changes to all loaded plugins
-The new configuration is apply
-OptionalmergeExisting: booleanShould the new configuration merge with the existing or just replace it. Default is to merge.
-Overwrite the lazy loaded fields of global window snippet to contain the -actual initialized API methods
-StaticChildrenStaticParentMark this event as completed, calculating the total execution time.
-OptionalexIdentifies the exclusive time spent in for this event (not including child events), -this will be undefined until the event is completed.
-OptionalgetGet the names additional context associated with this perf event
-Is this occurring from an asynchronous event
-Identifies whether this event is a child event of a parent
-The name of the event
-The payload (contents) of the perfEvent, may be null or only set after the event has completed depending on -the runtime environment.
-OptionalsetSet the named additional context to be associated with this perf event, this will replace any existing value
-The start time of the event in ms
-OptionaltimeIdentifies the total inclusive time spent for this event, including the time spent for child events, -this will be undefined until the event is completed
-General bucket used for execution context set and retrieved via setCtx() and getCtx. -Defined as private so it can be visualized via the DebugPlugin
-Optionalmanager: INotificationManagerCreate a new event and start timing, the manager may return null/undefined to indicate that it does not -want to monitor this source event.
-The source name of the event
-Optionalpayload: anyOptionalisAsync: booleanIs the event occurring from a async event
-Trys to add an event handler for the specified event to the window, body and document
-{string} - The name of the event
-{any} - The callback function that needs to be executed for the given event
-OptionalevtNamespace: string | string[][Optional] Namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace.
-Helper function to wrap a function with a perf event
-The Performance Manager or a Performance provider source (may be null)
-The callback to create the source name for the event (if perf monitoring is enabled)
-The function to call and measure
-Optionaldetails: (() => any)A function to return the payload details
-OptionalisAsync: booleanIs the event / function being call asynchronously or synchronously
-Removes an event handler for the specified event
-{string} - The name of the event, with optional namespaces or just the namespaces, -such as "click", "click.mynamespace" or ".mynamespace"
-{any} - The callback function that needs to be removed from the given event, when using a -namespace (with or without a qualifying event) this may be null to remove all previously attached event handlers -otherwise this will only remove events with this specific handler.
-OptionalevtNamespace: string | string[][Optional] Additional namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace, -if the eventName also includes a namespace the namespace(s) are merged into a single namespace
-OptionaluseCapture: boolean[Optional] Defaults to false
-Binds the specified function to an event, so that the function gets called whenever the event fires on the object
-String that specifies any of the standard DHTML Events without "on" prefix, if may also include an optional (dot "." prefixed) -namespaces "click" "click.mynamespace" in addition to specific namespaces.
-Pointer that specifies the function to call when event fires
-OptionalevtNamespace: string | string[][Optional] Additional namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace, -if the eventName also includes a namespace the namespace(s) are merged into a single namespace
-OptionaluseCapture: boolean[Optional] Defaults to false
-True if the function was bound successfully to the event, otherwise false
-Helper function to fetch the passed traceparent from the page, looking for it as a meta-tag or a Server-Timing header.
-OptionalselectIdx: numberIf the found value is comma separated which is the preferred entry to select, defaults to the first
-Checks if HTML5 Beacons are supported in the current environment.
-OptionaluseCached: boolean[Optional] used for testing to bypass the cached lookup, when true this will
-cause the cached global to be reset.
True if supported, false otherwise.
-Generate random base64 id string. -The default length is 22 which is 132-bits so almost the same as a GUID but as base64 (the previous default was 5)
-OptionalmaxLength: numberOptional value to specify the length of the id to be generated, defaults to 22
-Trys to remove event handler(s) for the specified event/namespace to the window, body and document
-{string} - The name of the event, with optional namespaces or just the namespaces, -such as "click", "click.mynamespace" or ".mynamespace"
-{any} - - The callback function that needs to be removed from the given event, when using a -namespace (with or without a qualifying event) this may be null to remove all previously attached event handlers -otherwise this will only remove events with this specific handler.
-OptionalevtNamespace: string | string[][Optional] Namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace.
-ReadonlycontextAttempt to flush data immediately; If executing asynchronously (the default) and
-you DO NOT pass a callback function then a IPromise
-will be returned which will resolve once the flush is complete. The actual implementation of the IPromise
-will be a native Promise (if supported) or the default as supplied by ts-async library
Optionalasync: booleansend data asynchronously when true
-OptionalcallBack: (() => void)if specified, notify caller when send is complete, the channel should return true to indicate to the caller that it will be called. -If the caller doesn't return true the caller should assume that it may never be called.
-true to indicate that callback will be called after the flush is complete otherwise the caller
-should assume that any provided callback will never be called, Nothing or if occurring asynchronously a
-IPromise which will be resolved once the unload is complete,
-the IPromise will only be returned when no callback is provided
-and async is true.Add an ajax listener which is called just prior to the request being sent and before the correlation headers are added, to allow you -to access the headers and modify the values used to generate the distributed tracing correlation headers. (added in v2.8.4)
-The Telemetry Initializer function
-Add a new plugin to the installation
-The new plugin to add
-should any existing plugin be replaced
-Should the add be performed asynchronously
-OptionaladdCb: ((added?: boolean) => void)Optionaladded: booleanUnload and Tear down the SDK and any initialized plugins, after calling this the SDK will be considered
-to be un-initialized and non-operational, re-initializing the SDK should only be attempted if the previous
-unload call return true stating that all plugins reported that they also unloaded, the recommended
-approach is to create a new instance and initialize that instance.
-This is due to possible unexpected side effects caused by plugins not supporting unload / teardown, unable
-to successfully remove any global references or they may just be completing the unload process asynchronously.
-If you pass isAsync as true (also the default) and DO NOT pass a callback function then an IPromise
-will be returned which will resolve once the unload is complete. The actual implementation of the IPromise
-will be a native Promise (if supported) or the default as supplied by ts-async library
OptionalisAsync: booleanCan the unload be performed asynchronously (default)
-OptionalunloadComplete: ((unloadState: ITelemetryUnloadState) => void)An optional callback that will be called once the unload has completed
-OptionalcbTimeout: numberAn optional timeout to wait for any flush operations to complete before proceeding with the -unload. Defaults to 5 seconds.
-Nothing or if occurring asynchronously a IPromise -which will be resolved once the unload is complete, the IPromise -will only be returned when no callback is provided and isAsync is true
-Update the configuration used and broadcast the changes to all loaded plugins, this does NOT support updating, adding or removing -any the plugins. It will notify (if supported) that the configuration has changed but it will not remove or add any new plugins
-The new configuration is apply
-OptionalmergeExisting: booleanShould the new configuration merge with the existing or just replace it. Default is to merge.
-ConstConstConstConstConstConstConstConstDefines the level of severity for the event.
-
Function used to identify the get w parameter used to identify status bit to some channels
-