Repository navigation
feat(common-utils): SLO history and ordering #3793
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
Open
alex-fedotyev
wants to merge
1
commit into
alex/HDX-3001-slo-05-stats
from
alex/HDX-3001-slo-06-history
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| --- | ||
| '@hyperdx/common-utils': patch | ||
| --- | ||
|
|
||
| feat: SLO schema, burn rules and the counts query behind SLOs | ||
|
|
||
| Adds the SLO definition schema (availability or latency indicator, target, | ||
| rolling 7 or 30 day window, optional group-by expression, optional fast and | ||
| slow burn alerts), the single counts query every SLO number comes from, | ||
| overall or by group, and the math for the SLI, error budget and the fast | ||
| and slow burn rules (2% of the budget within an hour, 5% within six hours, | ||
| each with a short window that has to burn as fast). A grouped SLO tracks its 100 | ||
| busiest groups, each with its own numbers; a group with fewer than 100 | ||
| events in the window has no state of its own, and the SLO takes the state | ||
| of its worst group. Not used until SLOs are enabled. |
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 P2 — Burn window shorter than (or not a multiple of) the bucket silently drops the current bucket, so every burnRate is null
With
getSloHistoryGranularitybuckets (30m for 7d, 1h for 30d,core/slo.ts:141) and a 5m or 30m burn window (getSloBurnWindowMs,slo.ts:152),windowStart = b.ts + bucketMs - burnWindowMsis later thanb.ts, so the loop pops the bucket it just pushed and the burn rate comes back null for every point. A 1h window over 30m buckets is fine, but a 45m window would drop the straddling bucket entirely. Always keep the current bucket (trailing.length > 1), or check thatburnWindowMsis a positive multiple ofbucketMsand throw if not. Add a test for 30m buckets with a 5m or 30m window.Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond