Repository navigation
ref(span-buffer): Introduce multiprocessed flusher - #93824
Merged
Merged
Conversation
Contributor
🔍 Existing Issues For ReviewYour pull request is modifying functions with the following pre-existing issues: 📄 File: src/sentry/spans/consumers/process/flusher.py
Did you find this useful? React with a 👍 or 👎 |
Codecov ReportAttention: Patch coverage is ✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## master #93824 +/- ##
=======================================
Coverage 88.04% 88.04%
=======================================
Files 10358 10358
Lines 598302 598361 +59
Branches 23239 23239
=======================================
+ Hits 526761 526813 +52
- Misses 71073 71080 +7
Partials 468 468 |
evanh
reviewed
Jun 18, 2025
| with metrics.timer("spans.buffer.flusher.wait_produce"): | ||
| for shard in shards: | ||
| with metrics.timer("spans.buffer.flusher.produce", tags={"shard": shard}): | ||
| for _, flushed_segment in flushed_segments.items(): |
Member
There was a problem hiding this comment.
I'm confused by this logic. This looks like you are sending the same spans to every shard?
Member
Author
There was a problem hiding this comment.
yeah this is nonsense... leftover from a prev version
untitaker
marked this pull request as draft
June 23, 2025 09:00
untitaker
marked this pull request as ready for review
June 23, 2025 09:52
jan-auer
approved these changes
Jun 23, 2025
jan-auer
left a comment
Member
There was a problem hiding this comment.
The backpressure and healthy signals could be reduced to one per process. Other than that, LGTM
jan-auer
approved these changes
Jun 23, 2025
This branch was successfully deployed
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Refs STREAM-266
Compression helped a lot bring the time on the main thread down. We now think we can scale down the consumers. However, we also need to ensure the flusher can keep up. So let's make the flusher spawn a process per redis shard.
We think this is easier to do than making the process_spans/insert_spans multiprocessed. Over time we can offload mroe things like statistics/metrics to the flusher, and keep the main thread minimal.