Expand description
§Module: Distributed Tracing Export
§Responsibility
Extends the existing OpenTelemetry integration with a TraceExporter that
exports request-level traces (with one child span per pipeline stage) to
multiple backends:
| Backend | Feature flag | Environment variable |
|---|---|---|
| Jaeger (OTLP/HTTP) | (always available) | OTEL_EXPORTER_OTLP_ENDPOINT or JAEGER_ENDPOINT |
| Zipkin | zipkin | ZIPKIN_ENDPOINT (e.g. http://localhost:9411) |
| DataDog | datadog | DD_AGENT_HOST + optional DD_AGENT_PORT |
Each PipelineSpan represents one pipeline stage and is exported as a
child span under a root span keyed to the request_id.
§Design
- The exporter is backend-agnostic at the type level; the active backend is selected at runtime from environment variables.
- All export paths are async and non-blocking.
- Failures are soft: a warning is logged, but the pipeline is not affected.
§Relationship to existing OTel setup
The existing try_build_otel_layer in lib.rs wires per-stage tracing
spans automatically via tracing_opentelemetry. This module provides an
additional, explicit exporter path that works without the global
subscriber for environments that prefer push-based trace export.
Structs§
- Pipeline
Span - A single pipeline stage span, ready for export.
- Request
Trace - A complete request-level trace with all child stage spans.
- Trace
Exporter - Exports
RequestTraceobjects to the configured observability backend. - Trace
Exporter Config - Configuration for the
TraceExporter.
Enums§
- Pipeline
Stage - The five pipeline stages, in order.
- Trace
Backend - Which backend to export traces to.
- Trace
Export Error - Errors produced by the trace exporter.