/** * Span context management utilities * For managing hierarchical spans across different layers */ import type { UnifiedHttpContext } from '@inh-lib/unified-route'; import { type UnifiedTelemetryLogger, type UnifiedTelemetrySpan } from '@inh-lib/unified-telemetry-core'; export declare const CURRENT_LOGGER_KEY: "telemetry:currentLogger"; /** * Span stack for managing nested spans */ export interface SpanStackItem { span: UnifiedTelemetrySpan; logger: UnifiedTelemetryLogger; operationName: string; level: number; } /** * Push a new span to the stack (becomes the current active span) */ export declare function pushSpanToStack(context: UnifiedHttpContext, span: UnifiedTelemetrySpan, logger: UnifiedTelemetryLogger, operationName: string): void; /** * Pop the current span from the stack (previous span becomes current) */ export declare function popSpanFromStack(context: UnifiedHttpContext): SpanStackItem | null; /** * Get the current active span (top of stack) */ export declare function getCurrentSpan(context: UnifiedHttpContext): UnifiedTelemetrySpan | null; /** * Get the span stack */ export declare function getSpanStack(context: UnifiedHttpContext): SpanStackItem[]; /** * Get current nesting level */ export declare function getCurrentSpanLevel(context: UnifiedHttpContext): number; /** * Clear all spans from stack */ export declare function clearSpanStack(context: UnifiedHttpContext): void;