Skip to content

Commit eadf7b8

Browse files
committed
update Get function in propagators to combine duplicate keys
1 parent 8726861 commit eadf7b8

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ release.
99

1010
### Context
1111

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

1417
- Add InstrumentationLibrary to Sampler.ShouldSample.

specification/context/api-propagators.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -216,14 +216,19 @@ For example, it can be used to detect all keys following the `uberctx-{user-defi
216216

217217
##### Get
218218

219-
The Get function MUST return the first value of the given propagation key or return null if the key doesn't exist.
219+
The Get function returns the value for a given propagation key or returns null if
220+
the key doesn't exist. If the carrier is a type that allows duplicate keys, like
221+
a list or array as opposed to a dictionary, then `Get` MUST get all the values
222+
for the key and combine them in order separated by a comma as described in [RFC7230](https://httpwg.org/specs/rfc7230.html#field.order).
220223

221224
Required arguments:
222225

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

226-
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.
229+
The Get function is responsible for handling case sensitivity. If the getter is
230+
intended to work with a HTTP request object, the getter MUST be case
231+
insensitive.
227232

228233
## Injectors and Extractors as Separate Interfaces
229234

0 commit comments

Comments
 (0)