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
ConstructorDescriptionApacheHttpClientContext
(org.apache.hc.core5.http.HttpRequest request, org.apache.hc.client5.http.protocol.HttpClientContext apacheHttpContext) Create a newobservation 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 TypeMethodDescriptionorg.apache.hc.core5.http.protocol.HttpContext
Deprecated.as of 1.12.0 in favor ofgetHttpClientContext()
.org.apache.hc.client5.http.protocol.HttpClientContext
Return the client context associated with the current HTTP request.Deprecated.as of 1.12.0 in favor of aHttpClientContext
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 newobservation context
for 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 context
for the Apache HTTP Client 5 instrumentation.- Parameters:
request
- the client requestapacheHttpContext
- the HTTP client context
-
-
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. -
getUriMapper
Deprecated.as of 1.12.0 in favor of aHttpClientContext
attribute.Return the function that extracts the URI template information from the current request.- See Also:
-
shouldExportTagsForRoute
Deprecated.as of 1.12.0 with no replacement.Whether the route information should be contributed as tags with metrics.
-
ApacheHttpClientContext(HttpRequest, HttpClientContext)
.