-
Notifications
You must be signed in to change notification settings - Fork 580
feat(span-streaming): Add span batcher (2) #5398
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
base: master
Are you sure you want to change the base?
Conversation
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨Span Streaming
Bug Fixes 🐛
Internal Changes 🔧
🤖 This preview updates automatically when you update the PR. |
Codecov Results 📊✅ 13 passed | Total: 13 | Pass Rate: 100% | Execution Time: 4.45s All tests are passing successfully. ❌ Patch coverage is 33.33%. Project has 13694 uncovered lines. Files with missing lines (180)
Generated by Codecov Action |
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.
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.
| "sent_at": format_timestamp(datetime.now(timezone.utc)), | ||
| "trace": dsc, | ||
| } | ||
| ) |
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.
Envelope header unconditionally includes null trace context
Low Severity
The _flush method unconditionally includes "trace": dsc in envelope headers even when dsc is None. This results in "trace": null in the serialized JSON. The established pattern elsewhere in the codebase (e.g., in client.py around line 909) is to only include the trace header when the dynamic sampling context is truthy. Including a null trace header is inconsistent and could potentially cause issues with the Sentry backend when this experimental feature is enabled.
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.
All coming in future PRs
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.
looks good! just one question from me, not blocking
| self._flusher_pid: "Optional[int]" = None | ||
|
|
||
| def get_size(self) -> int: | ||
| # caller is responsible for locking before checking this |
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.
why can we not, or should we not, lock for the caller here?


SpanBatcherthat batches and sends spans by trace ID. Hook it up to the client.StreamedSpanclass that will eventually replace the currentSpanclass.Chipping away at #5317 to transform it into reviewable and mergeable PRs.