The question is about how Loki creates metrics from logs
Let’s consider an example query.
Count_over_time({job=“mysql”}[5m])
My logs:
2025-07-09 12:00:01 content
2025-07-09 12:00:02 content
2025-07-09 12:00:03 content
2025-07-09 12:00:04 content
..
2025-07-09 12:00:99 content
2025-07-09 12:01:00 content
…
2025-07-09 12:01:99 content
How count_over_time calculates metrics? Is it for each log (combination of labels) counts lasting 5m? If so, does it mean that the calculation of every second in my example? What if we had billions of logs? Does it mean that such a calculation is done for every line also?
Is it possible to have metrics in deterministic intervals like:
12:01 value
12:02 value
…
12:59 values
If so, it would be less CPU, ram consuming for Loki.