I’m building a dashboard to visualize the status of our system during a certain day (actually, night…). The metrics are coming from Prometheus, and are labeled with
night that takes the form of YYYYMMDD. I have a variable named
night which queries Prometheus for available
night label values, and lets the user choose which night to display (screenshot attached below).
Where I’m stuck is how to automatically update the default value of
night to the most recent one. I’d like the dashboard to switch over to the most recent night (otherwise it’s very easy for a viewer to forget to do that manually and they end up looking at stale data). E.g., in the attached screenshot,
20180604 is selected (and the dashboard was saved). In the meantime,
20180605 has appeared in the database, but that didn’t cause the selected value to change when the dashboard auto-refreshed.
My question – is there a way to achieve this (hopefully w/o having to resort to a scripted dashboard – it’s nice to be able to perform WYSIWYG edits)?
Any help or pointers would be much appreciated!