/** * Pipeline-level tracing — opens a `qar.client.pipeline` parent span and a * `qar.client.pipeline.step` child per step (or gate, or parallel branch). * * The runner lives in {@link PipelineBuilder.execute}. `tracePipeline` * wraps the run in a single OTel root span and uses the builder's * `PIPELINE_TRACE_HOOKS` symbol to receive per-entry callbacks; each * callback opens / closes a child span under the root so Phoenix renders the * pipeline as a tree (one parent, N siblings — one per executed entry). * * No special wiring on the consumer side — call `tracePipeline(otel, pipeline, * initialState, options?)` instead of `pipeline.execute(initialState)`. */ import { type PipelineBuilder, type PipelineResult } from '../client/PipelineClient.js'; import type { JsonObject } from '../qar/json.js'; import type { OTelAPI } from './types.js'; export interface TracePipelineOptions { /** Tracer name (default `'@qodo/sdk'`). */ readonly tracerName?: string; /** Extra attributes stamped on the root pipeline span. */ readonly rootAttributes?: { readonly [key: string]: string | number | boolean; }; /** * Logical pipeline name surfaced on the root span name. Defaults to * `qar.client.pipeline`. Useful when a consumer runs more than one pipeline * shape and wants Phoenix to group them by name. */ readonly pipelineName?: string; /** * Session id stamped on the root span as `qar.session_id` / * `gen_ai.conversation.id`. Optional — when omitted, the root span carries * no session attribute and consumer queries fall back to the SDK-level * `qar.client.task.start` spans the inner `client.tasks.start` calls open. */ readonly sessionId?: string; } /** * Execute a pipeline with OTel tracing. One `qar.client.pipeline` root span * per run; one `qar.client.pipeline.step` child per executed entry (step, * gate, or parallel branch). The pipeline runner uses `Promise.allSettled` for * parallel branches, so failed branches still close their child spans cleanly * (no orphans). * * If `otel` is undefined, falls back to plain `pipeline.execute(initialState)` * with no span emission — same posture as the rest of the SDK 2.0 tracing * layer ([observability.md §Peer-dependency posture](../../docs/sdk2/observability.md)). */ export declare function tracePipeline(otel: OTelAPI | undefined, pipeline: PipelineBuilder, initialState?: JsonObject, options?: TracePipelineOptions): Promise; //# sourceMappingURL=PipelineTracer.d.ts.map