From eadf7b8ca159746a6b39d2e2b46cdd4a400b7b07 Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Mon, 23 Aug 2021 08:40:50 -0600 Subject: [PATCH] update Get function in propagators to combine duplicate keys --- CHANGELOG.md | 3 +++ specification/context/api-propagators.md | 9 +++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3088f1c2411..4cf5dfdbed6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/specification/context/api-propagators.md b/specification/context/api-propagators.md index 5059e8d2135..cb33df8d462 100644 --- a/specification/context/api-propagators.md +++ b/specification/context/api-propagators.md @@ -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