UNPKG

@embrace-io/web-sdk

Version:
65 lines 2.99 kB
import type { DiagLogger, Meter, MeterProvider, Span, Tracer, TracerProvider } from '@opentelemetry/api'; import type { Logger } from '@opentelemetry/api-logs'; import type { Instrumentation, InstrumentationConfig, InstrumentationModuleDefinition, SpanCustomizationHook } from '@opentelemetry/instrumentation'; import type { LoggerProvider } from '@opentelemetry/sdk-logs'; export declare abstract class InstrumentationAbstract<ConfigType extends InstrumentationConfig = InstrumentationConfig> implements Instrumentation<ConfigType> { readonly instrumentationName: string; readonly instrumentationVersion: string; protected _config: ConfigType; protected _diag: DiagLogger; constructor(instrumentationName: string, instrumentationVersion: string, config: ConfigType); private _tracer; protected get tracer(): Tracer; private _meter; protected get meter(): Meter; private _logger; protected get logger(): Logger; /** * @experimental * * Get module definitions defined by {@link init}. * This can be used for experimental compile-time instrumentation. * * @returns an array of {@link InstrumentationModuleDefinition} */ getModuleDefinitions(): InstrumentationModuleDefinition[]; abstract disable(): void; abstract enable(): void; getConfig(): ConfigType; /** * Sets InstrumentationConfig to this plugin * @param config */ setConfig(config: ConfigType): void; /** * Sets LoggerProvider to this plugin * @param loggerProvider */ setLoggerProvider(loggerProvider: LoggerProvider): void; /** * Sets MeterProvider to this plugin * @param meterProvider */ setMeterProvider(meterProvider: MeterProvider): void; /** * Sets TraceProvider to this plugin * @param tracerProvider */ setTracerProvider(tracerProvider: TracerProvider): void; /** * Init method in which plugin should define _modules and patches for * methods. */ protected abstract init(): InstrumentationModuleDefinition | InstrumentationModuleDefinition[] | void; protected _updateMetricInstruments(): void; /** * Execute span customization hook, if configured, and log any errors. * Any semantics of the trigger and info are defined by the specific instrumentation. * @param hookHandler The optional hook handler which the user has configured via instrumentation config * @param triggerName The name of the trigger for executing the hook for logging purposes * @param span The span to which the hook should be applied * @param info The info object to be passed to the hook, with useful data the hook may use */ protected _runSpanCustomizationHook<SpanCustomizationInfoType>(hookHandler: SpanCustomizationHook<SpanCustomizationInfoType> | undefined, triggerName: string, span: Span, info: SpanCustomizationInfoType): void; } //# sourceMappingURL=InstrumentationAbstract.d.ts.map