import { GalileoOTLPExporter } from './exporter'; import type { GalileoSpanProcessorConfig } from './types'; import type { SpanLike, ReadableSpanLike, ContextLike, SpanProcessorLike } from './types'; /** * Complete OpenTelemetry span processor with integrated Galileo export functionality. * * This processor combines span processing and export capabilities into a single * component that can be directly attached to any OpenTelemetry TracerProvider. * * On span start, it reads Galileo context from AsyncLocalStorage (set by `init()`, * `galileoContext`, or experiment context) and stamps galileo.* attributes onto each span. * These attributes are then read by the GalileoOTLPExporter at export time. * * @example * ```typescript * import { GalileoSpanProcessor, addGalileoSpanProcessor } from 'galileo'; * import { NodeTracerProvider } from '@opentelemetry/sdk-trace-node'; * * const provider = new NodeTracerProvider(); * const processor = new GalileoSpanProcessor({ project: 'my-project' }); * addGalileoSpanProcessor(provider, processor); * provider.register(); * * const tracer = provider.getTracer('my-service'); * const span = tracer.startSpan('my-operation'); * span.end(); * ``` */ export declare class GalileoSpanProcessor implements SpanProcessorLike { private _processor; private _exporter; private _experimentId?; private _sessionId?; constructor(config?: GalileoSpanProcessorConfig); /** * Inject Galileo context attributes onto each span at creation time. * * Reads context from AsyncLocalStorage (experimentContext from singleton.ts), * falls back to constructor config, then environment variables. * Experiment ID takes priority over logstream when both are present. */ onStart(span: SpanLike, parentContext: ContextLike): void; onEnd(span: ReadableSpanLike): void; shutdown(): Promise; forceFlush(): Promise; get exporter(): GalileoOTLPExporter; get processor(): SpanProcessorLike; }