Skip to content

feat(spans): add option to rollout process_segment task#119003

Merged
lvthanh03 merged 8 commits into
masterfrom
tony/rollout-task-segment
Jul 6, 2026
Merged

feat(spans): add option to rollout process_segment task#119003
lvthanh03 merged 8 commits into
masterfrom
tony/rollout-task-segment

Conversation

@lvthanh03

@lvthanh03 lvthanh03 commented Jul 3, 2026

Copy link
Copy Markdown
Member

Refs STREAM-1308

Adds a rollout path for the spans buffer flusher to enqueue flushed segments directly to the process_segment task.

When spans.buffer.process-segments-task-rollout-rate is enabled, segment bytes are sent to the new task instead of being produced to the buffered-segments topic.

@lvthanh03 lvthanh03 requested review from a team as code owners July 3, 2026 13:29
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Jul 3, 2026
Comment thread src/sentry/spans/consumers/process/flusher.py
Comment thread src/sentry/spans/consumers/process/flusher.py Outdated
Comment thread src/sentry/spans/consumers/process/flusher.py
@linear-code

linear-code Bot commented Jul 3, 2026

Copy link
Copy Markdown

STREAM-1308

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit f4f5e66. Configure here.

Comment thread src/sentry/spans/consumers/process/flusher.py
Comment thread src/sentry/spans/consumers/process/flusher.py
Comment thread src/sentry/spans/consumers/process/flusher.py
len(message["spans"]),
)
if produce_to_process_segment_task:
task_produce_future = process_segment_task.apply_async_with_future(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think the rollout should happen within the produce() function, but this can also be cleaned up later when the rollout flag is gone

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, I think it's cleaner like that.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there isn't a really clean way to have the rollout decision be in the produce() function and be per-segment at the same time, I'll just clean them up later when removing the rollout flag

Comment thread src/sentry/spans/consumers/process/flusher.py Outdated
@lvthanh03 lvthanh03 force-pushed the tony/rollout-task-segment branch from c3a7b36 to 87047ac Compare July 6, 2026 18:43
@lvthanh03 lvthanh03 merged commit 95d848f into master Jul 6, 2026
133 of 156 checks passed
@lvthanh03 lvthanh03 deleted the tony/rollout-task-segment branch July 6, 2026 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants