Class MicrometerHttpRequestExecutor.Builder
java.lang.Object
io.micrometer.core.instrument.binder.httpcomponents.MicrometerHttpRequestExecutor.Builder
- Enclosing class:
MicrometerHttpRequestExecutor
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Creates an instance ofMicrometerHttpRequestExecutorwith all the configured properties.exportTagsForRoute(boolean exportTagsForRoute) Allows to expose the target scheme, host and port with every metric.Provide a custom convention to override the default convention used when instrumenting with theObservationAPI.observationRegistry(io.micrometer.observation.ObservationRegistry observationRegistry) Configure an observation registry to instrument using theObservationAPI instead of directly with aTimer.These tags will not be applied when instrumentation is performed with theObservationAPI.Allows to register a mapping function for exposing request URIs.waitForContinue(int waitForContinue)
-
Method Details
-
waitForContinue
- Parameters:
waitForContinue- Overrides the wait for continue time for this request executor. SeeHttpRequestExecutorfor details.- Returns:
- This builder instance.
-
tags
These tags will not be applied when instrumentation is performed with theObservationAPI. Configure anApacheHttpClientObservationConventioninstead with the extra key values.- Parameters:
tags- Additional tags which should be exposed with every value.- Returns:
- This builder instance.
- See Also:
-
uriMapper
public MicrometerHttpRequestExecutor.Builder uriMapper(Function<org.apache.http.HttpRequest, String> uriMapper) Allows to register a mapping function for exposing request URIs. Be careful, exposing request URIs could result in a huge number of tag values, which could cause problems in your meter registry. By default, this feature is almost disabled. It only exposes values of the "URI_PATTERN" HTTP header.- Parameters:
uriMapper- A mapper that allows mapping and exposing request paths.- Returns:
- This builder instance.
- See Also:
-
exportTagsForRoute
Allows to expose the target scheme, host and port with every metric. Be careful with enabling this feature: If your client accesses a huge number of remote servers, this would result in a huge number of tag values, which could cause cardinality problems. By default, this feature is disabled.- Parameters:
exportTagsForRoute- Set this to true, if the metrics should be tagged with the target route.- Returns:
- This builder instance.
-
observationRegistry
public MicrometerHttpRequestExecutor.Builder observationRegistry(io.micrometer.observation.ObservationRegistry observationRegistry) Configure an observation registry to instrument using theObservationAPI instead of directly with aTimer.- Parameters:
observationRegistry- registry with which to instrument- Returns:
- This builder instance.
- Since:
- 1.10.0
-
observationConvention
public MicrometerHttpRequestExecutor.Builder observationConvention(ApacheHttpClientObservationConvention convention) Provide a custom convention to override the default convention used when instrumenting with theObservationAPI. This only takes effect when anobservationRegistry(ObservationRegistry)is configured.- Parameters:
convention- semantic convention to use- Returns:
- This builder instance.
- Since:
- 1.10.0
- See Also:
-
build
Creates an instance ofMicrometerHttpRequestExecutorwith all the configured properties.- Returns:
- an instance of
MicrometerHttpRequestExecutor
-