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

Propagation - Extract handles multiple values on carrier using same key #4295

Merged
Merged
Show file tree
Hide file tree
Changes from 3 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

- Propagation - Extract handles multiple values on carrier using same key.
jamesmoessis marked this conversation as resolved.
Show resolved Hide resolved
[#4295](https://github.com/open-telemetry/opentelemetry-specification/pull/4295)

### Traces

### Metrics
Expand Down
23 changes: 21 additions & 2 deletions specification/context/api-propagators.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
+ [Getter argument](#getter-argument)
- [Keys](#keys)
- [Get](#get)
- [GetAll](#getall)
- [Injectors and Extractors as Separate Interfaces](#injectors-and-extractors-as-separate-interfaces)
- [Composite Propagator](#composite-propagator)
* [Create a Composite Propagator](#create-a-composite-propagator)
Expand Down Expand Up @@ -196,11 +197,11 @@ Returns a new `Context` derived from the `Context` passed as argument.

#### Getter argument

Getter is an argument in `Extract` that get value from given field
Getter is an argument in `Extract` that gets value(s) from given field.

`Getter` allows a `TextMapPropagator` to read propagated fields from a carrier.

One of the ways to implement it is `Getter` class with `Get` and `Keys` methods
One of the ways to implement it is `Getter` class with methods `Get`, `Keys`, and `GetAll`
as described below. Languages may decide on alternative implementations and
expose corresponding methods as delegates or other ways.

Expand Down Expand Up @@ -229,6 +230,24 @@ Required arguments:

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.
jamesmoessis marked this conversation as resolved.
Show resolved Hide resolved

##### GetAll
pellared marked this conversation as resolved.
Show resolved Hide resolved

jamesmoessis marked this conversation as resolved.
Show resolved Hide resolved
The GetAll function MUST NOT require explicit implementation to satisfy the base `Getter` type.
jamesmoessis marked this conversation as resolved.
Show resolved Hide resolved
Language implementations have the flexibility to incorporate this optional
functionality in various ways, such as by providing a default GetAll method, or
by creating a new type that extends the base `Getter` type.

If explicitly implemented, the GetAll function MUST return all values of the given propagation key.
It SHOULD return them in the same order as they appear in the carrier.
If the key doesn't exist, it SHOULD return an empty collection.
jamesmoessis marked this conversation as resolved.
Show resolved Hide resolved

Required arguments:

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

The GetAll 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.
jamesmoessis marked this conversation as resolved.
Show resolved Hide resolved

## Injectors and Extractors as Separate Interfaces

Languages can choose to implement a `Propagator` type as a single object
Expand Down
Loading