UNPKG

@eventstore/opentelemetry

Version:

[![license][license-badge]][license-badge-url] [![Github action CI workflow][ci-badge]][ci-badge-url]

21 lines (20 loc) 1.34 kB
import { Tracer } from "@opentelemetry/api"; import { InstrumentationBase, InstrumentationConfig, InstrumentationNodeModuleDefinition } from "@opentelemetry/instrumentation"; import type * as esdb from "@eventstore/db-client"; import type { SubscribeToAllOptions, SubscribeToStreamOptions } from "@eventstore/db-client"; import type { PersistentSubscriptionImpl } from "@eventstore/db-client/src/persistentSubscription/utils/PersistentSubscriptionImpl"; import type { Subscription } from "@eventstore/db-client/src/streams/utils/Subscription"; export declare class Instrumentation extends InstrumentationBase { constructor(config?: InstrumentationConfig); protected init(): InstrumentationNodeModuleDefinition<typeof esdb>; 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; }