/** * W3C Trace Context Parser * * Parses distributed tracing headers according to W3C Trace Context specification. * Supports traceparent header with fallback to x-frontmcp-trace-id custom header. * * @see https://www.w3.org/TR/trace-context/ */ /** * W3C Trace Context parsed from traceparent header. * Format: 00--- */ export interface TraceContext { /** 128-bit trace identifier (32 hex chars) */ traceId: string; /** 64-bit parent span identifier (16 hex chars) */ parentId: string; /** 8-bit trace flags (sampled = 0x01) */ traceFlags: number; /** Raw traceparent header value */ raw: string; } /** * Parse trace context from HTTP headers. * * Priority: * 1. W3C traceparent header * 2. x-frontmcp-trace-id custom header * 3. Generate new trace context * * @param headers - HTTP headers object * @returns Parsed or generated TraceContext */ export declare function parseTraceContext(headers: Record): TraceContext; /** * Generate a new trace context with random IDs. */ export declare function generateTraceContext(): TraceContext; /** * Create a child span context from a parent context. * Generates a new parentId while preserving the traceId. */ export declare function createChildSpanContext(parent: TraceContext): TraceContext; //# sourceMappingURL=trace-context.d.ts.map