feat(tracing): migrate from OpenTracing/Jaeger to OpenTelemetry#5456
feat(tracing): migrate from OpenTracing/Jaeger to OpenTelemetry#5456martinconic wants to merge 10 commits into
Conversation
sbackend123
left a comment
There was a problem hiding this comment.
I would explicitly call out in the PR description and in the docs which configuration flags were added / removed and that the tracing endpoint semantics changed. Without that, anyone still on the old configuration may be caught off guard.
gacevicljubisa
left a comment
There was a problem hiding this comment.
I would explicitly call out in the PR description and in the docs which configuration flags were added / removed and that the tracing endpoint semantics changed. Without that, anyone still on the old configuration may be caught off guard.
Yes, I agree. Updating the node with old config will result with "unknown flag" error.
Also, this is breaking change for the tracing for the node operators who are using tracing, they will need to switch to OTLP receiver, instead of jaeger UDP agent.
Additionally, OTel has a second exporter, otlptracegrpc. It might be worth to expose a tracing-otlp-protocol: http|grpc flag (defaulting to http), so operators can choose.
…migration # Conflicts: # cmd/bee/cmd/start.go
There was a problem hiding this comment.
I have suggested some change, comments are mostly suggestions, not blockers, but overal looks good. It would be great if certificate loading logic is tested and validated.
Also, please edit the PR desc, to match the implementation for tracing-otlp-insecure flag, and add tracing-otlp-ca-file to table.
| } | ||
| // httpPropagator carries trace context across HTTP via the W3C TraceContext | ||
| // standard headers (traceparent, tracestate). | ||
| var httpPropagator propagation.TextMapPropagator = propagation.TraceContext{} |
There was a problem hiding this comment.
maybe move to the top with the other package-level vars
| } | ||
|
|
||
| ratio := o.SamplingRatio | ||
| if ratio < 0 { |
There was a problem hiding this comment.
mybe to add: if ratio > 1 { ratio = 1 }
| if t == nil { | ||
| t = noopTracer | ||
| // Supported OTLP transport values for Options.Protocol. | ||
| const ( |
There was a problem hiding this comment.
also, move this to the top
|
|
||
| headers[p2p.HeaderNameTracingSpanContext] = b.Bytes() | ||
| // AddContextHeader serialises the active span context into the bee p2p header. | ||
| // It is safe to call on a nil receiver. |
There was a problem hiding this comment.
Delete this claim from all methods, or add the gurd:
if t == nil {
t = noopTracer
}
because Tracer is exposed and it can be used without constructor.
| if parent := FromContext(ctx); parent.IsValid() { | ||
| ctx = trace.ContextWithSpanContext(ctx, parent) | ||
| } |
There was a problem hiding this comment.
FromContext reads using trace.SpanContextFromContext(ctx). Setting it with trace.ContextWithSpanContext(ctx, parent) writes to the same context key value pair.
I think this can be removed?
Checklist
Description
Migrates bee's tracing stack from the archived OpenTracing API and
deprecated
jaeger-client-goto the OpenTelemetry Go SDK with anOTLP exporter. The wrapper at
pkg/tracingkeeps a familiar APIshape so the call-site sweep is bounded to ~8 production files plus
the test suite.
Closes #5010.
The Jaeger UDP agent on port
:6831is no longer the receiver. Operatorsmust run an OTLP-capable collector (Jaeger v2, OpenTelemetry Collector, or any
backend with an OTLP receiver) and point bee at it. Upgrading a node with the
old config keys will fail startup with an
unknown parameterserror.Configuration flags
Removed:
tracing-endpoint(replaced bytracing-otlp-endpoint)tracing-host/tracing-port(folded intotracing-otlp-endpoint)Added:
tracing-otlp-endpoint127.0.0.1:4318host:port(default port is4318forhttp,4317forgrpc)tracing-otlp-insecuretruetracing-otlp-protocolhttphttporgrpctracing-sampling-ratio1.0[0, 1];0samples nothing,1samples everythingUnchanged:
tracing-enable,tracing-service-name.Nested YAML form
Tracing keys now also accept the nested form (mirroring
blockchain-rpc.*):Flat tracing-* keys still work; if both are present in the same config file,
the nested form wins and a warning is logged.
Wire-format compatibility
Spans propagated across libp2p streams use a new versioned binary carrier, and
the standard W3C traceparent header is used over HTTP. Mixed-version peers
will start fresh traces at the boundary rather than continuing the old Jaeger
binary format.
Coordination
Requires a paired beekeeper update — the workflow at
.github/workflows/beekeeper.yml temporarily points at
BEEKEEPER_BRANCH: feat/bee-otlp-tracing-config and must be flipped back to
master before merging this PR (and after the beekeeper PR lands).
Motivation and Context (Optional)
OpenTracing is archived and jaeger-client-go is deprecated; OpenTelemetry is
the supported successor. Migrating now lets bee plug into any OTLP-capable
backend (Jaeger v2, OTel Collector, vendor agents) and unlocks adopting
semconv and tail-sampling at the collector layer in follow-up work.
AI Disclosure