How to highlight various time ranges in a time series?

  • What Grafana version and what operating system are you using?

10.2.2 (this was surprisingly hard to find, it used to be in the bottom of the sidebar and now I have to hit a health endpoint to get it?)

  • What are you trying to achieve?

I have a graph that shows data being collected in realtime but aggregated by hour or day. I want to highlight the time period on the graph where data is actively being collected, to indicate that the line shown is based on incomplete data.

I would also like the ability to highlight weekends vs weekdays, or periods of known downtime or deploys, so that graph data is more meaningful.

Regions to highlight should be returnable from a query ideally, but for the first case I would accept a time range relative to the end time of the query range.

  • How are you trying to achieve it?

Looking through the documentation and forum posts for ideas. Right now the only thing I can think is to have a right y axis force scaled 0-1 and have my query return 1 for highlighted times and 0 for unhighlighted times, and fill in the graph area. This seems really hacky though, and would prevent the use of right y axis for other needs.

  • What happened?

I didn’t find anything, so I’m creating my own post.

  • What did you expect to happen?

An option to be visible in the panel config options, or in the transforms section, or for there to be documentation on the topic. This seems like a commonly needed thing and I feel like an idiot for not being able to find it.

  • Can you copy/paste the configuration(s) that you are having problems with?

I don’t think that’s relevant, but I can if you want I guess.

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.

No errors because I haven’t been able to try anything.

  • Did you follow any online instructions? If so, what is the URL?

Couldn’t find any.

Thanks for any help!