Skip to content

Commit

Permalink
update Get function in propagators to combine duplicate keys
Browse files Browse the repository at this point in the history
  • Loading branch information
tsloughter committed Sep 17, 2021
1 parent 02a1679 commit 1c8446b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ release.

### Context

- Update `Get` function used in `TextMapPropagator` extraction to combine the
values of duplicate keys ([#1884](https://github.com/open-telemetry/opentelemetry-specification/pull/1884))

### Traces

- Prefer global user defined limits over model-sepcific default values.
Expand Down
13 changes: 11 additions & 2 deletions specification/context/api-propagators.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,14 +216,23 @@ For example, it can be used to detect all keys following the `uberctx-{user-defi

##### Get

The Get function MUST return the first value of the given propagation key or return null if the key doesn't exist.
The Get function returns the value for a given propagation key or returns null if
the key doesn't exist.

Required arguments:

- the carrier of propagation fields, such as an HTTP request.
- the key of the field.

The Get function is responsible for handling case sensitivity. If the getter is intended to work with a HTTP request object, the getter MUST be case insensitive.
The Get function is responsible for handling case sensitivity. If the getter is
intended to work with a HTTP request object, the getter MUST be case
insensitive.

If the getter is intended to work with the builtin propagators and the carrier
is a type that allows duplicate keys, like a list or array as opposed to a
dictionary, then the Get function MUST get all the values for the key and
combine them in order separated by a comma as described in
[RFC7230](https://httpwg.org/specs/rfc7230.html#field.order).

## Injectors and Extractors as Separate Interfaces

Expand Down

0 comments on commit 1c8446b

Please sign in to comment.