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

update Get function in propagators to combine duplicate keys #1884

Closed
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
dictionary, then the Get function MUST get all the values for the key and
dictionary, then the Get function SHOULD 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