This is our goal:
(if that’s not your goal, please read the main article instead).
Note that none of this is going to work if the dashboard time range is absolute and includes a midnight. In that case the start of the range will round down and the end will round up, including multiple days. If you know a way to solve that, do drop me a line.
Locking the time range to an hour is accomplished by setting the panel’s “relative time” to now/d and its “time shift” to 0d/d. I don’t know either.
Shifting the data for the yesterday series is as simple as adding offset 1d to the query.
Note that at work, something about the setup prevented querying into the future and offsetting into the past. Instead I had to shift the time range into the past and offset into the future. This can be accomplished by using a negative offset for the past trace, and setting “time shift” to 1d/d.
Finally, the vertical clock line. I feel sure there must be a good approach to this, but I haven’t managed to find it, and instead present this horrible hack.
Add an annotation query named “Now”:
Yeah, we’re sending it to the TSDB just so it can send it back. Horrible. Oh well.