/** * OpenTelemetry Bridge * Bidirectional context propagation between NeuroLink and OpenTelemetry */ import { type Context, type SpanContext } from "@opentelemetry/api"; import type { SpanData } from "../types/index.js"; import { type SpanType } from "../types/index.js"; /** * Bridge for bidirectional context propagation between * NeuroLink's observability system and OpenTelemetry */ export declare class OtelBridge { private readonly tracer; /** * Extract trace context from incoming request headers */ extractContext(headers: Record): SpanContext | null; /** * Inject trace context into outgoing request headers */ injectContext(headers: Record, otelContext?: Context): Record; /** * Create a NeuroLink span from OpenTelemetry context */ createSpanFromOtelContext(spanContext: SpanContext, type: SpanType, name: string): SpanData; /** * Wrap a function with OpenTelemetry tracing that also creates NeuroLink spans */ wrapWithTracing(name: string, type: SpanType, fn: (span: SpanData) => Promise, onSpanEnd?: (span: SpanData) => void): Promise; /** * Convert NeuroLink span to OpenTelemetry span and export */ exportToOtel(span: SpanData): void; /** * Get current trace context for correlation */ getCurrentTraceContext(): { traceId: string; spanId: string; } | null; /** * Filter attributes to only include OTel-compatible types */ private filterAttributes; /** * Filter event attributes */ private filterEventAttributes; }