Skip to content

Conversation

@gmellemstrand
Copy link

This relates to #1443

In additon to the build method, I've added a new public method which adds the http tracing to the builder. This new method can be called instead of the build method in the builder is required in order to add additional options before building. The functionality should be identical for current users.

@codefromthecrypt
Copy link
Member

@reta @kojilin can you consider this when updating httpclient5 for the 5.4 break?

return new HttpClient5Tracing(httpTracing);
}

public HttpClientBuilder addTracingToBuilder(HttpClientBuilder builder) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants