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
ConstructorsConstructorDescriptionApacheHttpClientContext(org.apache.hc.core5.http.HttpRequest request, org.apache.hc.client5.http.protocol.HttpClientContext apacheHttpContext) Create a newobservation contextfor 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 TypeMethodDescriptionorg.apache.hc.core5.http.protocol.HttpContextDeprecated.as of 1.12.0 in favor ofgetHttpClientContext().org.apache.hc.client5.http.protocol.HttpClientContextReturn the client context associated with the current HTTP request.Deprecated.as of 1.12.0 in favor of anHttpClientContextattribute.booleanDeprecated.as of 1.12.0 with no replacement.Methods inherited from class io.micrometer.observation.transport.RequestReplySenderContext
getResponse, setResponseMethods inherited from class io.micrometer.observation.transport.SenderContext
getCarrier, getKind, getRemoteServiceAddress, getRemoteServiceName, getSetter, setCarrier, setRemoteServiceAddress, setRemoteServiceNameMethods 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, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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.as of 1.12.0 in favor ofApacheHttpClientContext(HttpRequest, HttpClientContext).Create a newobservation contextfor the Apache HTTP Client 5 instrumentation.- Parameters:
request- the client requestapacheHttpContext- the HTTP client contexturiMapper- the mapper that detects the URI templateexportTagsForRoute- 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 newobservation contextfor the Apache HTTP Client 5 instrumentation.- Parameters:
request- the client requestapacheHttpContext- the HTTP client context- Since:
- 1.12.0
-
-
Method Details
-
getApacheHttpContext
Deprecated.as of 1.12.0 in favor ofgetHttpClientContext().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.as of 1.12.0 in favor of anHttpClientContextattribute.Return the function that extracts the URI template information from the current request.- Returns:
- URI mapper
- See Also:
-
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
-
ApacheHttpClientContext(HttpRequest, HttpClientContext).