I have 3 panels. I want two of them to look at the last 15 minutes and the third one to look at the last 7 days.
I’ve tried setting the time range individually in each panel, saving, and then saving the dashboard.
But when I reload the page, every panel picks up the dashboard’s default time range and I wasn’t able to find that option and disable it.
I have 3 panels. I want two of them to look at the last 15 minutes and the
third one to look at the last 7 days.
I have the same type of setup; in my case I have four panels showing the past
hour, the past 24 hours, the past 7 days and the past 28 days.
I’ve tried setting the time range individually in each panel, saving, and
then saving the dashboard. But when I reload the page, every panel picks
up the dashboard’s default time range and I wasn’t able to find that
option and disable it.
How can I make this work?
Here’s how I do it (my data source is Influxdb, but I don’t think that makes
any difference to the query) - I define my panels using JSON, but if you do it a
different way, you should still be able to see the idea from this:
Panel 1:
“hidetimeoverride”: true,
“query”: “select from
where and
$timeFilter”,
“timefrom”: “1h”
Panel 2:
“hidetimeoverride”: true,
“query”: “select from
where and
$timeFilter”,
“timefrom”: “24h”
Panel 3:
“hidetimeoverride”: true,
“query”: “select from
where and
$timeFilter”,
“timefrom”: “7d”
Panel 4:
“hidetimeoverride”: true,
“query”: “select from
where and
$timeFilter”,
“timefrom”: “28d”
Feel free to ask further if that doesn’t point you sufficiently in the right
direction.
Is there a schema for that json somewhere? Because I am not quite sure where to place the timefrom and hidetimeoverride. This is what my json looks like:
FWIW, I feel like this is also possible from the time range override in the panel query options in the UI (Queries | Grafana Labs). Though maybe that doesn’t provide the level of flexibility desired here…
I have this exact same issue, I want to track the light level for my plants over the past 3 hours but the temperature and humidity over the past 7 days.
No matter what I try, I can not get these JSON properties to work. Every time I paste them into JSON Model and press Save, Grafana just overwrites “timeFrom” to null and removes “hideTimeOverride” completely.
@longoon12000 did you take a look at the link in my post? I’m not sure why people are resorting to manual JSON edits for this. The option to override the time range for a particular panel is (still…years later) right there under “Query options”, next to the datasource selector in the panel edit screen. Just select whatever custom time range you need for that individual panel (e.g. “7d”) and you should be sorted.
@svetb I have looked into these options and it seems that “Relative Time” is indeed what I need. I had trouble finding this field because it didn’t have this (i) popover that explained what it does and also does not have “range” in its name.
To be honest I didn’t even understand what Relative Time could possibly mean so it was prone to be ignored as an option by me. It was only in the documentation where this was explained and I understood it.
Thanks!
@longoon12000 I think your point about how (non-)intuitive it is to find (or understand) that option is certainly spot on! I do feel like it was called something more obvious previously, and it also potentially had an info pop-up that’s no longer there. Probably a valuable enhancement request to get this sorted. Based on the above thread, you’re clearly not the only one who’s had trouble finding it in the UI…
I tried to modify the json - but that does not work for me. I do not find the parameter “hidetimeoverride” and when I try to add the parameter, there comes an error message.
So how can the JSON be modified exactly for changing the time range. Is it possible to use variables as input parameters in the JSON or defined dates for “timefrom” (like “2021-03-11 12:09:41.340” → correct format?)?
Hello there. I’m struggling with this issue, but I cannot make it work.
The parameter timeFrom seems to fix the panel to the last 24 hours (or 24 hours so far). What I need is to show in one panel the last month, and in another today.
My time range filter is from now/M to now/d.
If I delete the timeFrom parameter, the panel shows the rest of the day, but the from time is one month ago (taken from the general time range), but when in the “today” panel I set the timeFrom 1d, it shows the last 24 hours until this moment, not the whole day from 00:00:00
And still… years later… it has an absolute useless label called “relative time”. Why is it not called “time range” or even better “override time range”?
And you still wonder why people don’t find it?
Is there also a setting for timeTo? The “relative time” from the gui seems to set the “timeFrom” according to the manual JSON changes mentioned here.
I do not only need panels from now back to various points in the past, i want to use e.g. “today” (NOT so far) and “yesterday”. But that requires a timeTo that is not “now”.