Skip to content

chore(transport): Record tokio thread client report losses#1186

Open
szokeasaurusrex wants to merge 2 commits into
szokeasaurusrex/transport-thread-client-reportsfrom
szokeasaurusrex/tokio-thread-client-reports
Open

chore(transport): Record tokio thread client report losses#1186
szokeasaurusrex wants to merge 2 commits into
szokeasaurusrex/transport-thread-client-reportsfrom
szokeasaurusrex/tokio-thread-client-reports

Conversation

@szokeasaurusrex

@szokeasaurusrex szokeasaurusrex commented Jun 22, 2026

Copy link
Copy Markdown
Member

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

@szokeasaurusrex szokeasaurusrex changed the title feat(transport): Record tokio thread client report losses chore(transport): Record tokio thread client report losses Jun 22, 2026
@linear-code

linear-code Bot commented Jun 22, 2026

Copy link
Copy Markdown

RUST-225

@szokeasaurusrex szokeasaurusrex force-pushed the szokeasaurusrex/transport-thread-client-reports branch from 614c2e1 to bdff5cb Compare June 22, 2026 08:12
@szokeasaurusrex szokeasaurusrex force-pushed the szokeasaurusrex/tokio-thread-client-reports branch from 265a9fb to de9f7c8 Compare June 22, 2026 08:12
@szokeasaurusrex szokeasaurusrex marked this pull request as ready for review June 22, 2026 08:13
@szokeasaurusrex szokeasaurusrex requested a review from lcian as a code owner June 22, 2026 08:13
Comment thread sentry/src/transports/tokio_thread.rs
@szokeasaurusrex szokeasaurusrex force-pushed the szokeasaurusrex/transport-thread-client-reports branch from bdff5cb to db28b96 Compare June 22, 2026 11:20
@szokeasaurusrex szokeasaurusrex force-pushed the szokeasaurusrex/tokio-thread-client-reports branch from de9f7c8 to d7d314c Compare June 22, 2026 11:20
Comment thread sentry/src/transports/reqwest.rs
@szokeasaurusrex szokeasaurusrex force-pushed the szokeasaurusrex/tokio-thread-client-reports branch from d7d314c to d5d1597 Compare June 22, 2026 15:54
@szokeasaurusrex szokeasaurusrex force-pushed the szokeasaurusrex/transport-thread-client-reports branch from db28b96 to 96a15e5 Compare June 22, 2026 15:54
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.
@szokeasaurusrex szokeasaurusrex force-pushed the szokeasaurusrex/tokio-thread-client-reports branch from d5d1597 to 807212a Compare June 22, 2026 16:02
@szokeasaurusrex szokeasaurusrex force-pushed the szokeasaurusrex/transport-thread-client-reports branch from 96a15e5 to 11f9014 Compare June 22, 2026 16:02

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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");
},
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

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();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let send_fn_client_report_recorder = client_report_recorder.clone();
let client_report_recorder = client_report_recorder.clone();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants