BaseTelemetryPlugin 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.

Hierarchy

  • BaseTelemetryPlugin

Implements

Constructors

Properties

_doTeardown?: ((unloadCtx?, unloadState?, asyncCallback?) => boolean | void)

Type declaration

    • (unloadCtx?, unloadState?, asyncCallback?): boolean | void
    • Teardown / Unload hook to allow implementations to perform some additional unload operations before the BaseTelemetryPlugin finishes it's removal.

      Parameters

      • Optional unloadCtx: IProcessTelemetryUnloadContext

        This is the context that should be used during unloading.

      • Optional unloadState: ITelemetryUnloadState

        The details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.

      • Optional asyncCallback: (() => 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.

          • (): void
          • Returns void

      Returns boolean | void

      boolean - true if the plugin has or will call asyncCallback, this allows the plugin to perform any asynchronous operations.

_doUpdate?: ((updateCtx?, updateState?, asyncCallback?) => boolean | void)

Type declaration

    • (updateCtx?, updateState?, asyncCallback?): boolean | void
    • Extension hook to allow implementations to perform some additional update operations before the BaseTelemetryPlugin finishes it's removal

      Parameters

      • Optional updateCtx: IProcessTelemetryUpdateContext

        This is the context that should be used during updating.

      • Optional updateState: ITelemetryUpdateState

        The details / state of the update process, it holds details like the current and previous configuration.

      • Optional asyncCallback: (() => 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.

          • (): void
          • Returns void

      Returns boolean | void

      boolean - true if the plugin has or will call asyncCallback, this allows the plugin to perform any asynchronous operations.

_getTelCtx: ((currentCtx?) => IProcessTelemetryContext)

Type declaration

    • (currentCtx?): IProcessTelemetryContext
    • Helper 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.

      Parameters

      Returns IProcessTelemetryContext

_unloadHooks: IUnloadHookContainer

Exposes 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

diagLog: ((itemCtx?) => IDiagnosticLogger)

Type declaration

identifier: string

Extension name

isInitialized: (() => boolean)

Type declaration

    • (): boolean
    • Returns whether the plugin has been initialized

      Returns boolean

priority: number

Priority of the extension

processNext: ((env, itemCtx) => void)

Type declaration

    • (env, itemCtx): void
    • Call back for telemetry processing before it it is sent

      Parameters

      • env: ITelemetryItem

        This is the current event being reported

      • itemCtx: IProcessTelemetryContext

        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)

      Returns void

setInitialized: ((isInitialized) => void)

Type declaration

    • (isInitialized): void
    • Internal helper to allow setting of the internal initialized setting for inherited instances and unit testing

      Parameters

      • isInitialized: boolean

      Returns void

setNextPlugin: ((next) => void)

Type declaration

version?: string

Plugin version (available in data.properties.version in common schema)

Methods

  • Call back for telemetry processing before it it is sent

    Parameters

    • env: ITelemetryItem

      This is the current event being reported

    • Optional itemCtx: IProcessTelemetryContext

      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)

    Returns void

  • 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.

    Parameters

    • Optional unloadCtx: IProcessTelemetryUnloadContext

      This is the context that should be used during unloading.

    • Optional unloadState: ITelemetryUnloadState

      The details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.

    Returns boolean | void

    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.

    Parameters

    Returns boolean | void

    boolean - true if the plugin has or will call updateCtx.processNext(), this allows the plugin to perform any asynchronous operations.

Generated using TypeDoc