-
Notifications
You must be signed in to change notification settings - Fork 572
fix: Send client reports for span recorder overflow #5310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Send client reports for span recorder overflow #5310
Conversation
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨
Bug Fixes 🐛
Documentation 📚
Internal Changes 🔧Release
Other
🤖 This preview updates automatically when you update the PR. |
| "buffer_overflow", | ||
| data_category="span", | ||
| quantity=span_recorder_dropped_spans, | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfinished spans incorrectly reported as buffer overflow
Medium Severity
The _dropped_spans event field contains both spans dropped due to buffer overflow AND unfinished spans (those without a timestamp), but the new code reports all of them with reason "buffer_overflow". In tracing.py, _dropped_spans is calculated as len_diff + self._span_recorder.dropped_spans, where len_diff counts unfinished spans. Only self._span_recorder.dropped_spans represents actual buffer overflow. This causes unfinished spans to be incorrectly categorized in client reports.
alexander-alderman-webb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
Description
We weren't emitting client reports for spans dropped because they were over the span recorder limit.
Disclaimer: vibe coded but refactored and live tested by hand
Tested 3 times with an app with

max_spans=3and 10 spans in a transactionIssues
Closes #5308
Reminders
tox -e linters.feat:,fix:,ref:,meta:)