-
Notifications
You must be signed in to change notification settings - Fork 848
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
Now MultiTextMapPropagator
allows to select extractors and injectors separately
#3366
Conversation
Signed-off-by: Francesco Guardiani <[email protected]>
|
@slinkydeveloper this proposed change includes additions to stable public APIs. Can you run |
...xt/src/main/java/io/opentelemetry/context/propagation/CompositeTextMapPropagatorBuilder.java
Outdated
Show resolved
Hide resolved
...xt/src/main/java/io/opentelemetry/context/propagation/CompositeTextMapPropagatorBuilder.java
Outdated
Show resolved
Hide resolved
...xt/src/main/java/io/opentelemetry/context/propagation/CompositeTextMapPropagatorBuilder.java
Outdated
Show resolved
Hide resolved
...xt/src/main/java/io/opentelemetry/context/propagation/CompositeTextMapPropagatorBuilder.java
Outdated
Show resolved
Hide resolved
...xt/src/main/java/io/opentelemetry/context/propagation/CompositeTextMapPropagatorBuilder.java
Outdated
Show resolved
Hide resolved
...xt/src/main/java/io/opentelemetry/context/propagation/CompositeTextMapPropagatorBuilder.java
Show resolved
Hide resolved
...xt/src/main/java/io/opentelemetry/context/propagation/CompositeTextMapPropagatorBuilder.java
Outdated
Show resolved
Hide resolved
context/src/main/java/io/opentelemetry/context/propagation/MultiTextMapPropagator.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Francesco Guardiani <[email protected]>
Signed-off-by: Francesco Guardiani <[email protected]>
Signed-off-by: Francesco Guardiani <[email protected]>
Signed-off-by: Francesco Guardiani <[email protected]>
Pushed the doc changes as well |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
this.injectors = new TextMapPropagator[injectors.size()]; | ||
injectors.toArray(this.injectors); | ||
|
||
this.allFields = Collections.unmodifiableList(getAllFields(this.injectors)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this right? The fields are only from the injectors? I think this might need to be the union of the extractors and injectors, rather than just the injectors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's not what I understood from the fields()
javadoc, it rather seems to me that method is used only when writing the context back to the wire, and not while extracting it...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the javadoc provides that as a usage (to clear out headers if the header implementation is re-used), but I think fields()
could also be used by extraction in some cases. I'm honestly not 100% sure what the behavior should be in this case when injection doesn't necessarily match extraction.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I created a spec issue for this, since I don't think I know what the answer should be: open-telemetry/opentelemetry-specification#1809
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I second @jkwatson with this - I know at least one case in instrumentation where fields
are considered during extraction (see io.opentelemetry.instrumentation.awslambda.v1_0.TracingRequestStreamHandler
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please comment on the spec issue. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Weighting issues - sub-optimal performance vs actual bug I'd say that keeping all fields still wins. But yeah, spec issue is the proper place to discuss this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kubawach please provide a permalink to your example of TracingRequestStreamHandler, I couldn't find it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kubawach thanks. If I am reading this correctly, I wouldn't classify this usage as "on the extract path", and I probably would've implemented that check differently in the first place, the use of fields() to determine "noHttpPropagationNeeded" seems a bit round-about. Here's the exact usage link, for reference:
Codecov Report
@@ Coverage Diff @@
## main #3366 +/- ##
===========================================
+ Coverage 0 90.96% +90.96%
- Complexity 0 3172 +3172
===========================================
Files 0 364 +364
Lines 0 9794 +9794
Branches 0 983 +983
===========================================
+ Hits 0 8909 +8909
- Misses 0 585 +585
- Partials 0 300 +300
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definition of fields
with separate injectors / extractors needs clarification before merging.
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
Closed as inactive. Feel free to reopen if this PR is still being worked on. |
Fix #3364
This PR includes:
MultiTextMapPropagator
to select extractors and injectors separately, also rename the class toCompositeTextMapPropagator
CompositeTextMapPropagatorBuilder
Signed-off-by: Francesco Guardiani [email protected]