From 7e5be8155bc62882b3326c85dbe49ec4ac7e3589 Mon Sep 17 00:00:00 2001 From: Tyler Yahn Date: Fri, 12 Mar 2021 10:13:14 -0800 Subject: [PATCH 1/5] Clarify composite inject/extract optional arguments If the underlying `TextMapPropagator` does not accept the optional getter and setter arguments it is unreasonable that the composite needs to require these arguments. This updates the API definition to communicate this. --- specification/context/api-propagators.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/specification/context/api-propagators.md b/specification/context/api-propagators.md index f8f603657f5..bc8e3a124e0 100644 --- a/specification/context/api-propagators.md +++ b/specification/context/api-propagators.md @@ -266,6 +266,9 @@ Required arguments: - A `Context`. - The carrier that holds propagation fields. + +If the `TextMapPropagator`'s `Extract` implementation accept the optional `Getter` argument the following arguments are REQUIRED, otherwise they are OPTIONAL: + - The instance of `Getter` invoked for each propagation key to get. ### Composite Inject @@ -274,6 +277,9 @@ Required arguments: - A `Context`. - The carrier that holds propagation fields. + +If the `TextMapPropagator`'s `Inject` implementation accept the optional `Setter` argument the following arguments are REQUIRED, otherwise they are OPTIONAL: + - The `Setter` to set a propagation key/value pair. Propagators MAY invoke it multiple times in order to set multiple pairs. ## Global Propagators From 8319018cd53c2f50517692424e64c9d85d81025c Mon Sep 17 00:00:00 2001 From: Tyler Yahn Date: Fri, 12 Mar 2021 10:16:07 -0800 Subject: [PATCH 2/5] Add changes to changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a359c2e6b16..085aa4fdbad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ release. ## Unreleased +### Context + +- Clarify composite `TextMapPropagator` method required and optional arguments. + ### Traces ### Metrics From 0b89326fffeedbac2e06ad75afd7325efdea5104 Mon Sep 17 00:00:00 2001 From: Tyler Yahn Date: Fri, 12 Mar 2021 10:17:51 -0800 Subject: [PATCH 3/5] Add PR link to changelog entry --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 085aa4fdbad..4bc37b8ad17 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ release. ### Context -- Clarify composite `TextMapPropagator` method required and optional arguments. +- Clarify composite `TextMapPropagator` method required and optional arguments. ([#1541](https://github.com/open-telemetry/opentelemetry-specification/pull/1541)) ### Traces From e0f18c9190e4edbfebf7107bd11b4acd08c2de3e Mon Sep 17 00:00:00 2001 From: Carlos Alberto Cortez Date: Tue, 16 Mar 2021 15:52:29 +0100 Subject: [PATCH 4/5] Update specification/context/api-propagators.md Co-authored-by: Armin Ruech --- specification/context/api-propagators.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/context/api-propagators.md b/specification/context/api-propagators.md index bc8e3a124e0..4fd0e02758f 100644 --- a/specification/context/api-propagators.md +++ b/specification/context/api-propagators.md @@ -267,7 +267,7 @@ Required arguments: - A `Context`. - The carrier that holds propagation fields. -If the `TextMapPropagator`'s `Extract` implementation accept the optional `Getter` argument the following arguments are REQUIRED, otherwise they are OPTIONAL: +If the `TextMapPropagator`'s `Extract` implementation accepts the optional `Getter` argument, the following arguments are REQUIRED, otherwise they are OPTIONAL: - The instance of `Getter` invoked for each propagation key to get. From 4752641f2dd2eb228e9bfe0200e11d24c1fc5878 Mon Sep 17 00:00:00 2001 From: Carlos Alberto Cortez Date: Tue, 16 Mar 2021 15:52:34 +0100 Subject: [PATCH 5/5] Update specification/context/api-propagators.md Co-authored-by: Armin Ruech --- specification/context/api-propagators.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/context/api-propagators.md b/specification/context/api-propagators.md index 4fd0e02758f..198349dfec4 100644 --- a/specification/context/api-propagators.md +++ b/specification/context/api-propagators.md @@ -278,7 +278,7 @@ Required arguments: - A `Context`. - The carrier that holds propagation fields. -If the `TextMapPropagator`'s `Inject` implementation accept the optional `Setter` argument the following arguments are REQUIRED, otherwise they are OPTIONAL: +If the `TextMapPropagator`'s `Inject` implementation accepts the optional `Setter` argument, the following arguments are REQUIRED, otherwise they are OPTIONAL: - The `Setter` to set a propagation key/value pair. Propagators MAY invoke it multiple times in order to set multiple pairs.