Skip to content

Commit

Permalink
Merge pull request #389 from grafana/fix-limits-query
Browse files Browse the repository at this point in the history
Make the overrides metric name configurable.
  • Loading branch information
gouthamve authored Sep 8, 2021
2 parents 2c00155 + 46e7e83 commit 23c2a3f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cortex-mixin/recording_rules.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ local utils = import 'mixin-utils/utils.libsonnet';
max_samples_per_sec_per_ingester: 80e3,
max_samples_per_sec_per_distributor: 240e3,
limit_utilisation_target: 0.6,
cortex_overrides_metric: 'cortex_overrides',
} + $._config + $._group_config,
prometheusRules+:: {
groups+: [
Expand Down Expand Up @@ -114,7 +115,7 @@ local utils = import 'mixin-utils/utils.libsonnet';
},
expr: |||
ceil(
sum by (cluster, namespace) (cortex_overrides{limit_name="ingestion_rate"})
sum by (cluster, namespace) (%(cortex_overrides_metric)s{limit_name="ingestion_rate"})
* %(limit_utilisation_target)s / %(max_samples_per_sec_per_distributor)s
)
||| % _config,
Expand Down Expand Up @@ -166,7 +167,7 @@ local utils = import 'mixin-utils/utils.libsonnet';
},
expr: |||
ceil(
sum by (cluster, namespace) (cortex_overrides{limit_name="max_global_series_per_user"})
sum by (cluster, namespace) (%(cortex_overrides_metric)s{limit_name="max_global_series_per_user"})
* 3 * %(limit_utilisation_target)s / %(max_series_per_ingester)s
)
||| % _config,
Expand All @@ -181,7 +182,7 @@ local utils = import 'mixin-utils/utils.libsonnet';
},
expr: |||
ceil(
sum by (cluster, namespace) (cortex_overrides{limit_name="ingestion_rate"})
sum by (cluster, namespace) (%(cortex_overrides_metric)s{limit_name="ingestion_rate"})
* %(limit_utilisation_target)s / %(max_samples_per_sec_per_ingester)s
)
||| % _config,
Expand Down

0 comments on commit 23c2a3f

Please sign in to comment.