Skip to content

Commit 1102efa

Browse files
authored
Update the docs on the TextMapPropagator to be closer to the specification. (open-telemetry#2931)
1 parent bf5fa57 commit 1102efa

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

api/context/src/main/java/io/opentelemetry/context/propagation/TextMapPropagator.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ static TextMapPropagator noop() {
100100
Collection<String> fields();
101101

102102
/**
103-
* Injects the value downstream, for example as HTTP headers. The carrier may be null to
103+
* Injects data for downstream consumers, for example as HTTP headers. The carrier may be null to
104104
* facilitate calling this method with a lambda for the {@link TextMapSetter}, in which case that
105105
* null will be passed to the {@link TextMapSetter} implementation.
106106
*
@@ -112,17 +112,17 @@ static TextMapPropagator noop() {
112112
<C> void inject(Context context, @Nullable C carrier, TextMapSetter<C> setter);
113113

114114
/**
115-
* Extracts the value from upstream. For example, as http headers.
115+
* Extracts data from upstream. For example, from incoming http headers. The returned Context
116+
* should contain the extracted data, if any, merged with the data from the passed-in Context.
116117
*
117-
* <p>If the value could not be parsed, the underlying implementation will decide to set an object
118-
* representing either an empty value, an invalid value, or a valid value. Implementation must not
119-
* set {@code null}.
118+
* <p>If the incoming information could not be parsed, implementations MUST return the original
119+
* Context, unaltered.
120120
*
121121
* @param context the {@code Context} used to store the extracted value.
122122
* @param carrier holds propagation fields. For example, an outgoing message or http request.
123-
* @param getter invoked for each propagation key to get.
124-
* @param <C> carrier of propagation fields, such as an http request.
125-
* @return the {@code Context} containing the extracted value.
123+
* @param getter invoked for each propagation key to get data from the carrier.
124+
* @param <C> the type of carrier of the propagation fields, such as an http request.
125+
* @return the {@code Context} containing the extracted data.
126126
*/
127127
<C> Context extract(Context context, @Nullable C carrier, TextMapGetter<C> getter);
128128
}

0 commit comments

Comments
 (0)