fix: accumulate client report drops by quantity#8230
Merged
Conversation
recordLostEvent only added 1 per drop when an entry already existed, undercounting categories reported in quantities >1 (e.g. spans). Add the dropped quantity instead. Matches sentry-python.
philipphofmann
marked this pull request as ready for review
June 26, 2026 10:39
philipphofmann
requested review from
NinjaLikesCheez,
itaybre,
noahsmartin and
philprime
as code owners
June 26, 2026 10:39
📲 Install BuildsiOS
|
Contributor
Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| c67ced3 | 1223.22 ms | 1256.15 ms | 32.93 ms |
| e42f000 | 1218.08 ms | 1257.49 ms | 39.41 ms |
| dde298d | 1212.13 ms | 1247.89 ms | 35.76 ms |
| c3ca123 | 1220.65 ms | 1251.83 ms | 31.18 ms |
| 4c437ea | 1241.63 ms | 1266.20 ms | 24.57 ms |
| bf10fe6 | 1226.00 ms | 1260.76 ms | 34.76 ms |
| 2446b3d | 1218.36 ms | 1253.98 ms | 35.62 ms |
| 09627e8 | 1223.68 ms | 1261.95 ms | 38.27 ms |
| e3147fd | 1227.15 ms | 1257.79 ms | 30.63 ms |
| 44b7b59 | 1211.91 ms | 1248.90 ms | 36.99 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| c67ced3 | 24.14 KiB | 1.16 MiB | 1.13 MiB |
| e42f000 | 24.14 KiB | 1.17 MiB | 1.15 MiB |
| dde298d | 24.14 KiB | 1.22 MiB | 1.20 MiB |
| c3ca123 | 24.14 KiB | 1.17 MiB | 1.14 MiB |
| 4c437ea | 24.14 KiB | 1.18 MiB | 1.15 MiB |
| bf10fe6 | 24.14 KiB | 1.17 MiB | 1.15 MiB |
| 2446b3d | 24.14 KiB | 1.17 MiB | 1.15 MiB |
| 09627e8 | 24.14 KiB | 1.17 MiB | 1.14 MiB |
| e3147fd | 24.14 KiB | 1.17 MiB | 1.14 MiB |
| 44b7b59 | 24.14 KiB | 1.15 MiB | 1.13 MiB |
NinjaLikesCheez
approved these changes
Jun 29, 2026
philipphofmann
enabled auto-merge (squash)
June 29, 2026 08:37
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the client report discarded-event accumulator.
When a
(category, reason)entry already existed,recordLostEvent:reason:quantity:setquantity = event.quantity + 1, ignoring the passed quantity. Correct for thequantity:1overload, but undercounts categories reported in quantities >1 (e.g. spans viarecordLostSpans:). Now adds the dropped quantity.Matches sentry-python (
self._discarded_events[...] += quantity).I discovered this while reviewing #8186
Closes #8231