-
Notifications
You must be signed in to change notification settings - Fork 847
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
Hide default context propagators implementation behind interface. #2089
Hide default context propagators implementation behind interface. #2089
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2089 +/- ##
=========================================
Coverage ? 85.35%
Complexity ? 2099
=========================================
Files ? 239
Lines ? 8032
Branches ? 879
=========================================
Hits ? 6856
Misses ? 848
Partials ? 328
Continue to review full report at Codecov.
|
I realized if we removed |
I know there are plans for BinaryPropagators, but I haven't been following when that might land. |
The spec issue seems rather dormant: open-telemetry/opentelemetry-specification#437 |
* TextMapPropagator} added, and extraction and injection will execute every {@link | ||
* TextMapPropagator} in order. | ||
*/ | ||
public interface ContextPropagatorsBuilder { |
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.
Having an interface for a builder, which is just a list of propagators and a constructor call feels like overkill to me. Is the rationale here to make the agent more easily able to bridge the builder?
Could we ditch the builder entirely and use a pattern like in #2091 where we just have a static method on the ContextPropagators that takes the list of TextMapPropagators?
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.
Yup - it came to mind after sending the PR but before also having the idea of killing ContextPropagators
completely :) Will do so since now I see the binary propagation idea is probably the main reason for this interface.
Thanks - I made some bigger changes, curious what people think.
|
… into hide-default-contextpropagators
* TextMapPropagator.composite( | ||
* HttpTraceContext.getInstance(), | ||
* W3CBaggagePropagator.getInstance(), | ||
* new MyCustomContextPropagator())); |
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.
this usage looks really good to me. 👍
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 preferred the Builder
but hiding the default instance looks great. On that note, TraceMultiPropagator
may need to be lifted too, i.e. no Builder
.
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 for calling out - let me followup with consistency in TraceMultiPropagator
in a bit
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 seems to be more consistent with our other default implementations like DefaultTracer.