Skip to content

Commit c124496

Browse files
authored
Merge pull request grafana#401 from stevesg/split-api-rules
Split `cortex_api` recording rule group into three groups.
2 parents 0c84691 + aa070b4 commit c124496

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
* `_config` > `queryFrontend` > `shard_factor`
3232
* `_config` > `queryFrontend` > `sharded_queries_enabled`
3333
* `_config` > `queryFrontend` > `query_split_factor`
34+
* [CHANGE] Split `cortex_api` recording rule group into three groups. This is a workaround for large clusters where this group can become slow to evaluate. #401
3435
* [ENHANCEMENT] Add overrides config to compactor. This allows setting retention configs per user. #386
3536
* [ENHANCEMENT] cortex-mixin: Make `cluster_namespace_deployment:kube_pod_container_resource_requests_{cpu_cores,memory_bytes}:sum` backwards compatible with `kube-state-metrics` v2.0.0. #317
3637
* [ENHANCEMENT] Cortex-mixin: Include `cortex-gw-internal` naming variation in default `gateway` job names. #328

cortex-mixin/recording_rules.libsonnet

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,18 @@ local utils = import 'mixin-utils/utils.libsonnet';
1111
prometheusRules+:: {
1212
groups+: [
1313
{
14-
name: 'cortex_api',
14+
name: 'cortex_api_1',
15+
rules:
16+
utils.histogramRules('cortex_request_duration_seconds', ['cluster', 'job']),
17+
},
18+
{
19+
name: 'cortex_api_2',
20+
rules:
21+
utils.histogramRules('cortex_request_duration_seconds', ['cluster', 'job', 'route']),
22+
},
23+
{
24+
name: 'cortex_api_3',
1525
rules:
16-
utils.histogramRules('cortex_request_duration_seconds', ['cluster', 'job']) +
17-
utils.histogramRules('cortex_request_duration_seconds', ['cluster', 'job', 'route']) +
1826
utils.histogramRules('cortex_request_duration_seconds', ['cluster', 'namespace', 'job', 'route']),
1927
},
2028
{

0 commit comments

Comments
 (0)