Commit 50247ce
Guard core-metric telemetry drain against queue-full delta loss
getValueAndReset() resets a counter's delta baseline, so calling it before the
offer() succeeds means a full metricsQueue silently drops that delta forever --
worst under telemetry backpressure when the agent is unreachable. In both the
span-metrics and baggage collection loops, check remainingCapacity() before
reading each counter and stop early instead; the untouched counters are
collected on the next cycle.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 9c335a6 commit 50247ce
1 file changed
Lines changed: 12 additions & 0 deletions
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
38 | 44 | | |
39 | 45 | | |
40 | 46 | | |
| |||
51 | 57 | | |
52 | 58 | | |
53 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
54 | 66 | | |
55 | 67 | | |
56 | 68 | | |
| |||
0 commit comments