feat(asgi): Migrate away from event processor in span first#5920
feat(asgi): Migrate away from event processor in span first#5920sentrivana wants to merge 18 commits intomasterfrom
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. |
1 similar comment
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: 7.37s All tests are passing successfully. ❌ Patch coverage is 7.41%. Project has 14885 uncovered lines. Files with missing lines (4)
Generated by Codecov Action |
| return request_data | ||
|
|
||
|
|
||
| def _get_request_attributes(asgi_scope: "Any") -> "dict[str, Any]": |
There was a problem hiding this comment.
This is an attributes based copy of _get_request_data just above
|
|
||
| return name, source | ||
|
|
||
| def _get_segment_name_and_source( |
There was a problem hiding this comment.
This is a copy of _get_transaction_name_and_source above, just adapted for segments
Description
In span first, there are no event processors. Therefore, we need to be able to set the data we were setting in event processors in some other way.
As we migrate our integrations one by one, this will be an exercise in whether it's possible to achieve this without some sort of callback/lifecycle hooks. So far, in ASGI, it seems we can get by by simply using
scope.set_attribute()for setting request related data, and updating the segment name/source just before the span ends.Adding this enables us to actually test the new functionality.
Issues
Reminders
tox -e linters.feat:,fix:,ref:,meta:)