Commit 545e3f0
Guard stats telemetry drain against delta loss when the queue is full
getValueAndReset() resets a counter's delta baseline, so calling it before the
offer() succeeds means a full metricsQueue silently drops that delta forever --
exactly when it matters most (telemetry backing up because the agent is
unreachable). Check remainingCapacity() before reading any counter and stop the
drain early instead; the untouched counters are collected on the next cycle.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent d5193a2 commit 545e3f0
1 file changed
Lines changed: 6 additions & 0 deletions
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
73 | 79 | | |
74 | 80 | | |
75 | 81 | | |
| |||
0 commit comments