/**
 * Optional OpenTelemetry integration.
 *
 * Design goals:
 * - No hard dependency on SDKs/exporters (apps bring their own).
 * - Safe to import in runtimes without tracing configured (no-op behavior).
 * - Best-effort: never breaks request handling.
 *
 * Tiny Node enablement snippet (exporter is app-owned):
 *
 *   npm i @opentelemetry/sdk-node @opentelemetry/auto-instrumentations-node \
 *     @opentelemetry/exporter-trace-otlp-http
 *
 *   // in your app entrypoint (before creating the server)
 *   import { NodeSDK } from '@opentelemetry/sdk-node';
 *   import { getNodeAutoInstrumentations } from '@opentelemetry/auto-instrumentations-node';
 *   import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http';
 *
 *   const sdk = new NodeSDK({
 *     traceExporter: new OTLPTraceExporter({ url: process.env.OTEL_EXPORTER_OTLP_ENDPOINT }),
 *     instrumentations: [getNodeAutoInstrumentations()],
 *   });
 *   await sdk.start();
 *   process.env.OTEL_ENABLED = 'true';
 */
import type { Context, Span } from '@opentelemetry/api';
export interface StartHttpServerSpanInput {
    method: string;
    path: string;
    requestId?: string;
    serviceName?: string;
    userId?: string;
    tenantId?: string;
    userAgent?: string;
}
export interface EndHttpServerSpanInput {
    route?: string;
    status?: number;
    error?: unknown;
}
export interface StartedSpan {
    span: Span;
    context: Context;
}
export interface RecordDbQuerySpanInput {
    driver: string;
    durationMs: number;
}
export interface RecordQueueOperationSpanInput {
    queueName: string;
    operation: 'enqueue' | 'dequeue' | 'ack' | 'length' | 'drain';
    durationMs: number;
    status: 'ok' | 'error';
}
type HeaderGetter = {
    getHeader(name: string): unknown;
};
export declare const OpenTelemetry: Readonly<{
    isEnabled: () => boolean;
    startHttpServerSpan: (req: HeaderGetter, input: StartHttpServerSpanInput) => StartedSpan;
    runWithContext: <T>(ctx: Context, fn: () => Promise<T>) => Promise<T>;
    setHttpRoute: (span: Span, method: string, route: string) => void;
    endHttpServerSpan: (span: Span, input: EndHttpServerSpanInput) => void;
    injectTraceHeaders: (headers: Record<string, string>) => Record<string, string>;
    recordDbQuerySpan: (input: RecordDbQuerySpanInput) => void;
    recordQueueOperationSpan: (input: RecordQueueOperationSpanInput) => void;
}>;
export default OpenTelemetry;
//# sourceMappingURL=OpenTelemetry.d.ts.map