From a7dc32ac23455f4174fd19bbada9fc293310dbe5 Mon Sep 17 00:00:00 2001 From: Vladimir Varankin Date: Mon, 2 Sep 2024 11:32:56 +0200 Subject: [PATCH] mixin: improve ingest storage queries Signed-off-by: Vladimir Varankin --- .../mimir-mixin/dashboards/dashboard-queries.libsonnet | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/operations/mimir-mixin/dashboards/dashboard-queries.libsonnet b/operations/mimir-mixin/dashboards/dashboard-queries.libsonnet index d1b8db65bcd..bfa4cbfbb63 100644 --- a/operations/mimir-mixin/dashboards/dashboard-queries.libsonnet +++ b/operations/mimir-mixin/dashboards/dashboard-queries.libsonnet @@ -297,7 +297,10 @@ local utils = import 'mixin-utils/utils.libsonnet'; ingestOrClassicDeduplicatedQuery(perIngesterQuery, groupByLabels=''):: ||| ( # Classic storage - sum by (%(groupByCluster)s, %(groupByLabels)s) (%(perIngesterQuery)s) + sum by (%(groupByCluster)s, %(groupByLabels)s) ( + %(perIngesterQuery)s unless on (job) + cortex_partition_ring_partitions{%(ingester)s} + ) / on (%(groupByCluster)s) group_left() max by (%(groupByCluster)s) (cortex_distributor_replication_factor{%(distributor)s}) ) @@ -318,6 +321,7 @@ local utils = import 'mixin-utils/utils.libsonnet'; groupByLabels: groupByLabels, groupByCluster: $._config.group_by_cluster, distributor: variables.distributorMatcher, + ingester: variables.ingesterMatcher, }, },