Modifying time panels - a bump of a previous question

Grafana community 8.1

Original conversation is here

I’m interested in hiding all of the smaller time ranges from the timepicker. Last 5 minutes to Last 24 hours. Found the js code (on my rpm installed grafana) in /usr/share/grafana/public/build in a file called app.xxxxx.js .

Deleted the code, restarted grafana-server cleared my cache and voila. Great success.

Of course, come grafana update time, my edited file will get nuked and I’ll have to find the file and do it again.

a sed along the lines of:

sed -i 's|{from:"now-5m",to:"now",display:"Last 5 minutes"},{from:"now-15m",to:"now",display:"Last 15 minutes"},{from:"now-30m",to:"now",display:"Last 30 minutes"},{from:"now-1h",to:"now",display:"Last 1 hour"},{from:"now-3h",to:"now",display:"Last 3 hours"},{from:"now-6h",to:"now",display:"Last 6 hours"},{from:"now-12h",to:"now",display:"Last 12 hours"},{from:"now-24h",to:"now",display:"Last 24 hours"}||g' /usr/share/grafana/public/build/*.js

… will fix it each time, but it does feel like there should be a less clunky way to do it.

Something in grafana.ini - hide the following timeranges? An option in grafana preferences would probably be less clunky?

Anyway, this is a bump for a request to change the timeseries picker.

Hi @laurielounge, not sure if I mentioned this in the other thread but there is actually a GitHub feature request for this: Feature Request: Custom Time ranges to the time picker drop down · Issue #2417 · grafana/grafana · GitHub. It’s probably the best place to upvote/discuss a potential implementation of a configuration option for this (and probably a better place than this forum, when it comes to getting eyes on the issue from Grafana developers). Unfortunately it’s 6 years old at this point, so hard to judge the likelihood of it being implemented in the near future.

Thanks for the update. @svetb - appreciate the followup.