feat(wsgi): Migrate to span first#5988
Conversation
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. This PR will not appear in the changelog. 🤖 This preview updates automatically when you update the PR. |
Codecov Results 📊✅ 13 passed | Total: 13 | Pass Rate: 100% | Execution Time: 6.83s All tests are passing successfully. ❌ Patch coverage is 7.81%. Project has 15327 uncovered lines. Files with missing lines (3)
Generated by Codecov Action |
Codecov Results 📊✅ 49 passed | ⏭️ 3 skipped | Total: 52 | Pass Rate: 94.23% | Execution Time: 12.36s 📊 Comparison with Base Branch
✨ No test changes detected All tests are passing successfully. ❌ Patch coverage is 7.81%. Project has 15640 uncovered lines. Files with missing lines (5)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
- Coverage 26.75% 26.70% -0.05%
==========================================
Files 191 191 —
Lines 21281 21336 +55
Branches 7006 7036 +30
==========================================
+ Hits 5692 5696 +4
- Misses 15589 15640 +51
- Partials 490 490 —Generated by Codecov Action |
| return event_processor | ||
|
|
||
|
|
||
| def _get_request_attributes( |
There was a problem hiding this comment.
This is essentially a port of the event processor
| self, custom_sampling_context: "dict[str, Any]" | ||
| ) -> None: | ||
| self.get_active_propagation_context()._set_custom_sampling_context( | ||
| self.get_current_scope().get_active_propagation_context()._set_custom_sampling_context( |
There was a problem hiding this comment.
This change was necessary as we're now always starting spans, regardless of type (segment or child), on the current scope instead of the isolation scope, so we also need to use the propagation context from there.
There was a problem hiding this comment.
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.
Reviewed by Cursor Bugbot for commit 54064a5. Configure here.

Description
Make the WSGI integration span first ready.
Also, set an additional attribute (
user.ip_address) in ASGI.Recommended to review with Ignore whitespace on.
Issues
Reminders
tox -e linters.feat:,fix:,ref:,meta:)