Grafana Panels Range Mismatch

Okay back for another round of questions.
I have a dashboard that gets application logs with different level (ERROR, INFO, WARN). I have two panels:

  • a log panel that is supposed to show all log lines in the dashboard range.
  • a piechart panel that counts how many of each levels we got within the range.

The issue is that something is off. Looking at Loki datasource I have 2 lines at 7 hour range and 26 lines at 8 hour range.

The log panel is correct, it shows the correct number of lines for both 7 and 8 hour time. All it does is a line_format operation.

The issue is that the piechart always shows 26, for both 7 and 8 hour time range.

How can this be? It seems to me that the piechart range is getting more than it is specified.

I did some more investigation on Loki, it seems I don’t quite understand how counting and sums work.
For 8 hour range, everything looks fine.

For 7 hour range, the sums start high and then go… down? I am probably missing something obvious but I can’t quite grasp how the sum could be going down.