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 byOkHttpMetricsEventListener
included ahost
tag for the target host being called.requestTagKeys
(Iterable<String> requestTagKeys) Tag keys forRequest.tag()
orRequest.tag(Class)
.requestTagKeys
(String... requestTagKeys) Tag keys forRequest.tag()
orRequest.tag(Class)
.Add aTag
to any already configured tags on this Builder.tag
(BiFunction<okhttp3.Request, okhttp3.Response, Tag> contextSpecificTag) Add a context-specific tag.
-
Method Details
-
tags
-
tag
Add aTag
to 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, 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 byOkHttpMetricsEventListener
included ahost
tag for the target host being called. To align with other HTTP client metrics, this was changed totarget.host
, but to maintain backwards compatibility thehost
tag can also be included. By default,includeHostTag
is true so both tags are included.- Parameters:
includeHostTag
- whether to include thehost
tag- Returns:
- this builder
- Since:
- 1.5.0
-
requestTagKeys
Tag keys forRequest.tag()
orRequest.tag(Class)
. These keys will be added with UNKNOWN values whenRequest
is null. Note that this is required only for Prometheus as it requires tag match for the same metric.- Parameters:
requestTagKeys
- request tag keys- Returns:
- this builder
- Since:
- 1.3.9
-
requestTagKeys
Tag keys forRequest.tag()
orRequest.tag(Class)
. These keys will be added with UNKNOWN values whenRequest
is null. Note that this is required only for Prometheus as it requires tag match for the same metric.- Parameters:
requestTagKeys
- request tag keys- Returns:
- this builder
- Since:
- 1.3.9
-
build
-