@juspay/neurolink
Version:
Universal AI Development Platform with working MCP integration, multi-provider support, voice (TTS/STT/realtime), and professional CLI. 58+ external MCP servers discoverable, multimodal file processing, RAG pipelines. Build, test, and deploy AI applicatio
50 lines (49 loc) • 1.66 kB
TypeScript
/**
* 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<string, string>): SpanContext | null;
/**
* Inject trace context into outgoing request headers
*/
injectContext(headers: Record<string, string>, otelContext?: Context): Record<string, string>;
/**
* 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<T>(name: string, type: SpanType, fn: (span: SpanData) => Promise<T>, onSpanEnd?: (span: SpanData) => void): Promise<T>;
/**
* 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;
}