import type { AgentTrace } from './types'; /** * OpenTelemetry span representation. */ export interface OTelSpan { traceId: string; spanId: string; parentSpanId?: string; operationName: string; startTimeUnixNano: number; endTimeUnixNano: number; attributes: Record; status: { code: 'OK' | 'ERROR'; message?: string; }; kind: 'INTERNAL' | 'CLIENT' | 'SERVER'; } export interface OTelExport { resourceSpans: Array<{ resource: { attributes: Record; }; scopeSpans: Array<{ scope: { name: string; version: string; }; spans: OTelSpan[]; }>; }>; } /** * Convert an AgentTrace to OpenTelemetry spans. * * LLM calls become root-level spans, tool calls become child spans * of the most recent LLM call. */ export declare function traceToOTel(trace: AgentTrace, _serviceName?: string): OTelSpan[]; /** * Export trace as OTLP-compatible JSON payload. */ export declare function traceToOTLP(trace: AgentTrace, serviceName?: string): OTelExport; export interface OTelExporterConfig { endpoint?: string; serviceName?: string; format?: OTelFormat; } export type OTelFormat = 'otlp-grpc' | 'otlp-http' | 'jaeger' | 'zipkin'; export interface OTelMetric { name: string; description: string; unit: string; value: number; type: 'gauge' | 'counter' | 'histogram'; attributes: Record; timestamp: number; } export interface OTelMetricsExport { resourceMetrics: Array<{ resource: { attributes: Record; }; scopeMetrics: Array<{ scope: { name: string; version: string; }; metrics: OTelMetric[]; }>; }>; } export interface JaegerSpan { traceID: string; spanID: string; parentSpanID?: string; operationName: string; startTime: number; duration: number; tags: Array<{ key: string; type: string; value: string | number | boolean; }>; process: { serviceName: string; tags: Array<{ key: string; value: string; }>; }; } export interface ZipkinSpan { traceId: string; id: string; parentId?: string; name: string; timestamp: number; duration: number; kind: 'CLIENT' | 'SERVER' | 'PRODUCER' | 'CONSUMER'; localEndpoint: { serviceName: string; }; tags: Record; } /** * Convert OTel spans to Jaeger format. */ export declare function toJaegerSpans(spans: OTelSpan[], serviceName?: string): JaegerSpan[]; /** * Convert OTel spans to Zipkin format. */ export declare function toZipkinSpans(spans: OTelSpan[], serviceName?: string): ZipkinSpan[]; import type { SuiteResult } from './types'; /** * Stateful OpenTelemetry exporter. * Maps agent steps → spans, tool calls → child spans. * Adds cost, tokens, model as span attributes. */ export declare class OTelExporter { private config; private format; constructor(config?: OTelExporterConfig); get endpoint(): string; get serviceName(): string; /** * Export a single trace as OTel spans. */ exportTrace(trace: AgentTrace): OTelSpan[]; /** * Export an entire suite result as OTel spans. * Creates a root span for the suite, with child spans per test, * and nested spans for each test's trace steps. */ exportSuiteResult(result: SuiteResult): OTelSpan[]; /** * Build OTLP JSON payload from spans. */ toOTLP(spans: OTelSpan[]): OTelExport; /** * Convert trace to OTel spans (alias for exportTrace). */ toOTelSpans(trace: AgentTrace): OTelSpan[]; /** * Export metrics from a SuiteResult. */ exportMetrics(suiteResult: SuiteResult): OTelMetricsExport; /** * Convert spans to Jaeger format. */ toJaeger(spans: OTelSpan[]): JaegerSpan[]; /** * Convert spans to Zipkin format. */ toZipkin(spans: OTelSpan[]): ZipkinSpan[]; /** * Get the configured format. */ getFormat(): OTelFormat; } //# sourceMappingURL=otel.d.ts.map