Fix false 100% burn rates for low-traffic SLO endpoints#167
Merged
Conversation
Replace clamp_min + bool multiplication guard with direct division and per-window 'and total > 0' guard. The previous approach produced false 100% error ratios during traffic transitions because: 1. clamp_min(total, 0.001) computed 1-(0/0.001)=1 when total was 0 2. The bool guard used the 5m total which could briefly be >0 during traffic pulses, letting the false 1 through to the longer windows The new approach uses each window's own total for the guard and returns no data (instead of 1) when there's no traffic in that specific window. This matches the pattern already working correctly for the 5m rules. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fd9047d to
bb7307b
Compare
kevwilliams
approved these changes
Mar 27, 2026
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Fixes multi-window SLO error ratio recording rules that were producing false 100% values for low-traffic endpoints (metadata, audit queries, activity queries).
Problem
The 1h, 6h, and 3d error ratio rules used
clamp_min(total, 0.001)to avoid division by zero, combined with a* (rate5m > bool 0)guard. During brief traffic pulses, the guard opened momentarily while the total was still near-zero, producing1 - (0/0.001) = 1(100% error ratio). This caused the burn rate dashboard to show false spikes.Fix
Replace
clamp_min+boolmultiplication with direct division and per-windowand total > 0guards — the same pattern already working correctly for the 5m rules. Each window now uses its own total for the guard instead of referencing the 5m total.Test plan
🤖 Generated with Claude Code