Trace Broadcasting
Trace broadcasting lets you send the same OpenTelemetry traces to multiple destinations at once — for example, your own data warehouse for long-term storage, plus Confident AI for LLM observability and online evaluations.
Because Confident AI accepts standard OTLP/HTTP, any pipeline that produces OTLP can broadcast a copy of every trace to https://otel.confident-ai.com/v1/traces. No proprietary protocol or wrapper SDK is required.
Overview
Common reasons teams broadcast traces:
- Compliance / data residency — keep a copy of every trace in an internal warehouse before anything leaves their network.
- Vendor independence — keep raw spans in their own infrastructure so they can switch or add observability vendors later.
- Specialized backends — use a general-purpose APM (Datadog, Tempo, Jaeger) for service monitoring, and Confident AI for LLM-specific evaluation.
- Sampling separation — keep 100% of traces locally for debugging, but only send a sampled subset externally.
There are two equivalent ways to broadcast: configure an OpenTelemetry Collector (a small standalone binary) that fans out traces, or attach multiple exporters directly inside your application. Both produce the same result.
Confident AI does not support gRPC for OTLP — only HTTP. Use otlphttp
(Collector) or OTLPSpanExporter from the proto-http package (SDK).
Architecture
Via the Collector
Recommended for production — buffering, retries, sampling, and PII scrubbing all live in one centralized place.
Via the SDK
Simpler — good for single-service apps. Each BatchSpanProcessor batches and retries independently, so a failure on one destination doesn’t affect the other.
Setup
Pick whichever flavor fits your stack — both achieve the same broadcast.
Collector (YAML)
Python
TypeScript
Go
Java
Ruby
C#
Load this into a running OpenTelemetry Collector — see the official Collector docs for deployment options. Listing both exporters in the same pipeline is all that’s needed; every span goes to both.
After this, emit spans as you normally would — every span flows to both destinations.
Advanced Collector Features
These features are unique to the Collector path. They let you change broadcast behavior without touching application code.
Selective broadcast
To send only LLM-tagged spans to Confident AI while keeping 100% in the warehouse, use the routing connector:
Sampling
To keep 100% locally but only sample 10% (plus all errors) to Confident AI:
Apply it to the Confident AI pipeline only, leaving the warehouse pipeline unsampled.
PII scrubbing
Strip or hash sensitive fields before they leave your network:
Then add attributes/redact to the pipeline’s processors list.
Combining with Distributed Tracing
If you already use distributed tracing across multiple services, point all services at a shared Collector and let it handle the broadcast:
Because traceparent is propagated end-to-end, every destination receives a complete, unified trace.
All services must use the same CONFIDENT_API_KEY. Different keys route
to different projects and break trace unification.
Best Practices
Set Confident AI attributes
Broadcasting only changes where spans go, not what they contain. Spans must still carry the confident.* attributes (e.g. confident.span.type, confident.span.input, confident.llm.model) to render correctly in Observatory. See Span-Level Attribute Mappings.
Prefer the Collector in production
Once you have more than one service, a Collector is strongly recommended:
- A single buffer absorbs spikes instead of every app holding its own queue.
- Network blips to either destination only affect the Collector — your apps stay snappy.
- You can change destinations, sampling, or PII rules without redeploying app code.
Use HTTP, not gRPC
Confident AI’s OTLP endpoint accepts HTTP only. Use otlphttp in the Collector and OTLPSpanExporter from opentelemetry-exporter-otlp-proto-http in the SDK.
Set environment per pipeline
Use OTEL_RESOURCE_ATTRIBUTES to control which Confident AI environment traces land in:
For different environments per destination, run two Collector pipelines with different resource processors.
Debug sinks in isolation
When traces look wrong, disable one exporter at a time to confirm whether the issue is upstream or specific to one destination.