Right now it's hardly possible to get an attempt latency for a log like "request failed after 300ms, attempts: 3".
It's quite important to know how much time was actually spent per each request, since the external service can abort it at any moment. And in case the backoff didn't help -- to know the total duration in the default error within the number of attempts.
Ideally, ResponseLogHook could be extended with more arguments like attemptsNumber, attemptLatency (last one), totalLatency (sum of all attempts + delays)
All of it can be structured under some "Details" structure.
For ErrorHandler it could also be useful to have the final total latency.
Right now it's hardly possible to get an attempt latency for a log like
"request failed after 300ms, attempts: 3"
. It's quite important to know how much time was actually spent per each request, since the external service can abort it at any moment. And in case the backoff didn't help -- to know the total duration in the default error within the number of attempts.Ideally,
ResponseLogHook
could be extended with more arguments likeattemptsNumber
,attemptLatency
(last one),totalLatency
(sum of all attempts + delays) All of it can be structured under some "Details" structure.For
ErrorHandler
it could also be useful to have the final total latency.