ReadonlyconfigReadonlycontextOptionalasync: 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.ReadonlyotelThe OpenTelemetry API instance associated with this instance Unlike OpenTelemetry, this API does not return a No-Op implementation and returns null if the SDK has been torn down or not yet initialized.
ReadonlytraceOpenTelemetry trace API for creating spans. Unlike OpenTelemetry, this API does not return a No-Op implementation and returns null if the SDK has been torn down or not yet initialized.
Add an ajax listener which is called just prior to the request being sent and before the correlation headers are added. This allows you to access the headers and modify the values used to generate the distributed tracing correlation headers (added in v2.8.4), or to drop the correlation (added in v3.3.7).
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: booleanReturn the current active span, if no trace provider is available null will be returned but when a trace provider is available a span instance will always be returned, even if there is no active span (in which case a non-recording span will be returned).
OptionalcreateNew: booleanOptional flag to create a non-recording span if no active span exists, defaults to true. When false, returns the existing active span or null without creating a non-recording span, which can improve performance when only checking if an active span exists.
The current active span or null if no trace provider is available or if createNew is false and no active span exists
Find and return the (first) plugin with the specified identifier if present
The identifier of the plugin to find
Gets the current distributed trace active context for this instance
OptionalcreateNew: booleanOptional flag to create a new instance if one doesn't currently exist, defaults to true. By default this will use any located parent as defined by the IConfiguration.traceHdrMode configuration for each new instance created.
Set the current Active Span, if no trace provider is available the span will be not be set as the active span.
The span to set as the active span
An ISpanScope instance that provides the current scope, the span will always be the span passed in even when no trace provider is available
Start a new span with the given name and optional parent context.
Note: This method only creates and returns the span. It does not automatically set the span as the active trace context. Context management should be handled separately using setTraceCtx() if needed.
The name of the span
Optionaloptions: IOTelSpanOptionsOptions for creating the span (kind, attributes, startTime)
Optionalparent: IDistributedTraceContextOptional parent context. If not provided, uses the current active trace context
A new span instance, or null if no trace provider is available
Logs dependency call
OptionalcustomProperties: { OptionalcustomProperties: { OptionalcustomProperties: { OptionalcustomProperties: { OptionalcustomProperties: { OptionalcustomProperties: { 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, 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.
Attempt 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
IPromisewill be a native Promise (if supported) or the default as supplied by ts-async library