-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Closed
Description
Hi Team,
I want to capture timing metrics like connect, SSL, DNS, and request/response times for each request, including retries. However, since OkHttp reuses the same Call object for retries and doesn't always trigger callFailed(), it isn't easy to differentiate retries from the original request.
Observations:
callStart()is only triggered once per Call. And the retries may start atconnectStart(),requestHeadersStart(), etc - depending upon the state of the original request.callFailed()isn't always called before a retry, making failure tracking tricky.- The same
Callinstance is used across retries.
Question:
I want to track the metrics for each request separately like below -
{
"attempt": 1,
"dnsLookupTimeMs": 50,
"connectTimeMs": 120,
"sslHandshakeTimeMs": 80,
// failure occurs during response body read
},
{
// Reused connection, so no new DNS, connect and SSL lookup
// retry request which succeeds
"attempt": 2,
"responseTime": 200,
"requestTotalTime": 500
}How can I achieve this?
Metadata
Metadata
Assignees
Labels
No labels