-
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
Timeseries: Time regions migration #66998
Conversation
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.
code changes LGTM - will want to test again after blocking PR is merged
console.log('scheduling a refresh'); | ||
dashboardRefresher = setTimeout(() => { | ||
console.log('trigger refresh for annotations'); | ||
dashboard.startRefresh({ refreshAll: true, panelIds: [] }); |
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.
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.
@ryantxu the problem here is that this will be triggered multiple times if you have many panels with time regions on dashboard. So maybe need some kind of debounce function for this. But ideally it should only retrigger annotations. Think it could be better if this was something like (But still need to figure out the debounce), the other problem I guess is that when loading a dashboard this is kind of too late. The annotation queries might already be running. Is there a way to do these migrations in the DahboardMigrator instead so they happen before dashboard is initialized and annotation queries are issued?
getDashboardQueryRunner().run({dashboard, range: getTimeSrv().getTimeRange()}
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.
thanks! that works -- we only trigger one refresh 1/4 sec after load
Updated migrations to include time regions. Time regions PR needs to be merged first.
Check: http://localhost:3000/d/XMjIZPmik/panel-tests-graph-time-regions?orgId=1&from=now-30d&to=now&__feature.autoMigrateOldPanels=true
Fixes #66997
TO DO:
Please check that: