-
Notifications
You must be signed in to change notification settings - Fork 11.7k
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
Graph: Make old graph panel thresholds work even if ngalert is enabled #38918
Conversation
Maybe we should use DashboardMigrator for this? This is a bit out of my knowledge of dashboards, graph and thresholds so I'm not sure at all. |
Hm, now I'm thinking this PR solution isn't great either... If we remove alert from panel model and user saves it again, alert will be gone, right? Then if |
It runs every time right? Would have to remove thresholds only once to not kill those added by user later |
Yes, but only upgrades once for each version |
Hm, we should do the migration when I guess the key question is: once @torkelo would appreciate any opinion 🙇 |
Let's not delete anything until we have a migration feature that won't deprive the user of the visible threshold. Note that this can also be shipped in a later release when thresholds can be dynamically drawn based on the rule, then we can remove the explicit threshold line based on some heuristic. |
Then this PR is good to go I think. "legacy" alert thresholds will essentially become configured on the panels and remain for the time being |
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.
Looks good to me. I agree with @davkal about leaving thresholds in place on the panel even though they can get outdated.
…-github to revdev * commit '56aebaac32bd7a82f84a571969b51c62ba54fd6d': (23 commits) "Release: Updated versions in package to 8.1.4" (grafana#39273) Docs: Update azuread docs to mention about env variables (grafana#39203) (grafana#39265) Docs: plugin migration guide 7.0.0 to 8.0.0 (grafana#38911) (grafana#39246) Docs: Added "manageAlerts" provisioning option. (grafana#38836) (grafana#39253) BarChart: Fix legend and tooltip colors off by 1 after data refresh (grafana#39234) (grafana#39252) Update silences.md (grafana#38834) (grafana#39243) Explore: Ensure logs volume bar colors match legend colors (grafana#39072) (grafana#39120) Graph: make old graph panel thresholds work even if ngalert is enabled (grafana#38918) (grafana#39233) Fix regex to identify / as separator (grafana#39220) [v8.1.x] BarChart: fix stale bar values and x axis labels Add link to default template (grafana#39106) (grafana#39138) Doc: Created a separate topic for AWS authentication (grafana#39012) (grafana#39160) LDAP: Search all DNs for users (grafana#38891) (grafana#39167) Docs: Fix broken link to signed GCS URLs docs (grafana#39144) (grafana#39149) [v8.1.x] Variables: Fix not updating inside a Panel when the preceding Row uses "Repeat For" (grafana#39141) Docs: Improve v8 upgrade notes for SQL data sources (grafana#38792) (grafana#39124) Explore: Trace view now shows trace start time in selected timezone (grafana#39054) (grafana#39093) Alerting: Fix notification channel migration (grafana#38983) (grafana#39053) Annotations: Fixes blank panels for queries with unknown data sources (grafana#39017) (grafana#39034) Copy cue.mod and packages/grafana-schema to container workdir (grafana#38998) (grafana#39018) ...
What this PR does / why we need it:
With #33850 I mistakenly entirely disabled threshold visualization feature for graph panels. The intention was, if
ngalert
is enabled, to not show threshold for old panel alert which might still be on the panel model. Determining threshold value for any ng alert(s) connected to the panel is not implemented yet.This PR undoes the change and insted does not setpanel.alert
ifngalert
is enabled.This PR makes sure
panel.alert
is ignored ifngalert
is enabled.However, I think there is a problem: it seems that panel alert threshold was persisted to
panel.thresholds
. So even ifpanel.alert
is no longer there, the threshold is still shown. While initially this threshold kinda makes sense because panel alert was converted to ng alert which is still attached to the panel, it is no longer synchronized with any changes to the ngalert. I think this would be a source of confusion in the future. However if we delete or disable the threshold, user won't be able to edit thresholds manually.Maybe ngalert migration should clear
panel.thresholds
for any panels that have a panel alert? Ifngalert
flag is unsert, I thinkThresholdMapper
would populate it again@hugohaggmark @torkelo WDYT, how to proceed here?
Which issue(s) this PR fixes:
Fixes #38596
Special notes for your reviewer: