You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An important thing to note about baggage is that it is a separate key-value store and is unassociated with attributes on spans, metrics, or logs without explicitly adding them.
To add baggage entries to attributes, you need to explicitly read the data from baggage and add it as attributes to your spans, metrics, or logs.
Because a common use cases for Baggage is to add data to Span Attributes across a whole trace, several languages have Baggage Span Processors that add data from baggage as attributes on span creation.
Story:
As a developer When I want to have information across multiple signals of a span Then I want a way to store them in the baggage, such that they are automatically added to the signal.
Implementation ideas
The simplest form would be to just add the whole baggage as attributes/metadata/.... e.g. with a common, configurable prefix (e.g. defaulting to baggage such that an baggage item foo.bar becomes attribute baggage.foo.far or metadata entry baggage.foo.bar).
A more sophisticated solution would allow to define a list of baggage items (possibly with regex-pattern) that - if present - are added as attributes/metadata/...
An additional improvement would then be to define additional overrides in form of a Lst<Map<String, String> such that the baggaea items are renamed. An entry of "foo.bar" = "baz.bag" would then rename the item from baggage.foo.bar to baz.bang (notice the missing baggage prefix).
The text was updated successfully, but these errors were encountered:
@turing85 Not sure if I read right.
You suggest a simpler way to add data to the Baggage and also include that data in the span attributes. Is this right?
@brunobat adding data to the baggage is easy enough. The important part is an (automated) way to add (parts of) the baggage as signal metadata (attributes in traces, metadata in logs).
Description
When using OpenTelemetry, it can be extremely helpful to use the baggage in order to propagate information. The OpenTelemetry standard supports this idea explicitly (
opentelemetry.io
):Story:
As a developer
When I want to have information across multiple signals of a span
Then I want a way to store them in the baggage, such that they are automatically added to the signal.
Implementation ideas
The simplest form would be to just add the whole baggage as attributes/metadata/.... e.g. with a common, configurable prefix (e.g. defaulting to
baggage
such that an baggage itemfoo.bar
becomes attributebaggage.foo.far
or metadata entrybaggage.foo.bar
).A more sophisticated solution would allow to define a list of baggage items (possibly with regex-pattern) that - if present - are added as attributes/metadata/...
An additional improvement would then be to define additional overrides in form of a
Lst<Map<String, String>
such that the baggaea items are renamed. An entry of"foo.bar" = "baz.bag"
would then rename the item frombaggage.foo.bar
tobaz.bang
(notice the missingbaggage
prefix).The text was updated successfully, but these errors were encountered: