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
true if the callback will be return after the flush is complete otherwise the caller should assume that any provided callback will never be called
Return 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.
The current active span or null if no trace provider is available or if createNew is false and no active span exists
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, you can optional create a new instance if one does not currently exist or return null if one does not currently exist. When a server context is available it will be used as the parent context for the any new instance created (when createNew is true or no instance currently exists), calling this function will not change the current distributed trace context, it will only return the current context or create a new instance if one does not currently exist.
OptionalcreateNew: booleanOptional flag to create a new instance if one doesn't currently exist, defaults to
undefined which will only create a new instance if one does not currently exist.
If set to false then it will return null if no distributed trace context is available.
If set to true then a new instance will be created even if one already exists.
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.
The watcher handler to call when the config changes
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 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
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
Set the trace provider for creating spans. This allows different SKUs to provide their own span implementations.
The trace provider to use for span creation, it is passed as a cached value so that it may be implemented via a lazy / deferred initializer.
Start a new span with the given name and optional parent context. The span will become the active span for its duration unless a different span is explicitly set as active.
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
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.
Function used to identify the get w parameter used to identify status bit to some channels