UNPKG

@kurrent/opentelemetry

Version:

KurrentDB NodeJS Client SDK interceptors for tracing with OpenTelemetry

20 lines (19 loc) 1.26 kB
import { Tracer } from "@opentelemetry/api"; import { InstrumentationBase, InstrumentationConfig, InstrumentationNodeModuleDefinition } from "@opentelemetry/instrumentation"; import type { SubscribeToAllOptions, SubscribeToStreamOptions } from "@kurrent/kurrentdb-client"; import type { PersistentSubscriptionImpl } from "@kurrent/kurrentdb-client/src/persistentSubscription/utils/PersistentSubscriptionImpl"; import type { Subscription } from "@kurrent/kurrentdb-client/src/streams/utils/Subscription"; export declare class Instrumentation extends InstrumentationBase { constructor(config?: InstrumentationConfig); protected init(): InstrumentationNodeModuleDefinition; private _onPatchMain; private wrap; private _onUnPatchMain; private _patchAppendToStream; static applySubscriptionInstrumentation<KnownEventType>(spanName: string, subscription: Subscription<KnownEventType> | PersistentSubscriptionImpl<KnownEventType>, uri: string, operation: string, options: SubscribeToStreamOptions | SubscribeToAllOptions | undefined, tracer: Tracer): void; private _patchCatchUpSubscription; private _patchPersistentSubscription; private static restoreContext; private static handleError; private static getServerAddress; }