/** * Tracing Module * * Handles OpenTelemetry tracing setup for incoming requests. * Extracts trace context from headers and manages server spans. * * @module server/runtime-handler/tracing */ import { withSpan } from "../../observability/tracing/otlp-setup.js"; import { SpanNames } from "../../observability/index.js"; interface SpanInfo { /** The server span (unknown type from OTLP setup) */ span: unknown; /** The span context (unknown type from OTLP setup) */ context: unknown; } /** * Start tracing for an incoming request. * Extracts parent context from headers and creates a server span. */ export declare function startRequestTracing(req: Request, pathname: string): SpanInfo; /** * Set initial HTTP attributes on the span. */ export declare function setRequestAttributes(span: unknown, req: Request, url: URL): void; /** * Set project-specific attributes on the span. */ export declare function setProjectAttributes(span: unknown, projectSlug: string | undefined, environment: string | undefined): void; /** * End the server span with status and optional error. */ export declare function endRequestTracing(span: unknown, status: number, error?: Error): void; export declare function getRequestTraceContext(span: unknown): { traceId?: string; spanId?: string; }; /** * Execute a handler with the span's context. */ export declare function executeWithTracingContext(spanInfo: SpanInfo, handler: () => Promise): Promise; /** * Wrap an operation in a named span. */ export { SpanNames, withSpan }; //# sourceMappingURL=tracing.d.ts.map