Skip to content

fix(core): Report actual item count in client reports of envelope send failures - #25185

Merged
Lms24 merged 2 commits into
developfrom
fix/client-report-envelope-loss-quantity
Oct 9, 2026
Merged

Lms24 merged 2 commits into
developfrom
fix/client-report-envelope-loss-quantity

Conversation

@Lms24

@Lms24 Lms24 commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

When sending an envelope fails (network error, 413, or a full buffer), the transport recorded every item with quantity 1. This undercounts span, log and metric discard quantities. Same for transactions that should also report span counts. Containers now report their item_count, and transactions also report spans.length + 1 span outcomes, matching how the client counts dropped transactions in beforeSend.

For transactions, we also record span outcomes on envelope send failures, analogously to what #25006 adds to other discard reasons

@Lms24 Lms24 changed the title fix(core): Record actual item counts in client reports for failed envelopes fix(core): Report actual item count in client reports of envelope send failures Oct 8, 2026
@Lms24 Lms24 self-assigned this Oct 8, 2026
@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

size-limit report 📦

⚠️ Warning: Base artifact is not the latest one, because the latest workflow run is not done yet. This may lead to incorrect results. Try to re-run all tests to get up to date results.

Path Size % Change Change
@sentry/browser 29.83 kB +0.12% +33 B 🔺
@sentry/browser - with treeshaking flags 27.97 kB +0.16% +44 B 🔺
@sentry/browser - with treeshaking flags tracing without tracing 27.88 kB +0.14% +38 B 🔺
@sentry/browser (incl. Tracing) 51.88 kB +0.06% +31 B 🔺
@sentry/browser (incl. Tracing + Span Streaming) 51.9 kB +0.06% +31 B 🔺
@sentry/browser (incl. Tracing, Profiling) 54.83 kB +0.06% +31 B 🔺
@sentry/browser (incl. Tracing, Replay) 91.63 kB +0.06% +49 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 80.5 kB +0.07% +51 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 96.35 kB +0.06% +57 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 109.33 kB +0.05% +52 B 🔺
@sentry/browser (incl. Feedback) 47.35 kB +0.09% +39 B 🔺
@sentry/browser (incl. sendFeedback) 34.87 kB +0.1% +34 B 🔺
@sentry/browser (incl. FeedbackAsync) 39.99 kB +0.11% +40 B 🔺
@sentry/browser (incl. Metrics) 30.86 kB +0.13% +37 B 🔺
@sentry/browser (incl. Logs) 31.15 kB +0.13% +40 B 🔺
@sentry/browser (incl. Metrics & Logs) 31.79 kB +0.12% +38 B 🔺
@sentry/react 31.68 kB +0.13% +41 B 🔺
@sentry/react (incl. Tracing) 54.21 kB +0.08% +38 B 🔺
@sentry/vue 37.88 kB +0.13% +47 B 🔺
@sentry/vue (incl. Tracing) 54.81 kB +0.07% +36 B 🔺
@sentry/svelte 29.86 kB +0.12% +34 B 🔺
@sentry/remix (Remix 3 client bundle) 56.87 kB +0.08% +44 B 🔺
CDN Bundle 31.57 kB +0.14% +43 B 🔺
CDN Bundle (incl. Tracing) 52.39 kB +0.09% +46 B 🔺
CDN Bundle (incl. Logs, Metrics) 33.77 kB +0.15% +50 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) 54.34 kB +0.08% +42 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) 74.69 kB +0.06% +44 B 🔺
CDN Bundle (incl. Tracing, Replay) 90.06 kB +0.06% +49 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 92 kB +0.05% +39 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 96.22 kB +0.05% +47 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 98.19 kB +0.05% +41 B 🔺
CDN Bundle - uncompressed 93.08 kB +0.18% +159 B 🔺
CDN Bundle (incl. Tracing) - uncompressed 155.62 kB +0.11% +159 B 🔺
CDN Bundle (incl. Logs, Metrics) - uncompressed 99.62 kB +0.16% +159 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 161.57 kB +0.1% +159 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 229.65 kB +0.07% +159 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 275.79 kB +0.06% +159 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 281.73 kB +0.06% +159 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 289.49 kB +0.06% +159 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 295.42 kB +0.06% +159 B 🔺
@sentry/nextjs (client) 56.59 kB +0.1% +54 B 🔺
@sentry/sveltekit (client) 52.26 kB +0.07% +33 B 🔺
@sentry/core/server 40.86 kB - -
@sentry/core/browser 13.71 kB - -
@sentry/node 151.04 kB +0.04% +59 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 83.59 kB - -
@sentry/node - without tracing 94.06 kB +0.06% +56 B 🔺
@sentry/node - without channel injection 129.21 kB +0.05% +63 B 🔺
@sentry/aws-serverless 102.22 kB +0.06% +56 B 🔺
@sentry/cloudflare (withSentry) - minified 209.99 kB +0.09% +181 B 🔺
@sentry/cloudflare (withSentry) 520.62 kB +0.08% +394 B 🔺
@sentry/nextjs/cloudflare (withSentry) - minified 227.66 kB +0.08% +181 B 🔺

View base workflow run

Lms24 and others added 2 commits October 9, 2026 12:15
…elopes

When sending an envelope failed, each item was recorded with quantity 1.
Span, log and metric containers now report their item_count, and
transactions also report spans.length + 1 dropped spans.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@Lms24
Lms24 force-pushed the fix/client-report-envelope-loss-quantity branch from 2053a20 to 3de69e6 Compare October 9, 2026 10:15
@Lms24
Lms24 marked this pull request as ready for review October 9, 2026 10:15
@Lms24
Lms24 requested review from andreiborza and chargome October 9, 2026 10:16

@chargome chargome left a comment

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.

Nice! Thanks for implementing

@Lms24
Lms24 enabled auto-merge (squash) October 9, 2026 10:50
@Lms24
Lms24 merged commit 19185a1 into develop Oct 9, 2026
704 of 707 checks passed
@Lms24
Lms24 deleted the fix/client-report-envelope-loss-quantity branch October 9, 2026 10:51
Lms24 added a commit that referenced this pull request Oct 9, 2026
Realized a second after merging #25185 that the report logic can be
simplified to save a few bytes.
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