internal/trace: back using OpenTelemetry span instead of OpenTracing
Created by: bobheadxi
Now that we export to Jaeger via OpenTelemetry instead of OpenTracing, we can remove a number of OpenTracing-specific things internally and instead operate purely on OpenTelemetry within internal/trace
. OpenTracing calls elsewhere are all translated to OpenTelemetry via the OpenTracing bridge.
This allows us to start leveraging OpenTelemetry APIs more extensively - the codebase can now directly use go.opentelemetry.io/otel/trace
, and internal/trace
has been updated with the addition of:
-
(*internal/trace.Trace).AddEvent
- this is similar toLogFields
, but now accepts a name in the OpenTelemetry spec -
(*internal/trace.Trace).SetAttributes
- this is similar toTagFields
, but uses the OpenTelemetry attributes API
And the deprecation of:
-
(*internal/trace.Trace).LogFields
(useAddEvent
instead) -
(*internal/trace.Trace).TagFields
(useSetAttributes
instead)
As well as the removal of some old adapters that were specific to OpenTracing.
Deprecated APIs will still work, passing through to the updated APIs.
Builds on top of #40709
Test plan
sg run jaeger
sg start
In jaeger
tracing mode, we should see spans as expected: