Skip to content

Commit

Permalink
Deprecate HttpComponents 4.x client instrumentation
Browse files Browse the repository at this point in the history
Because HttpComponents 4.x is in maintenance mode and the existing
instrumentation in Micrometer has known issues that cannot be fixed
because we lack the required infrastructure in HttpComponents, this
commit deprecates the 4.x instrumentation in favor of an upgrade to
HttpComponents 5.x and the instrumentation provided here.

Closes gh-3932
  • Loading branch information
bclozel committed Jun 27, 2023
1 parent 131d50d commit 89cacbe
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@
* for Apache HTTP client 5 support.
*
* @since 1.10.0
* @deprecated as of 1.12.0 in favor of HttpComponents 5.x and
* {@link io.micrometer.core.instrument.binder.httpcomponents.hc5.ApacheHttpClientContext}.
*/
@Deprecated
public class ApacheHttpClientContext extends RequestReplySenderContext<HttpRequest, HttpResponse> {

private final HttpContext apacheHttpContext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@
*
* @since 1.10.0
* @see DefaultApacheHttpClientObservationConvention
* @deprecated as of 1.12.0 in favor of HttpComponents 5.x and
* {@link io.micrometer.core.instrument.binder.httpcomponents.hc5.ApacheHttpClientObservationConvention}.
*/
@Deprecated
public interface ApacheHttpClientObservationConvention extends ObservationConvention<ApacheHttpClientContext> {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@
*
* @since 1.10.0
* @see MicrometerHttpRequestExecutor
* @deprecated as of 1.12.0 in favor of HttpComponents 5.x and
* {@link io.micrometer.core.instrument.binder.httpcomponents.hc5.ApacheHttpClientObservationDocumentation}.
*/
@Deprecated
public enum ApacheHttpClientObservationDocumentation implements ObservationDocumentation {

DEFAULT {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@
*
* @since 1.10.0
* @see ApacheHttpClientObservationDocumentation
* @deprecated as of 1.12.0 in favor of HttpComponents 5.x and
* {@link io.micrometer.core.instrument.binder.httpcomponents.hc5.ApacheHttpClientObservationConvention}.
*/
@Deprecated
public class DefaultApacheHttpClientObservationConvention implements ApacheHttpClientObservationConvention {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import org.apache.http.conn.routing.HttpRoute;
import org.apache.http.protocol.HttpContext;

@Deprecated
class HttpContextUtils {

static Tags generateTagsForRoute(HttpContext context) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,11 @@
*
* @author Jon Schneider
* @since 1.4.0
* @deprecated as of 1.12.0 in favor of HttpComponents 5.x and
* {@link ObservationExecChainHandler}.
*/
@Incubating(since = "1.4.0")
@Deprecated
public class MicrometerHttpClientInterceptor {

private static final String METER_NAME = "httpcomponents.httpclient.request";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,11 @@
* @author Benjamin Hubert (benjamin.hubert@willhaben.at)
* @author Tommy Ludwig
* @since 1.2.0
* @deprecated as of 1.12.0 in favor of HttpComponents 5.x and
* {@link ObservationExecChainHandler}.
*/
@Incubating(since = "1.2.0")
@Deprecated
public class MicrometerHttpRequestExecutor extends HttpRequestExecutor {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
* @author Johnny Lim
*/
@ExtendWith(WiremockResolver.class)
@Deprecated
class MicrometerHttpClientInterceptorTest {

private MeterRegistry registry;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
* @author Benjamin Hubert (benjamin.hubert@willhaben.at)
*/
@ExtendWith(WiremockResolver.class)
@Deprecated
class MicrometerHttpRequestExecutorTest {

private static final String EXPECTED_METER_NAME = "httpcomponents.httpclient.request";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;

@SuppressWarnings("deprecation")
class ApacheAsyncHttpClientTimingInstrumentationVerificationTests
extends HttpClientTimingInstrumentationVerificationTests<CloseableHttpAsyncClient> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import java.io.IOException;
import java.net.URI;

@Deprecated
class ApacheHttpClientTimingInstrumentationVerificationTests
extends HttpClientTimingInstrumentationVerificationTests<HttpClient> {

Expand Down

0 comments on commit 89cacbe

Please sign in to comment.