Expose builder for apache http5#1444
Open
gmellemstrand wants to merge 1 commit intoopenzipkin:masterfrom
Open
Conversation
Member
reta
reviewed
Feb 16, 2025
| return new HttpClient5Tracing(httpTracing); | ||
| } | ||
|
|
||
| public HttpClientBuilder addTracingToBuilder(HttpClientBuilder builder) { |
Contributor
There was a problem hiding this comment.
@gmellemstrand I believe, adding additional method like this would introduce conflicting (addTracingToBuilder vs build) instrumentation and confusion (when addTracingToBuilder should be used and why). I would recommend to have a factory method instead, fe:
Suggested change
| public HttpClientBuilder addTracingToBuilder(HttpClientBuilder builder) { | |
| public static HttpClient5CustomTracing newBuilder(HttpTracing httpTracing, HttpClientBuilder builder) { | |
| return new HttpClient5CustomTracing(httpTracing, builder); | |
| } |
In this case the HttpClient5CustomTracing type would take care of adding tracing to the provided HttpClientBuilder as well as having a build() method with no args.
@codefromthecrypt does it make sense to you?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This relates to #1443
In additon to the
buildmethod, I've added a new public method which adds the http tracing to the builder. This new method can be called instead of thebuildmethod in the builder is required in order to add additional options before building. The functionality should be identical for current users.