Multiple time scales on one dashboard

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

The current one on Grafana Labs hosted site.

  • What are you trying to achieve?

I want to present the same metric but with different time scales on separate graphs on the same dashboard; i.e. the average temperature for the last 24h, last 7 days and last months

  • How are you trying to achieve it?
    In Query options I’m using the relative time in a form of “24h”, “now-7d”, “now-1M”

  • What happened?

All the graphs are the same and show only the last 24 hours.

  • What did you expect to happen?

I was expecting to have 3 graphs with different time frames.

The thing is that sometimes it works if I try to change something in one of the graphs but then discard the change; but now even this trick doesn’t work.

What is your datasource? (InfluxDB, Prometheus, MySQL, etc.)

My source is Prometheus.

Try creating 3 graphs and using a different Relative time for each. For example:

More info…
Relative time - You can override the relative time range for individual panels, causing them to be different than what is selected in the dashboard time picker in the top right corner of the dashboard. This allows you to show metrics from different time periods or days on the same dashboard.

Examples:

  • Relative time:
Example Relative time field
Last 5 minutes now-5m
The day so far now/d
Last 5 days now-5d/d
This week so far now/w
Last 2 years now-2y/y

@grant2 I might have not been clear enough before, apologies.

That is exactly what I’ve done. The problem is that when I’m doing that, all the graphs are showing the same timeframe for all of them instead of the one I requested for each. Like this:

Thank you for clarifying. I just created 3 graphs on v8.3.4 hosted on play.grafana.com, with 3 different relative time ranges, and it worked exactly as it should. The only difference that I observed from your screenshot is that you do not have the blue text stating the relative time.

I would try on the Grafana locally installed open source version, but I do not have access to it for a week or so.

@grant2 Thanks! I’ve ended up rebuilding the dashboards afresh and they look better.

1 Like