Class OkHttpMetricsEventListener
- java.lang.Object
-
- okhttp3.EventListener
-
- io.micrometer.core.instrument.binder.okhttp3.OkHttpMetricsEventListener
-
@NonNullApi @NonNullFields public class OkHttpMetricsEventListener extends okhttp3.EventListener
EventListener
for collecting metrics fromOkHttpClient
. uri tag is usually limited to URI patterns to mitigate tag cardinality explosion butOkHttpClient
doesn't provide URI patterns. We provide "URI_PATTERN" header to support uri tag or you can configure aURI mapper
to provide your own tag values for uri tag.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
OkHttpMetricsEventListener.Builder
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
URI_PATTERN
Header name for URI patterns which will be used for tag values.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static OkHttpMetricsEventListener.Builder
builder(MeterRegistry registry, java.lang.String name)
void
callEnd(okhttp3.Call call)
void
callFailed(okhttp3.Call call, java.io.IOException e)
void
callStart(okhttp3.Call call)
void
responseHeadersEnd(okhttp3.Call call, okhttp3.Response response)
-
Methods inherited from class okhttp3.EventListener
connectEnd, connectFailed, connectionAcquired, connectionReleased, connectStart, dnsEnd, dnsStart, requestBodyEnd, requestBodyStart, requestFailed, requestHeadersEnd, requestHeadersStart, responseBodyEnd, responseBodyStart, responseFailed, responseHeadersStart, secureConnectEnd, secureConnectStart
-
-
-
-
Field Detail
-
URI_PATTERN
public static final java.lang.String URI_PATTERN
Header name for URI patterns which will be used for tag values.- See Also:
- Constant Field Values
-
-
Method Detail
-
builder
public static OkHttpMetricsEventListener.Builder builder(MeterRegistry registry, java.lang.String name)
-
callStart
public void callStart(okhttp3.Call call)
- Overrides:
callStart
in classokhttp3.EventListener
-
callFailed
public void callFailed(okhttp3.Call call, java.io.IOException e)
- Overrides:
callFailed
in classokhttp3.EventListener
-
callEnd
public void callEnd(okhttp3.Call call)
- Overrides:
callEnd
in classokhttp3.EventListener
-
responseHeadersEnd
public void responseHeadersEnd(okhttp3.Call call, okhttp3.Response response)
- Overrides:
responseHeadersEnd
in classokhttp3.EventListener
-
-