Class OkHttpMetricsEventListener.Builder
java.lang.Object
io.micrometer.core.instrument.binder.okhttp3.OkHttpMetricsEventListener.Builder
- Enclosing class:
OkHttpMetricsEventListener
-
Method Summary
Modifier and TypeMethodDescriptionbuild()includeHostTag(boolean includeHostTag) Historically, OkHttp Metrics provided byOkHttpMetricsEventListenerincluded ahosttag for the target host being called.requestTagKeys(Iterable<String> ignored) Deprecated.The request cannot be null according to the OkHttp APIrequestTagKeys(String... ignored) Deprecated.The request cannot be null according to the OkHttp APIAdd aTagto any already configured tags on this Builder.tag(BiFunction<okhttp3.Request, @Nullable okhttp3.Response, Tag> contextSpecificTag) Add a context-specific tag.
-
Method Details
-
tags
-
tag
Add aTagto any already configured tags on this Builder.- Parameters:
tag- tag to add- Returns:
- this builder
- Since:
- 1.5.0
-
tag
public OkHttpMetricsEventListener.Builder tag(BiFunction<okhttp3.Request, @Nullable okhttp3.Response, Tag> contextSpecificTag) Add a context-specific tag.- Parameters:
contextSpecificTag- function to create a context-specific tag- Returns:
- this builder
- Since:
- 1.5.0
-
uriMapper
-
includeHostTag
Historically, OkHttp Metrics provided byOkHttpMetricsEventListenerincluded ahosttag for the target host being called. To align with other HTTP client metrics, this was changed totarget.host, but to maintain backwards compatibility thehosttag can also be included. By default,includeHostTagis true so both tags are included.- Parameters:
includeHostTag- whether to include thehosttag- Returns:
- this builder
- Since:
- 1.5.0
-
requestTagKeys
Deprecated.The request cannot be null according to the OkHttp APITag keys forRequest.tag()orRequest.tag(Class). These keys will be added with UNKNOWN values whenRequestis null. Note that this is required only for Prometheus as it requires tag match for the same metric.- Returns:
- this builder
- Since:
- 1.3.9
-
requestTagKeys
Deprecated.The request cannot be null according to the OkHttp APITag keys forRequest.tag()orRequest.tag(Class). These keys will be added with UNKNOWN values whenRequestis null. Note that this is required only for Prometheus as it requires tag match for the same metric.- Returns:
- this builder
- Since:
- 1.3.9
-
build
-