Skip to content

Commit 38dc657

Browse files
committed
update Get function in propagators to combine duplicate keys
1 parent 02a1679 commit 38dc657

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-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
- Prefer global user defined limits over model-sepcific default values.

specification/context/api-propagators.md

+11-2
Original file line numberDiff line numberDiff line change
@@ -216,14 +216,23 @@ 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.
220221

221222
Required arguments:
222223

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

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.
227+
The Get function is responsible for handling case sensitivity. If the getter is
228+
intended to work with a HTTP request object, the getter MUST be case
229+
insensitive.
230+
231+
If the getter is intended to work with the builtin propagators and the carrier
232+
is a type that allows duplicate keys, like a list or array as opposed to a
233+
dictionary, then the Get function MUST get all the values for the key and
234+
combine them in order separated by a comma as described in
235+
[RFC7230](https://httpwg.org/specs/rfc7230.html#field.order).
227236

228237
## Injectors and Extractors as Separate Interfaces
229238

0 commit comments

Comments
 (0)