open-telemetry / opentelemetry-go

OpenTelemetry Go API and SDK
https://opentelemetry.io/docs/languages/go
Apache License 2.0
5.21k stars 1.05k forks source link

How to properly do context propagation (http & grpc)? #1091

Closed moorara closed 4 years ago

moorara commented 4 years ago

With http and grpc examples removed (and related instrumentation packages) in v0.11.0, I see three options for injecting and extracting correlation contexts:

How are these three approaches different and which one is recommended?

MrAlias commented 4 years ago

The examples and instrumentation have been moved BTW:

To answer the question directly though, nothing has changed an you would still use propagation.ExtractHTTP and propagation.InjectHTTP with the configured or global propagators.

These will likely change names in an upcoming release as they have been renamed at the specification level.