UNPKG

otel-nestjs-instrumentation

Version:

Comprehensive OpenTelemetry instrumentation for NestJS applications - SQS, Kafka, HTTP/2, cron jobs and custom protocols

13 lines (12 loc) 728 B
import { ExecutionContext } from '@nestjs/common'; import { EventEmitter } from 'stream'; export type OtelNestjsEventListener = (traceId?: string, error?: Error, result?: unknown, context?: ExecutionContext) => void; export declare class OtelNestjsEvent { private readonly eventEmitter; constructor(eventEmitter: EventEmitter); on(event: 'spanStartFailed', listener: (error: unknown) => void): void; on(event: 'spanFinished', listener: (traceId: string) => void): void; on(event: 'spanStarted', listener: (traceId: string) => void): void; on(event: 'spanFinishError', listener: (traceId: string, error: unknown) => void): void; on(event: string, listener: Parameters<EventEmitter['on']>[1]): void; }