chore(transport): Record tokio thread client report losses#1186
Conversation
614c2e1 to
bdff5cb
Compare
265a9fb to
de9f7c8
Compare
bdff5cb to
db28b96
Compare
de9f7c8 to
d7d314c
Compare
d7d314c to
d5d1597
Compare
db28b96 to
96a15e5
Compare
Record envelopes dropped before the reqwest HTTP transport sees them. The tokio transport thread now reports queue overflow, disconnected worker, and rate-limit drops through the client report recorder. Shutdown losses remain unreported because shutdown ends the opportunity to send another envelope carrying the aggregated client report. Fixes [#1150](#1150) Fixes [RUST-225](https://linear.app/getsentry/issue/RUST-225)
Record dropped envelopes through the client report recorder directly in the tokio transport thread. This matches the newer recorder API and removes the old transport helper import from this implementation.
d5d1597 to
807212a
Compare
96a15e5 to
11f9014
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 807212a. Configure here.
| None => { | ||
| sentry_debug!("Envelope was discarded due to per-item rate limits"); | ||
| }, | ||
| } |
There was a problem hiding this comment.
Orphan attachments misreported rate limits
Medium Severity
Replacing filter_envelope with rl.filter and a client-report recorder makes every on_filtered callback record RatelimitBackoff. Envelope::filter also invokes on_filtered when it strips attachments that lack an event or transaction, so those policy drops can be counted as rate-limit losses even when no rate limit applied.
Reviewed by Cursor Bugbot for commit 807212a. Configure here.
| let auth = dsn.to_auth(Some(&user_agent)).to_string(); | ||
| let url = dsn.envelope_api_url().to_string(); | ||
|
|
||
| let send_fn_client_report_recorder = client_report_recorder.clone(); |
There was a problem hiding this comment.
| let send_fn_client_report_recorder = client_report_recorder.clone(); | |
| let client_report_recorder = client_report_recorder.clone(); |


Record envelopes dropped before the reqwest HTTP transport sees them. The tokio transport thread now reports queue overflow, disconnected worker, and rate-limit drops through the client report recorder.
Shutdown losses remain unreported because shutdown ends the opportunity to send another envelope carrying the aggregated client report.
Fixes #1150
Fixes RUST-225