-
Notifications
You must be signed in to change notification settings - Fork 9k
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
Rule Manager: Only query once per alert rule when restoring alert state #13980
Commits on Apr 24, 2024
-
Rule Manager: Only query once per alert rule when restoring alert state
Prometheus restores alert state between restarts and updates. For each rule, it looks at the alerts that are meant to be active and then queries the `ALERTS_FOR_STATE` series for _each_ alert within the rules. If the alert rule has 120 instances (or series) it'll execute the same query with slightly different labels. This PR changes the approach so that we only query once per alert rule and then match the corresponding alert that we're about to restore against the series-set. While the approach might use a bit more memory at start-up (if even?) the restore proccess is only ran once per restart so I'd consider this a big win. This builds on top of #13974 Signed-off-by: gotjosh <josue.abreu@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 4daaa59 - Browse repository at this point
Copy the full SHA 4daaa59View commit details -
bug: nil check against the series set not errors
Signed-off-by: gotjosh <josue.abreu@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for e6dcbd2 - Browse repository at this point
Copy the full SHA e6dcbd2View commit details -
Fix tests and a bug with the series lookup logic.
Signed-off-by: gotjosh <josue.abreu@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 2762015 - Browse repository at this point
Copy the full SHA 2762015View commit details -
Use the string representation of the labels instead of the hash
Signed-off-by: gotjosh <josue.abreu@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for fa75985 - Browse repository at this point
Copy the full SHA fa75985View commit details -
- Improve variable name of the map produced by the series set Signed-off-by: gotjosh <josue.abreu@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 6cfc584 - Browse repository at this point
Copy the full SHA 6cfc584View commit details -
Allow the result map for the series set before hand with a hint.
Signed-off-by: gotjosh <josue.abreu@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 2de2fee - Browse repository at this point
Copy the full SHA 2de2feeView commit details -
Configuration menu - View commit details
-
Copy full SHA for cc22071 - Browse repository at this point
Copy the full SHA cc22071View commit details
Commits on Apr 30, 2024
-
Add an assertion on the count of alerts before adding an active alert
Signed-off-by: gotjosh <josue.abreu@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 151f6e0 - Browse repository at this point
Copy the full SHA 151f6e0View commit details -
Rename QueryforStateSeries to QueryForStateSeries
Signed-off-by: gotjosh <josue.abreu@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for ccfafae - Browse repository at this point
Copy the full SHA ccfafaeView commit details -
Use labels.Len() instead of manually counting the labels
Signed-off-by: gotjosh <josue.abreu@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 63b0994 - Browse repository at this point
Copy the full SHA 63b0994View commit details -
Remove duplicated sorted and assignment of expected alerts.
Signed-off-by: gotjosh <josue.abreu@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for f63dbc3 - Browse repository at this point
Copy the full SHA f63dbc3View commit details -
Rename
alerts
toexpectedAlerts
in the test case inputSigned-off-by: gotjosh <josue.abreu@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 05ca082 - Browse repository at this point
Copy the full SHA 05ca082View commit details -
querier.Select cannot return a nil series set.
Signed-off-by: gotjosh <josue.abreu@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 379dec9 - Browse repository at this point
Copy the full SHA 379dec9View commit details