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)
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
OptionalsetSet next extension for telemetry processing, this is now optional as plugins should use the processNext() function of the passed IProcessTelemetryContext instead. It is being kept for now for backward compatibility only.
OptionalversionPlugin version (available in data.properties.version in common schema)
StaticVersionProtected_addAdd this hook so that it is automatically removed during unloading
The single hook or an array of IInstrumentHook objects
Protected_addThe exception item to be sent
OptionalcustomProperties: { OptionalsystemProperties: { System level properties (Part A) that a user can add to the telemetry item
Create 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
The page view performance item to be sent
Optionalproperties: { Custom properties (Part C) that a user can add to the telemetry item
OptionalsystemProperties: { 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.
Log an exception you have caught.
Object which contains exception to be sent
OptionalcustomProperties: ICustomPropertiesAdditional data used to filter pages and metrics in the portal. Defaults to empty.
Any property of type double will be considered a measurement, and will be treated by Application Insights as a metric.
input object argument. Only name and average are mandatory.
OptionalcustomProperties: ICustomPropertiesadditional data used to filter metrics in 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 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
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
Send browser performance metrics.
The page view performance item to be sent
OptionalcustomProperties: ICustomPropertiesAdditional data used to filter pages and metrics in the portal. Defaults to empty.
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