Class ApacheHttpClientContext

java.lang.Object
io.micrometer.observation.Observation.Context
io.micrometer.observation.transport.SenderContext<org.apache.hc.core5.http.HttpRequest>
io.micrometer.observation.transport.RequestReplySenderContext<org.apache.hc.core5.http.HttpRequest,org.apache.hc.core5.http.HttpResponse>
io.micrometer.core.instrument.binder.httpcomponents.hc5.ApacheHttpClientContext
All Implemented Interfaces:
io.micrometer.observation.Observation.ContextView, io.micrometer.observation.transport.ResponseContext<org.apache.hc.core5.http.HttpResponse>

public class ApacheHttpClientContext extends io.micrometer.observation.transport.RequestReplySenderContext<org.apache.hc.core5.http.HttpRequest,org.apache.hc.core5.http.HttpResponse>
Observation.Context for use with Apache HTTP Client 5 Observation instrumentation.
Since:
1.11.0
  • Constructor Summary

    Constructors
    Constructor
    Description
    ApacheHttpClientContext(org.apache.hc.core5.http.HttpRequest request, org.apache.hc.client5.http.protocol.HttpClientContext apacheHttpContext)
    Create a new observation context for the Apache HTTP Client 5 instrumentation.
    ApacheHttpClientContext(org.apache.hc.core5.http.HttpRequest request, org.apache.hc.core5.http.protocol.HttpContext apacheHttpContext, Function<org.apache.hc.core5.http.HttpRequest,String> uriMapper, boolean exportTagsForRoute)
    Deprecated.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.apache.hc.core5.http.protocol.HttpContext
    Deprecated.
    as of 1.12.0 in favor of getHttpClientContext().
    org.apache.hc.client5.http.protocol.HttpClientContext
    Return the client context associated with the current HTTP request.
    Function<org.apache.hc.core5.http.HttpRequest,String>
    Deprecated.
    as of 1.12.0 in favor of an HttpClientContext attribute.
    boolean
    Deprecated.
    as of 1.12.0 with no replacement.

    Methods inherited from class io.micrometer.observation.transport.RequestReplySenderContext

    getResponse, setResponse

    Methods inherited from class io.micrometer.observation.transport.SenderContext

    getCarrier, getKind, getRemoteServiceAddress, getRemoteServiceName, getSetter, setCarrier, setRemoteServiceAddress, setRemoteServiceName

    Methods inherited from class io.micrometer.observation.Observation.Context

    addHighCardinalityKeyValue, addHighCardinalityKeyValues, addLowCardinalityKeyValue, addLowCardinalityKeyValues, clear, computeIfAbsent, containsKey, get, getAllKeyValues, getContextualName, getError, getHighCardinalityKeyValue, getHighCardinalityKeyValues, getLowCardinalityKeyValue, getLowCardinalityKeyValues, getName, getOrDefault, getParentObservation, getRequired, put, remove, removeHighCardinalityKeyValue, removeHighCardinalityKeyValues, removeLowCardinalityKeyValue, removeLowCardinalityKeyValues, setContextualName, setError, setName, setParentObservation, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface io.micrometer.observation.Observation.ContextView

    getOrDefault
  • Constructor Details

    • ApacheHttpClientContext

      @Deprecated public ApacheHttpClientContext(org.apache.hc.core5.http.HttpRequest request, org.apache.hc.core5.http.protocol.HttpContext apacheHttpContext, Function<org.apache.hc.core5.http.HttpRequest,String> uriMapper, boolean exportTagsForRoute)
      Deprecated.
      Create a new observation context for the Apache HTTP Client 5 instrumentation.
      Parameters:
      request - the client request
      apacheHttpContext - the HTTP client context
      uriMapper - the mapper that detects the URI template
      exportTagsForRoute - whether route tags should be contributed
    • ApacheHttpClientContext

      public ApacheHttpClientContext(org.apache.hc.core5.http.HttpRequest request, org.apache.hc.client5.http.protocol.HttpClientContext apacheHttpContext)
      Create a new observation context for the Apache HTTP Client 5 instrumentation.
      Parameters:
      request - the client request
      apacheHttpContext - the HTTP client context
      Since:
      1.12.0
  • Method Details

    • getApacheHttpContext

      @Deprecated public org.apache.hc.core5.http.protocol.HttpContext getApacheHttpContext()
      Deprecated.
      as of 1.12.0 in favor of getHttpClientContext().
      Return the client context associated with the current HTTP request.
    • getHttpClientContext

      public org.apache.hc.client5.http.protocol.HttpClientContext getHttpClientContext()
      Return the client context associated with the current HTTP request.
      Returns:
      HTTP client context
      Since:
      1.12.0
    • getUriMapper

      @Deprecated public Function<org.apache.hc.core5.http.HttpRequest,String> getUriMapper()
      Deprecated.
      as of 1.12.0 in favor of an HttpClientContext attribute.
      Return the function that extracts the URI template information from the current request.
      Returns:
      URI mapper
      See Also:
    • shouldExportTagsForRoute

      @Deprecated public boolean shouldExportTagsForRoute()
      Deprecated.
      as of 1.12.0 with no replacement.
      Whether the route information should be contributed as tags with metrics.
      Returns:
      whether the route information should be contributed as tags with metrics