-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
fix: metric maintenace disappearance #1145
base: master
Are you sure you want to change the base?
Conversation
/build |
Build and push Docker images with tag: fix-metric-maintenace-disappearance.2025-02-20.af5e136 |
api/controller/trigger.go
Outdated
for metric := range lastCheck.Metrics { | ||
if _, ok := timeSeriesNames[metric]; !ok { | ||
lastCheck.RemoveMetricState(metric) | ||
modifyLastCheck := true |
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.
At here you can initialize variable to needed value (like at 43 line):
modifyLastCheck := len(timeSeriesNames) != 0 || metricEvaluationRulesChanged(existedTrigger, newTrigger)
It would be more readable I think
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.
well that's reasonable, so refactored condition a bit and add comment
PR Summary
Fix the bug, appearing in the following case:
filterSeries
It happens because last check for the trigger is modified according to time series fetched from
now-10min
tonow
.This PR try to avoid unnecessary modifying last check, by checking the difference between existed and new versions of trigger (more precisely it is checked if the metrics evaluation and alerting rules have changed).