Description
openedon May 19, 2022
Describe the bug
After upgrading from 2.3 to 2.5, this query will result in an unimplemented
error:
avg(avg_over_time({job=~"myapps.*"} |= "stats" | json busy="utilization" | unwrap busy [$__interval]))
The utilization
field being extracted is a float (ex: 55.4
). The avg_over_time()
appears to properly calculate the values for each individual stream, but when wrapped with a avg()
to get the average across all of the streams the unimplemented
error is returned instead.
To Reproduce
Steps to reproduce the behavior:
- Started Loki v2.5.0
- Started Promtail v2.5.0 to tail Kubernetes pods
- Query via Grafana v8.4.5:
avg(avg_over_time{job="somejob" | json somefield="field" | unwrap somefield [$__interval]))
Expected behavior
While wrapping an avg_over_time()
with a avg()
is probably not as good as avg_over_time() by (label)
, there is not an obvious reason why it should not work. I would expect an unwrapped float per log stream could be aggregated with avg()
.
Environment:
- Infrastructure: EKS
- Deployment tool: Raw manifests via ArgoCD
Work-around
Using avg_over_time(...) by (label)
to aggregate instead of wrapping it with avg()
.
This might be related to #6130 and the changes in 2.4, but I haven't had a chance to test that yet.