-
Notifications
You must be signed in to change notification settings - Fork 649
ref: Flush trace buckets when segment spans finish #7170
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
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
0414de5
Revert "fix(batcher): Add global flush trigger based on the span numb…
alexander-alderman-webb dd57e21
Revert "feat(batcher): Add global flush trigger based on summed size …
alexander-alderman-webb 8669777
Revert "feat(batcher): Add hard span limit (#7143)"
alexander-alderman-webb 46cf5ce
ref: Flush trace bucket when segment span finishes
alexander-alderman-webb 51a768e
make mypy happy
alexander-alderman-webb 379b8c4
simplify and fix tests
alexander-alderman-webb 9241cee
.
alexander-alderman-webb b3da36f
add span to pending bucket
alexander-alderman-webb 7652579
modify pending flush inside lock
alexander-alderman-webb 78b2893
flush async
alexander-alderman-webb 0478e71
fix race on 3.14t
alexander-alderman-webb 602a412
clean up comments
alexander-alderman-webb bd5a977
conftest update
alexander-alderman-webb 02c0a67
work on fixture changes
alexander-alderman-webb 8057cac
add re-entrancy guard
alexander-alderman-webb 5653f6c
edit comment
alexander-alderman-webb 5ee9fb6
resolve django test failures
alexander-alderman-webb 40dfb01
second iteration django tests
alexander-alderman-webb c29c865
resolve flask test failures
alexander-alderman-webb 14d342d
resolve common test failures
alexander-alderman-webb e0150a4
merge master
alexander-alderman-webb 54334a3
clean up comment
alexander-alderman-webb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
I'm finding this comment a little tricky to follow. My understanding of this section is:
Do I have this right? And why is point 3 problematic? Is it because we need those buckets immediately when invoking
sentry_sdk.flush()and we may not get them because those buckets are in the process of being flushed by the background process?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.
Yes that's correct! To add some links:
Each batcher has a flushing thread that runs the
_flush_loop()method.When a segment span finishes,
_flush()is triggered inside the thread here:sentry-python/sentry_sdk/_span_batcher.py
Line 94 in 4e4ea83
This is what I called "asynchronous" in the comment.
When you call
sentry_sdk.flush(), it triggers the flush heresentry-python/sentry_sdk/client.py
Line 1381 in 4e4ea83
which is not in the flushing thread. This runs synchronously with the user code.