Skip to content

Commit

Permalink
mixin: improve ingest storage queries
Browse files Browse the repository at this point in the history
Signed-off-by: Vladimir Varankin <[email protected]>
  • Loading branch information
narqo committed Sep 2, 2024
1 parent 673cbe2 commit a7dc32a
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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})
)
Expand All @@ -318,6 +321,7 @@ local utils = import 'mixin-utils/utils.libsonnet';
groupByLabels: groupByLabels,
groupByCluster: $._config.group_by_cluster,
distributor: variables.distributorMatcher,
ingester: variables.ingesterMatcher,
},
},

Expand Down

0 comments on commit a7dc32a

Please sign in to comment.