Backport eb8a36306674c497d8b0150b482f275e2c00f6c9 from #12176
What this PR does / why we need it:
avg_over_time expression that uses either keep or label_format stage without any aggregation fails on main with the following error: aggregation operator '"sum"' without grouping
Given these expressions contain stages that could reduce the labelset, sharding converts it to the following form sum (sum_over_time()) / sum(count_over_time()), but vector aggregation expr evaluator always expects a grouping. This pr updates the avg_over_time shard mapper to use without() grouping for generating vector agg expr when it is not explicitly set.
[ ] If the change is worth mentioning in the release notes, add add-to-release-notes label
[ ] Changes that require user attention or interaction to upgrade are documented in docs/sources/setup/upgrade/_index.md
[ ] For Helm chart changes bump the Helm chart version in production/helm/loki/Chart.yaml and update production/helm/loki/CHANGELOG.md and production/helm/loki/README.md. Example PR
[ ] If the change is deprecating or removing a configuration option, update the deprecated-config.yaml and deleted-config.yaml files respectively in the tools/deprecated-config-checker directory. Example PR
Backport eb8a36306674c497d8b0150b482f275e2c00f6c9 from #12176
What this PR does / why we need it:
avg_over_time
expression that uses eitherkeep
orlabel_format
stage without any aggregation fails on main with the following error:aggregation operator '"sum"' without grouping
Given these expressions contain stages that could reduce the labelset, sharding converts it to the following form
sum (sum_over_time()) / sum(count_over_time())
, but vector aggregation expr evaluator always expects a grouping. This pr updates theavg_over_time
shard mapper to usewithout()
grouping for generating vector agg expr when it is not explicitly set.example query to reproduce this error:
Which issue(s) this PR fixes: Fixes #
Special notes for your reviewer:
Checklist
CONTRIBUTING.md
guide (required)CHANGELOG.md
updatedadd-to-release-notes
labeldocs/sources/setup/upgrade/_index.md
production/helm/loki/Chart.yaml
and updateproduction/helm/loki/CHANGELOG.md
andproduction/helm/loki/README.md
. Example PRdeprecated-config.yaml
anddeleted-config.yaml
files respectively in thetools/deprecated-config-checker
directory. Example PR