Color me stupid but I must be missing something basic and it’s no doubt right in front of me but I’ll be damned if I can see it.
Below is a screen shot of my time series chart from data that is updating every 15 seconds from sun up to sun down (it’s from a PV install). I have the time range set to 12 hours but the chart only shows about 5 hours of data. The last data point shown is current. Why am I not seeing the data from -12 to -7 hours ago - only from -5 hours ago till now?
My query is pretty simple (postgres 13)
SELECT “Pac”, $__time(stamp at time zone ‘PDT’) FROM stats where stamp >= $__timeFrom(stamp) and stamp < $__timeTo(stamp) (using $__timeFilter(stamp) gives the same results).
If I switch to anything less than 12 hours I get an empty chart with “No data” displayed. If I switch to 2 days or more, I get that many days worth of data displayed (or it seems that way anyway - definitely multiple days). Also, removing the “at time zone” has no effect, as expected.
I searched the forum and did find one other question that’s very similar this but there were no responses. Hopefully someone can help.
The field is in UTC (never store time data in anything but UTC ).
But it’s not a data issue. It’s a grafana issue. I have an old cgi/perl setup that displays the exact same data just fine. If I run a straight select on the data everything is fine. It’s only grafana when I use certain time ranges that there’s a problem.
As I mentioned, if I change the time range to “24 hours”, “2 days”, etc then I get all the data that doesn’t show up when I use “12 hours” or less. It’s just that “12 hours” shows some data. Anything less shows nothing.
I did run into an issue where formatting a time using hh returned 12 hour time - from 0 to 12 and then 1 to 11. Using HH fixed it to give values 0 thru 23. The symptom was data in the time ranges ‘randomly’ missing from the start or the end of the display (because the check on the first and last days was < or > the 12 hour time range).
I note your data cuts off at noon, so have a look in the query inspector. Your query for time up to 5pm might be ending up as time > 05:00:00, which would exclude the time at 11 am as it’s 11:00:00 while the time at 3pm (under a 12 hour filter) is 03:00:00.
My conclusion is that 12 hour support in Grafana is just weird - broken as designed.
Did you consider that a queries have a line limit?
It can be modified in the query options.
The visualization will probably show a different truncation if you select a different time window.
This response doesn’t quite fit the second part of the original question, but I got here having the prior issue and for me the query limit was the cause.
It can’t be any sort of limit restriction because short duration time ranges don’t work where longer ones do - I can see a chart for 2 days, 2 months, 2 years… but can’t for < 2 days.
For my purposes setting a time range of 2 days gives me enough that it’s my “work around” so I haven’t bothered to look into the problem any more.