sentry-python
sentry-python copied to clipboard
[do not merge] Span first
Description
WIP: Draft implementation of span first/span streaming in the Python SDK. Uses the existing start_span API, but batches spans and sends them independently of the transaction/segment span.
Enables to run the SDK in two modes: static and streaming. Static mode is the current status quo where spans are sent together with their transaction (segment) as the transaction finishes. Streaming mode makes two major changes to the behavior of the start_span API:
- Spans are added to the streaming buffer on finish and they may be sent in an envelope without their segment.
- [Later]
start_spanwithout a running segment will be promoted to a segment span. (For the POC, this is not the case; we just use the existingstart_transaction.)
TODOs:
ignore_spansstart_spanshould start a segment span if there is no active segment span
Issues
- Project: https://linear.app/getsentry/project/span-first-sdk-python-727da28dd037/overview
Reminders
- Please add tests to validate your changes, and lint your code using
tox -e linters. - Add GH Issue ID & Linear ID (if applicable)
- PR title should use conventional commit style (
feat:,fix:,ref:,meta:) - For external contributors: CONTRIBUTING.md, Sentry SDK development docs, Discord community