micrometer icon indicating copy to clipboard operation
micrometer copied to clipboard

Upgrade to Apache HttpComponents Client 5.3.0

Open cachescrubber opened this issue 1 year ago • 8 comments

Apache HttpComponents follow-up.

This is a follow-up to the changes made to the HttpComponents instrumentation in #3800 and #3941, specially to the latter. To solve the issues left I filed HTTPCLIENT-2291 and asked for clarification of the documentation in regard to the exec chain behavior in case of retries. The javadoc for (Async)ExecChainHandler has been updated in this pr. Both changes are scheduled with the release 5.3.0 of httpclient5.

With the changes in 5.3.0 the ObservationExecChainHandler could be safely positioned before or after the retry exec chain element. Async or classic exec chain behavior would be identical. In micrometer, only the javadoc of ObservationExecChainHandler had to be adjusted accordingly, the current implementation would be just fine.

As an opinionated version of the instrumentation I would recommend to document the following:

meter request as a whole, without individual retries

addExecInterceptorFirst("micrometer", new ObservationExecChainHandler(observationRegistry));

meter retries individually

addExecInterceptorAfter(ChainElement.RETRY.name(), "micrometer", new ObservationExecChainHandler(observationRegistry));

I don't know exactly when httpclient5 5.3.0 will be released, but IMO it will be rather short term. So with a bit of luck it might be picked up by micrometer 1.12.0.

@bclozel FYI

cachescrubber avatar Sep 18 '23 15:09 cachescrubber

I renamed the issue to Upgrade to Apache HttpComponents Client 5.3.0. The release is scheduled for the coming weeks, obviously too late for 1.12.0.

cachescrubber avatar Nov 17 '23 09:11 cachescrubber

Hey @cachescrubber, are you willing to file a PR?

marcingrzejszczak avatar Dec 28 '23 14:12 marcingrzejszczak

Hi @marcingrzejszczak I can file a PR.

Ideally I could create a Section on Apache HttpComponents instrumentation in the Reference Instrumentations section of the documentation. Would that be feasible?

Target version would be 1.13, right?

cachescrubber avatar Jan 08 '24 08:01 cachescrubber

Correct on both questions. Target 1.13, and reference instrumentations section :)

marcingrzejszczak avatar Jan 10 '24 11:01 marcingrzejszczak

Ok, fine. One more question - I there a timeline for removal of the deprecated http-client 4 supports and the initial Interceptor / requestExecutor? The deprecations are not marked forRemoval and no further information is given in the javadoc.

cachescrubber avatar Jan 10 '24 13:01 cachescrubber

@shakuzen @jonatan-ivanov I don't remember what was the decision about the deprecation time line, do you?

marcingrzejszczak avatar Jan 10 '24 14:01 marcingrzejszczak

fyi: We have 5.3.x in main: https://github.com/micrometer-metrics/micrometer/pull/4470. I'm not sure we do have such a deprecation timeline. I would say we should keep the 4.x support as long as 4.x is supported by Apache (assuming Micrometer users use it). The last release of 4.x was back in 2022 November though from their status page, it seems the version is still supported: https://hc.apache.org/status.html

jonatan-ivanov avatar Feb 07 '24 01:02 jonatan-ivanov

I finally managed to create the discussed documentation section.

cachescrubber avatar Mar 18 '24 14:03 cachescrubber