/** * Correlation context for tracking requests across services */ export interface CorrelationContext { correlationId: string; requestId?: string; userId?: string; sessionId?: string; traceId?: string; spanId?: string; } /** * Correlation manager for request tracking */ export declare class CorrelationManager { private static instance; private contexts; private constructor(); /** * Gets singleton instance */ static getInstance(): CorrelationManager; /** * Creates a new correlation context */ createContext(options?: Partial): CorrelationContext; /** * Gets correlation context by ID */ getContext(correlationId: string): CorrelationContext | undefined; /** * Updates correlation context */ updateContext(correlationId: string, updates: Partial): void; /** * Removes correlation context */ removeContext(correlationId: string): void; /** * Clears all contexts (useful for testing) */ clear(): void; /** * Generates a unique correlation ID */ private generateCorrelationId; /** * Gets the number of active contexts */ getActiveContextCount(): number; } /** * Correlation utilities */ export declare class Correlation { /** * Runs a function with correlation context */ static run(context: CorrelationContext, callback: () => T): T; /** * Gets current correlation context */ static getCurrentContext(): CorrelationContext | undefined; /** * Creates and runs with a new correlation context */ static runWithNew(options: Partial, callback: () => T): T; /** * Generates a correlation ID from headers */ static fromHeaders(headers: Record): string; /** * Extracts trace information from various tracing systems */ static extractTraceInfo(headers: Record): Partial; /** * Helper to get header value as string */ private static getHeaderValue; } //# sourceMappingURL=correlation.d.ts.map