wyhaines / opentelemetry-api.cr

The core of open telemetry instrumentation is the OpenTelemetry API/SDK. The initial aim of this shard is to implement the OpenTelemetry specification for metrics, traces, and logs.
Apache License 2.0
12 stars 1 forks source link

Implement Baggage #6

Open wyhaines opened 2 years ago

wyhaines commented 2 years ago

https://www.w3.org/TR/baggage/

Now that Context and TraceContext work, a Baggage implementation should be straightforward.

Baggage is a mechanism for sharing state (context) during a distributed request. Whereas tracestate is intended to be used specifically for parameters that are relevant to the tracing mechanisms in use, Baggage is a general-purpose mechanism intended to provide a header that can be used to share arbitrary data throughout a distributed trace.

Its implementation can be significantly lifted from that of TraceContext (and, in fact, I think that some of what TraceContext does may be overzealous, and should be removed when it is implemented in Baggage, particularly as it relates to the OpenTelemetry::Context parameters being inserted into tracestate).