Overview
Add request-level tracing using OpenTelemetry that propagates trace context across the API, worker, and Stellar Horizon calls for end-to-end visibility.
Motivation
When a transfer fails mid-settlement, there is no way to trace the full lifecycle of that request across the API handler, queue dispatch, worker processing, and Horizon submission. Distributed tracing enables operators to pinpoint exactly where failures occur.
Proposed Design
- Instrument the HTTP server with OpenTelemetry for automatic span creation
- Propagate trace context into Asynq job metadata so worker jobs inherit parent traces
- Instrument Horizon client calls to create child spans
- Export traces to configurable OTEL_EXPORTER_ENDPOINT (supports Jaeger, Grafana Tempo, etc.)
- Add trace_id to all log entries for correlation
- Make tracing opt-in via OTEL_ENABLED=true env var (disabled by default)
Acceptance Criteria
Overview
Add request-level tracing using OpenTelemetry that propagates trace context across the API, worker, and Stellar Horizon calls for end-to-end visibility.
Motivation
When a transfer fails mid-settlement, there is no way to trace the full lifecycle of that request across the API handler, queue dispatch, worker processing, and Horizon submission. Distributed tracing enables operators to pinpoint exactly where failures occur.
Proposed Design
Acceptance Criteria