import { type Span, type Attributes } from '@opentelemetry/api'; /** * Run `fn` inside a new active span named `name`. * * Auto-instrumentation only covers inbound HTTP/express/mongo/pg; the paths that * actually get debugged in an incident — AI generation, the out-of-band BullMQ * plugin build (runs detached from any inbound span), long async work — show no * span detail without a hand-authored one. Wrap those with this. * * Safe when tracing is disabled: with no SDK registered, `startActiveSpan` runs * the callback with a no-op span, so this adds negligible overhead and never * changes behavior. On throw, the span is marked ERROR and the exception * recorded, then re-thrown unchanged. Always ends the span. */ export declare function withSpan(name: string, fn: (span: Span) => Promise, attributes?: Attributes): Promise; /** * Shutdown the OpenTelemetry SDK gracefully. */ export declare function shutdownTracing(): Promise; /** * Returns the current active trace ID, or undefined when tracing is * disabled / no active span. Useful for enriching structured logs so an * operator can correlate a request across services via its trace ID. */ export declare function currentTraceId(): string | undefined;