Only partial data in time range is shown in chart

Grafana 9.9.5 on FreeBSD 13

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.

1 Like

Is your data time stamp UTC? Or utc+/-

The field is in UTC (never store time data in anything but UTC :wink:).

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.

1 Like

Has no one else experienced this problem? I’ve not found a solution yet. Hopefully someone out there has an idea.

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.

Mik

I’m having the same issue. I can view data on a 24h chart. But now below that. All of my devices’ timezone is in IST.

I’m experiencing the exact same issue!
Did anyone solve this?