Skip to content

ref(span-buffer): Add compression #93592

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 11 commits into from
Jun 18, 2025
Merged

ref(span-buffer): Add compression #93592

merged 11 commits into from
Jun 18, 2025

Conversation

untitaker
Copy link
Member

@untitaker untitaker commented Jun 16, 2025

Applies zstd compression (level 0) on the pre-aggregated span trees before they are inserted into Redis. This should reduce the time Redis is blocked on streaming large payload batches.

Since the flusher needs to modify payloads, it de-compresses them on the fly. This change could lead to more CPU consumption and backlogs in the flusher.

Closes STREAM-211

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Jun 16, 2025
Copy link

codecov bot commented Jun 16, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #93592      +/-   ##
==========================================
+ Coverage   85.57%   88.03%   +2.46%     
==========================================
  Files       10332    10332              
  Lines      596312   596131     -181     
  Branches    23163    23121      -42     
==========================================
+ Hits       510289   524830   +14541     
+ Misses      85567    70808   -14759     
- Partials      456      493      +37     

This reverts commit d124072.
@untitaker untitaker marked this pull request as ready for review June 18, 2025 09:20
@untitaker untitaker requested review from a team as code owners June 18, 2025 09:20
Comment on lines 324 to 328
combined = b"\x00".join(payloads)

# If compression is disabled, return the combined data as-is
if self._zstd_compressor is None:
return combined
Copy link
Member

Choose a reason for hiding this comment

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

This might be a problem if we want to roll back. Could we instead write the payloads separately in this case?

Copy link
Member Author

Choose a reason for hiding this comment

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

addressed this comment, which also fixes the next one

@untitaker untitaker requested a review from jan-auer June 18, 2025 10:00
@untitaker untitaker enabled auto-merge (squash) June 18, 2025 10:09
@untitaker untitaker merged commit 7ea671d into master Jun 18, 2025
64 checks passed
@untitaker untitaker deleted the spans-buffer-compression branch June 18, 2025 11:27
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