@NonNullApi @NonNullFields public class OkHttpMetricsEventListener extends okhttp3.EventListener
EventListener for collecting metrics from OkHttpClient.
uri tag is usually limited to URI patterns to mitigate tag cardinality explosion but OkHttpClient
doesn't provide URI patterns. We provide "URI_PATTERN" header to support uri tag or you can
configure a URI mapper to provide your own tag values for uri tag.| Modifier and Type | Class and Description |
|---|---|
static class |
OkHttpMetricsEventListener.Builder |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
URI_PATTERN
Header name for URI patterns which will be used for tag values.
|
| Modifier and Type | Method and 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 |
requestHeadersEnd(okhttp3.Call call,
okhttp3.Request request) |
void |
responseHeadersEnd(okhttp3.Call call,
okhttp3.Response response) |
connectEnd, connectFailed, connectionAcquired, connectionReleased, connectStart, dnsEnd, dnsStart, requestBodyEnd, requestBodyStart, requestFailed, requestHeadersStart, responseBodyEnd, responseBodyStart, responseFailed, responseHeadersStart, secureConnectEnd, secureConnectStartpublic static final java.lang.String URI_PATTERN
public static OkHttpMetricsEventListener.Builder builder(MeterRegistry registry, java.lang.String name)
public void callStart(okhttp3.Call call)
callStart in class okhttp3.EventListenerpublic void requestHeadersEnd(okhttp3.Call call,
okhttp3.Request request)
requestHeadersEnd in class okhttp3.EventListenerpublic void callFailed(okhttp3.Call call,
java.io.IOException e)
callFailed in class okhttp3.EventListenerpublic void callEnd(okhttp3.Call call)
callEnd in class okhttp3.EventListenerpublic void responseHeadersEnd(okhttp3.Call call,
okhttp3.Response response)
responseHeadersEnd in class okhttp3.EventListener