ref(spans): Track cumulative latency in buffer logger#107317
Merged
ref(spans): Track cumulative latency in buffer logger#107317
Conversation
Changes BufferLogger to track cumulative latency instead of maximum latency: - Remove threshold filtering - all entries are now tracked - Track cumulative latency per project_and_trace instead of max latency - Trim to top 1000 entries by cumulative latency after each batch - Log top 50 entries by cumulative latency every minute - Update tests to reflect new behavior This provides better visibility into which project/trace combinations accumulate the most latency over time rather than just peak values. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
b428113 to
a6f8b87
Compare
a6f8b87 to
222d2c2
Compare
evanh
approved these changes
Jan 30, 2026
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
priscilawebdev
pushed a commit
that referenced
this pull request
Feb 2, 2026
Changes `BufferLogger` to track cumulative latency instead of maximum latency, providing better visibility into which project/trace combinations accumulate the most latency over time. I think tracking the cumulative time spent by outlier traces is going to be more valuable than specific traces that take longer in specific instances of the EVALSHA call. This will allow us to keep constant track of outlier traces so we can take action wether manually (killswitch) or automatically (demote the trace to BLQ). The idea is to keep track of the top traces and print the top 50 periodically. Then identifying outliers will become easy. ## Changes - **Remove threshold filtering**: All entries are now tracked regardless of latency value - **Track cumulative latency**: Store sum of all latencies for each project_and_trace instead of just the maximum value - **Smart trimming**: After each batch, if entries exceed 50, trim to keep only the top 50 by cumulative latency (removes lowest latency entries) - **Sort by cumulative latency**: Periodic logging (every 1 minute) now reports top 50 entries sorted by cumulative latency Made with [Cursor](https://cursor.com) --------- Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Changes
BufferLoggerto track cumulative latency instead of maximum latency, providing better visibility into which project/trace combinations accumulate the most latency over time.I think tracking the cumulative time spent by outlier traces is going to be more valuable than specific traces that take longer in specific instances of the EVALSHA call.
This will allow us to keep constant track of outlier traces so we can take action wether manually (killswitch) or automatically (demote the trace to BLQ).
The idea is to keep track of the top traces and print the top 50 periodically.
Then identifying outliers will become easy.
Changes
Made with Cursor