fix: Send client reports for span recorder overflow#5310
Merged
sentrivana merged 3 commits intomasterfrom Jan 14, 2026
Merged
Conversation
Contributor
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.
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.
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.
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:)