fix: block objective=100 and guard events SLI denominator against 0#800
Open
fix: block objective=100 and guard events SLI denominator against 0#800
Conversation
…o to prevent infinite burn rates Two root causes of +Inf/-Inf error budget values are addressed: 1. Validation (pkg/common/validation/slo.go): change objective bound from > 100 to >= 100, blocking Objective=100 which yields a zero error budget and causes division by zero (burn_rate = +Inf, remaining = -Inf). 2. Events SLI template (internal/plugin/slo/core/sli_rules_v1/plugin.go): wrap the denominator with ((...) > 0) so a zero or absent denominator produces an absent result instead of +Inf. A single +Inf sample in the 5m SLI recording rule would poison sum_over_time for up to 30d, propagating +Inf through slo:period_burn_rate:ratio and flipping to -Inf in slo:period_error_budget_remaining:ratio. All affected unit and integration golden-file tests are updated. Fixes: slok#749 Signed-off-by: Kai Timmer <kai@staffbase.com>
Author
|
@slok Please let me know what I would need to do to get this moving. |
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.
Preventing infinite burn rates and issues with BurnRate calculation.
Two root causes of +Inf/-Inf error budget values are addressed:
Validation (pkg/common/validation/slo.go): change objective bound from
Events SLI template (internal/plugin/slo/core/sli_rules_v1/plugin.go): wrap the denominator with ((...) > 0) so a zero or absent denominator produces an absent result instead of +Inf. A single +Inf sample in the 5m SLI recording rule would poison sum_over_time for up to 30d, propagating +Inf through slo:period_burn_rate:ratio and flipping to -Inf in slo:period_error_budget_remaining:ratio.
All affected unit and integration golden-file tests are updated.
I think this would fix: #749