Repository navigation
fix(trace): accumulate request attempt duration across retries in TraceInfo - #1267
AdamMagued wants to merge 2 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v3 #1267 +/- ##
========================================
Coverage 99.75% 99.76%
========================================
Files 20 20
Lines 3697 3835 +138
========================================
+ Hits 3688 3826 +138
Misses 9 9
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
I found one way the previous attempt’s trace still gets callbacks on req := res.Request
req.SetContext(context.WithValue(req.Context(), attemptKey{}, 2))I saved the first attempt’s At hook time |
…ling tracing Signed-off-by: AdamMagued <adamismailmageud@gmail.com>
|
@nk-batman21 Fixed in |
|
Retested the same 503 → 200 case against |
Fixes #1142
Summary
When requests undergo retries with client trace enabled, TraceInfo values could be overwritten or produce distorted intervals due to trace context chaining across retry attempts. In addition, duration calculations lacked guard checks against out-of-order hook timestamps.
Changes