Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify allowed characters for Baggage keys and values #3801

Merged
merged 14 commits into from
Feb 22, 2024
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ release.

## Unreleased

### Context
### Context & Baggage

- Specify allowed characters for Baggage keys and values.
yurishkuro marked this conversation as resolved.
Show resolved Hide resolved
([#3801](https://github.com/open-telemetry/opentelemetry-specification/pull/3801))

### Traces

Expand Down
13 changes: 13 additions & 0 deletions specification/baggage/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,19 @@ metrics, traces, and logs. It is a set of name/value pairs describing
user-defined properties. Each name in `Baggage` MUST be associated with
exactly one value.

Baggage **names** are strings that satisfy the `token` definition from
yurishkuro marked this conversation as resolved.
Show resolved Hide resolved
[RFC7230, Section 3.2.6](https://tools.ietf.org/html/rfc7230#section-3.2.6).
Alpha-numeric names are strongly recommended. Language API MAY return
yurishkuro marked this conversation as resolved.
Show resolved Hide resolved
an error when given a baggage name that is not a `token`.
yurishkuro marked this conversation as resolved.
Show resolved Hide resolved

Baggage **values** are any valid UTF-8 strings. Language API MUST accept
any valid UTF-8 string as baggage value. Language API MUST guarantee that
yurishkuro marked this conversation as resolved.
Show resolved Hide resolved
`Get` and `Set` operations are symmetrical with respect to name and value,
yurishkuro marked this conversation as resolved.
Show resolved Hide resolved
i.e. `Get` MUST return the same **value** string as received in `Set`.
yurishkuro marked this conversation as resolved.
Show resolved Hide resolved

Language API MUST treat both baggage names and values as case sensitive.
See also [W3C Baggage -- Case sensitivity of keys](https://github.com/w3c/baggage/blob/main/baggage/HTTP_HEADER_FORMAT_RATIONALE.md#case-sensitivity-of-keys).
yurishkuro marked this conversation as resolved.
Show resolved Hide resolved

The Baggage API consists of:

- the `Baggage`
Expand Down