Skip to content

Commit

Permalink
instrumentation: use a more appropriate propagator.
Browse files Browse the repository at this point in the history
Use a correct propagator for ttRPC (and gRPC) span propagation.
Without this, ttRPC (or gRPC) span information are not properly
transmitted over the IPC. As a side effect, spans generated at
the RPC server end of the IPC do not get properly nested under
the related spans generated on the originator side.

Signed-off-by: Krisztian Litkey <[email protected]>
  • Loading branch information
klihub committed Jun 26, 2023
1 parent 893a277 commit d4662a2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/instrumentation/tracing/tracing.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"go.opentelemetry.io/otel/exporters/jaeger"
"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc"
"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp"
"go.opentelemetry.io/otel/propagation"
"go.opentelemetry.io/otel/sdk/resource"
sdktrace "go.opentelemetry.io/otel/sdk/trace"
semconv "go.opentelemetry.io/otel/semconv/v1.17.0"
Expand Down Expand Up @@ -168,6 +169,12 @@ func (t *tracing) start(options ...Option) error {

otel.SetTracerProvider(provider)

propagator := propagation.NewCompositeTextMapPropagator(
propagation.TraceContext{},
propagation.Baggage{},
)
otel.SetTextMapPropagator(propagator)

return nil
}

Expand Down

0 comments on commit d4662a2

Please sign in to comment.