Repository navigation
chore(client-reports): Add Client Report aggregator - #1145
Merged
szokeasaurusrex merged 8 commits intoJun 24, 2026
Merged
szokeasaurusrex merged 8 commits into
szokeasaurusrex merged 8 commits into
Conversation
szokeasaurusrex
force-pushed
the
szokeasaurusrex/client-report-aggregator
branch
from
June 9, 2026 13:40
2569c8a to
cfe64ee
Compare
szokeasaurusrex
force-pushed
the
szokeasaurusrex/client-report-aggregator
branch
from
June 9, 2026 14:37
cfe64ee to
a71a9bd
Compare
szokeasaurusrex
force-pushed
the
szokeasaurusrex/client-report-aggregator
branch
from
June 9, 2026 14:43
a71a9bd to
eeb5a2e
Compare
szokeasaurusrex
force-pushed
the
szokeasaurusrex/client-report-aggregator
branch
from
June 9, 2026 15:08
eeb5a2e to
9546535
Compare
szokeasaurusrex
force-pushed
the
szokeasaurusrex/client-report-aggregator
branch
2 times, most recently
from
June 9, 2026 15:49
38019f7 to
be6bd6b
Compare
szokeasaurusrex
force-pushed
the
szokeasaurusrex/client-report-aggregator
branch
from
June 9, 2026 16:02
be6bd6b to
a23c912
Compare
szokeasaurusrex
force-pushed
the
szokeasaurusrex/client-report-aggregator
branch
2 times, most recently
from
June 10, 2026 09:31
03b04a4 to
eb40b58
Compare
szokeasaurusrex
force-pushed
the
szokeasaurusrex/client-report-aggregator
branch
2 times, most recently
from
June 10, 2026 14:30
51b3812 to
cebc324
Compare
szokeasaurusrex
force-pushed
the
szokeasaurusrex/client-report-aggregator
branch
from
June 10, 2026 14:59
cebc324 to
65568db
Compare
szokeasaurusrex
marked this pull request as ready for review
June 10, 2026 15:00
szokeasaurusrex
force-pushed
the
szokeasaurusrex/client-report-aggregator
branch
from
June 12, 2026 10:08
65568db to
08adad0
Compare
szokeasaurusrex
force-pushed
the
szokeasaurusrex/client-report-aggregator
branch
from
June 12, 2026 12:37
08adad0 to
ce47300
Compare
szokeasaurusrex
force-pushed
the
szokeasaurusrex/client-report-aggregator
branch
from
June 19, 2026 08:46
5895558 to
a105ff7
Compare
szokeasaurusrex
force-pushed
the
szokeasaurusrex/client-report-aggregator
branch
from
June 19, 2026 12:08
c03ddbc to
3e0bd89
Compare
szokeasaurusrex
force-pushed
the
szokeasaurusrex/client-report-aggregator
branch
from
June 19, 2026 16:05
3e0bd89 to
9ce6994
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 9ce6994. Configure here.
szokeasaurusrex
force-pushed
the
szokeasaurusrex/client-report-aggregator
branch
2 times, most recently
from
June 21, 2026 16:36
551e44c to
74e502d
Compare
szokeasaurusrex
force-pushed
the
szokeasaurusrex/client-report-aggregator
branch
from
June 22, 2026 08:12
f8d53d4 to
0858d55
Compare
szokeasaurusrex
force-pushed
the
szokeasaurusrex/client-report-aggregator
branch
2 times, most recently
from
June 22, 2026 15:54
7428f26 to
4b4e4ba
Compare
szokeasaurusrex
force-pushed
the
szokeasaurusrex/client-report-aggregator
branch
2 times, most recently
from
June 23, 2026 12:36
e908fd1 to
498749b
Compare
Create a client report aggregator in `sentry-core`. The aggregator lives on the `EnvelopeSender` next to the `Transport`. The `EnvelopeSender` itself is owned by a `Client`. The aggregator is entirely lock-free. Instead of the map shape suggested by the [SDK-wide client reports spec](https://develop.sentry.dev/sdk/telemetry/client-reports/#aggregation), the aggregator stores a counter for every discard reason/data category combination. There are currently [15 discard reasons](https://develop.sentry.dev/sdk/telemetry/client-reports/#discard-reasons-1) and [15 data categories](https://develop.sentry.dev/sdk/foundations/transport/rate-limiting/#definitions) allowed by the spec, some of which may be inapplicable to the Rust SDK. If we implement all of these in the SDK, the aggregator will consume approximately 1.8 KiB of fixed memory per instance (15 * 15 64-bit atomic counters). The alternative would be a HashMap keyed by `(category, reason)`. A HashMap would consume less memory while the aggregator is empty, but recording losses would require synchronization and could allocate memory. The fixed counter array is a reasonable tradeoff for now, and we can revisit the representation if this becomes a practical concern. Resolves [#1002](#1002) Resolves [RUST-154](https://linear.app/getsentry/issue/RUST-154/add-shared-client-report-aggregator-and-send-client-reports-option)
szokeasaurusrex
force-pushed
the
szokeasaurusrex/client-report-aggregator
branch
from
June 24, 2026 12:28
498749b to
b78918c
Compare
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.

Create a client report aggregator in
sentry-core.The aggregator lives on the
EnvelopeSendernext to theTransport. TheEnvelopeSenderitself is owned by aClient.The aggregator is entirely lock-free. Instead of the map shape suggested by the SDK-wide client reports spec, the aggregator stores a counter for every discard reason/data category combination. There are currently 15 discard reasons and 15 data categories allowed by the spec, some of which may be inapplicable to the Rust SDK. If we implement all of these in the SDK, the aggregator will consume approximately 1.8 KiB of fixed memory per instance (15 * 15 64-bit atomic counters).
The alternative would be a HashMap keyed by
(category, reason). A HashMap would consume less memory while the aggregator is empty, but recording losses would require synchronization and could allocate memory. The fixed counter array is a reasonable tradeoff for now, and we can revisit the representation if this becomes a practical concern.Resolves #1002
Resolves RUST-154