feat(types): Add client report loss source API#1170
Draft
szokeasaurusrex wants to merge 5 commits into
Draft
Conversation
|
f10c34a to
ea819f9
Compare
ea819f9 to
d3dd20b
Compare
lcian
reviewed
Jun 17, 2026
7034485 to
64f6173
Compare
ce0a8b7 to
44a5c99
Compare
67684a5 to
346c3f6
Compare
44a5c99 to
cf7b15e
Compare
346c3f6 to
978829b
Compare
cf7b15e to
fb0de20
Compare
978829b to
9b9ac77
Compare
fb0de20 to
c49b952
Compare
9b9ac77 to
b07e9bd
Compare
b07e9bd to
fc43fb1
Compare
c49b952 to
c5d137d
Compare
Member
Author
c5d137d to
84179b2
Compare
581d5d4 to
52c53d1
Compare
Add `Envelope::losses_on_drop` so transports can inspect an envelope before dropping it and report the data categories and quantities that were lost through client reports. The new mapping covers all parsed envelope item types that contribute reportable losses: - events, sessions, transactions, spans, attachments, and monitor check-ins - log item counts and serialized log bytes - trace metric counts Expose `EnvelopeLossIter` from `sentry-types` and add the client report `Category` variants needed to represent the resulting losses. Client report items and raw envelope items intentionally do not produce additional losses. Add a changelog entry for the new dropped-envelope loss APIs. Resolves [#1171](#1171) Resolves [RUST-242](https://linear.app/getsentry/issue/RUST-242)
52c53d1 to
d187485
Compare
84179b2 to
6d3fc31
Compare
Expose a sealed trait for protocol values that can describe their client report losses. Keep the concrete loss iterators private so the public API does not commit to the internal representation.
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.
Add a sealed
LossSourcetrait so supported protocol values can describe the client report data categories and quantities lost when they are discarded.This standardizes how different telemetry items are counted as client report losses.
EnvelopeandEnvelopeItemboth implementLossSource, along with the supported envelope item payload types.The loss mapping covers:
Client report items and raw envelope items intentionally do not produce additional losses.
Resolves #1171
Resolves RUST-242