Skip to content

feat(otel): optional OpenTelemetry tracing (ADR-0025)#6

Merged
muhammetsafak merged 1 commit into
mainfrom
feat/otel
Jun 19, 2026
Merged

feat(otel): optional OpenTelemetry tracing (ADR-0025)#6
muhammetsafak merged 1 commit into
mainfrom
feat/otel

Conversation

@muhammetsafak

Copy link
Copy Markdown
Member

Adds an optional babelqueue-go/otel module — its own go.mod, so the zero-dependency core never imports OpenTelemetry (GR-7). Implements ADR-0025.

What

  • trace_id ↔ OTel TraceID mapping (a UUID maps to its 16 bytes; otherwise SHA-256). The already-propagated trace_id becomes the shared OTel trace across every hop/SDK — no envelope change (GR-1), no transport change.
  • WrapHandler(tracer, handler) — a CONSUMER span process <urn> in the trace_id-derived trace, with messaging-semconv attributes + error/status. Mirrors the idempotency/schema Wrap shape.
  • Publish(ctx, tracer, app, urn, data) — a PRODUCER span publish <urn> that carries the active trace into the message's trace_id.

Tests / CI

  • 5 tests via an in-memory span recorder; coverage 95.7%, -race clean.
  • Wired into ci.yml (transport-modules step, network-free) and release.yml (otel/v* tag). go 1.21 for full-matrix coverage.

Honest limit

One correlated trace per trace_id; exact cross-hop span parent-child (W3C traceparent as a transport header) is the documented follow-up.

🤖 Generated with Claude Code

A new optional babelqueue-go/otel module (its own go.mod, so the core stays zero-dep) that emits produce/consume spans correlated across hops via trace_id<->OTel TraceID: WrapHandler (consumer span) and Publish (producer span). Wired into CI (transport-modules step) and release.yml (otel/v* tag). Envelope untouched (GR-1); opt-in.
@muhammetsafak muhammetsafak merged commit 6c7d1e1 into main Jun 19, 2026
12 checks passed
@muhammetsafak muhammetsafak deleted the feat/otel branch June 19, 2026 02:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant