feat(otel): optional OpenTelemetry tracing (ADR-0025)#6
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds an optional
babelqueue-go/otelmodule — its owngo.mod, so the zero-dependency core never imports OpenTelemetry (GR-7). Implements ADR-0025.What
trace_id↔ OTelTraceIDmapping (a UUID maps to its 16 bytes; otherwise SHA-256). The already-propagatedtrace_idbecomes the shared OTel trace across every hop/SDK — no envelope change (GR-1), no transport change.WrapHandler(tracer, handler)— a CONSUMER spanprocess <urn>in thetrace_id-derived trace, with messaging-semconv attributes + error/status. Mirrors the idempotency/schemaWrapshape.Publish(ctx, tracer, app, urn, data)— a PRODUCER spanpublish <urn>that carries the active trace into the message'strace_id.Tests / CI
-raceclean.ci.yml(transport-modules step, network-free) andrelease.yml(otel/v*tag).go 1.21for full-matrix coverage.Honest limit
One correlated trace per
trace_id; exact cross-hop span parent-child (W3Ctraceparentas a transport header) is the documented follow-up.🤖 Generated with Claude Code