I have a logql query for loki on nginx like this:
sum(avg_over_time({$label_name=~"$label_value", job=~"$job", instance=~"$instance"} | json | status=200 | unwrap status | __error__="" [$__interval])) by (upstream)
this gives me the result same as
avg(avg_over_time({$label_name=~"$label_value", job=~"$job", instance=~"$instance"} | json | status=200 | unwrap status | __error__="" [$__interval])) by (upstream)
It means sum
and avg
result are the same and both gives me the sum of values.
What is wrong with my query?