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 Aug 23, 2021
1 parent 8726861 commit eadf7b8
Show file tree
Hide file tree
Showing 2 changed files with 10 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

- Add InstrumentationLibrary to Sampler.ShouldSample.
Expand Down
9 changes: 7 additions & 2 deletions specification/context/api-propagators.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,14 +216,19 @@ 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. If the carrier is a type that allows duplicate keys, like
a list or array as opposed to a dictionary, then `Get` 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).

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.

## Injectors and Extractors as Separate Interfaces

Expand Down

0 comments on commit eadf7b8

Please sign in to comment.