Skip to content
Merged
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ release.

- Align definition of Baggage with W3C Specification.
([#3800](https://github.com/open-telemetry/opentelemetry-specification/pull/3800))
- Specify allowed characters for Baggage keys and values.
([#3801](https://github.com/open-telemetry/opentelemetry-specification/pull/3801))

### Traces

Expand Down
21 changes: 21 additions & 0 deletions specification/baggage/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,27 @@ with _exactly one value_. This is more restrictive than the [W3C Baggage
Specification, § 3.2.1.1](https://www.w3.org/TR/baggage/#baggage-string)
which allows duplicate entries for a given name.

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

Baggage **values** are any valid UTF-8 strings. Language API MUST accept
any valid UTF-8 string as baggage **value** in `Set` and return the same
value from `Get`.

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).

Example:

```
baggage.Set('a', 'B% 💼');
baggage.Set('A', 'c');
baggage.Get('a'); // returns "B% 💼"
baggage.Get('A'); // returns "c"
```

The Baggage API consists of:

- the `Baggage` as a logical container
Expand Down