Hello everyone, pretty new to Grafana with PostgresSQL and so far I love it! I will be presetting to our company the capabilities of Grafana next week and proposing to switching onto this platform - but I need help with one little thing:
I want to create an environment where I can show processes from industry plant. The dashboard should look something like this at the end (our current application):
So far I got to the point where I can select process numbers based on a query variable.
The problem I am facing right now is that the data shown in the graph doesn’t automatically zoom in to data. This can be a problem because processes can be years old. And the user shouldn’t scroll and “look” for the process through all the years.
Please tell me that there is a way how to do this?
I have been searching on the internet and couldn’t find any answers (I am limited to 2 links so I will put the rest into comments):
I hope I will be proven wrong, but I had a similar question a few weeks back and the answer was that it cannot be done.
You can run the make a panel to user a relative time, which means that it will always fix to the last minutes, hours that you specify:
But it is always a range that ends in the current time. So if your process completes 5pm and you are running the report at 6pm, there will a 1 hour empty space in your graph. Similarly it is always a fixed period to the past. I wanted a graph which zooms in the data on my solar panels, which always start and stop depending when the sun rises and sets in the day. And I could not do it.
I hope you find a solution, it there will be a solution for that in the future. For me it seems what we need is not so much a setting on the graph, but some option to programmatically influence the time range on the dashboard. But in my understanding, this is not possible at the moment. Only if we could add a script to the dashboard page source…
Just spend a few minutes scrolling through it, but it looks like a bespoke panel type where you can have buttons on your panel, and that will change the time range. So your button can determine the start and end of your data range and set the time range to that. Let me know if you can get this working.
Just a bump on this topic. I’m also looking at solar data, but my information comes from Influx (2.6) and the time range is selected by the query (It presents yesterday’s data before 10AM and today’s after 10) and always displays from 6AM - 8PM of whichever day. The query is also set up for overlaying multiple days of data time-shifted to the “current” day.
I’m looking for an unattended option that will just zoom to results from the query; is that not possible?
Editing my thoughts from above slightly-- Looking into RelativeTime and Time Shift I understand that I can do now/d to get to midnight, but I would like a start time of 6AM. If I enter now/d + 6h the + 6h is truncated off.
It doesn’t seem like the selectors are sufficiently robust to do what I am doing in Flux (including if-then statements).
The query does everything I need it to do; the easy solution is to just have the panel display all query results rather than trying to manage zoom from a separate setting.
(I run two queries, one for “today” and one for “yesterday”, and I timeShift the yesterday data into today so things overlay.)
When the refresh runs, the panel doesn’t shift, as it is already padded out to 8PM today by the yesterday information. [It works as expected when I run it in Influx.]
The problem is that I can’t figure out how to make Grafana “trust” that the time information all needs to be displayed (and nothing else).