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

Add Getter's Keys operation. #825

Merged
merged 9 commits into from
Aug 25, 2020
21 changes: 19 additions & 2 deletions specification/context/api-propagators.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Table of Contents
- [Set](#set)
- [Extract](#extract-1)
- [Getter argument](#getter-argument)
- [Keys](#keys)
- [Get](#get)
- [Composite Propagator](#composite-propagator)
- [Global Propagators](#global-propagators)
Expand Down Expand Up @@ -113,7 +114,7 @@ avoid runtime allocations.

### Fields

The propagation fields defined. If your carrier is reused, you should delete the fields here
The predefined propagation fields. If your carrier is reused, you should delete the fields here
before calling [inject](#inject).

Fields are defined as string keys identifying format-specific components in a carrier.
Expand All @@ -129,6 +130,9 @@ The use cases of this are:

Returns list of fields that will be used by the `HttpTextPropagator`.

Observe that some `Propagator`s may define additional fields with variable names, such
as fields with different names simply sharing the `jaeger-` prefix.
carlosalberto marked this conversation as resolved.
Show resolved Hide resolved
carlosalberto marked this conversation as resolved.
Show resolved Hide resolved

### Inject

Injects the value into a carrier. The required arguments are the same as defined by
Expand Down Expand Up @@ -177,7 +181,20 @@ Getter is an argument in `Extract` that get value from given field

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

One of the ways to implement it is `Getter` class with `Get` method as described below.
One of the ways to implement it is `Getter` class with `Get` and `Keys` methods
carlosalberto marked this conversation as resolved.
Show resolved Hide resolved
as described below.
carlosalberto marked this conversation as resolved.
Show resolved Hide resolved

##### Keys

The Keys function MUST return the list of all the keys in the carrier.
carlosalberto marked this conversation as resolved.
Show resolved Hide resolved

Required arguments:

- The carrier of the propagation fields, such as an HTTP request.
carlosalberto marked this conversation as resolved.
Show resolved Hide resolved

The Keys function can be called by `Propagator`s using variable key names in order to
iterate over the entire keys in the specified carrier. For example, it can be used to
detect all keys starting with the prefix `jaeger-`.
carlosalberto marked this conversation as resolved.
Show resolved Hide resolved

##### Get

Expand Down