Adding new persistent relative time ranges

I often want a Relative Time range that is not on the default list. For instance, I use now-10d a lot. Although recent Absolute Time ranges are saved for re-use there does not appear to be a similar option for Relative Time ranges. In the Dashboard Settings you can create/edit the Auto-Refresh periods. Can we have a similar for the relative time list?

I am a fairly new user (3 months) so I apologize in advance if this is already available.

2 Likes

i had this same question, are we able to add our own Relative time ranges to the built-in list?
we are refering to this list:

ie:
image
(i am aware of the new “Recently used absolute ranges” which is a great addition, but still would like to add some to the main list, such as 3days , 4days, ect )
thanks

2 Likes

@davidgoadby @bob454522 Have either of you figured this out? Seems to be crickets on this topic :frowning:

Just to refresh this issue - where is the list of time ranges? Since I am montoring systems with a sampling frequency of typically 10 minutes, the shortest relative time ranges at the top of the list are never used, but I am quite often using time ranges of 14 or 120 days. Any takers?

I’m pretty sure this doesn’t exist as an option unfortunately, though it could be done with a fairly trivial modification to the code: grafana/rangeOptions.ts at master · grafana/grafana · GitHub (after which you’d need to compile of course).

Alternatively you could look at the Grafana JS files on your server (if you have access to them) and search for e.g. “Last 5 minutes” to see where the time ranges are defined and modify the definitions there (likely app.xxxxxx.js). Have in mind this would of course get wiped if you upgrade Grafana.

Or create a Github feature request to add this as a config option (assuming one doesn’t already exist).

Thanks, I started to look into the source if I could find it. I’ll see if I can write the code to get it user-adjustable.

3 Likes