Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.

Commit 129f919

Browse files
committed
Added per pod metrics to read dashboard
Signed-off-by: Joe Elliott <[email protected]>
1 parent 278192e commit 129f919

File tree

2 files changed

+41
-1
lines changed

2 files changed

+41
-1
lines changed

cortex-mixin/config.libsonnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,6 @@
4444
resources_dashboards_enabled: false,
4545

4646
// If supplied adds additional panels that are broken down per instance. i.e. 'pod' in a kubernetes install
47-
per_instance_label: '',
47+
per_instance_label: 'pod',
4848
},
4949
}

cortex-mixin/dashboards/reads.libsonnet

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ local utils = import 'mixin-utils/utils.libsonnet';
1414
$.panel('Latency') +
1515
utils.latencyRecordingRulePanel('cortex_request_duration_seconds', $.jobSelector($._config.job_names.gateway) + [utils.selector.re('route', 'api_prom_api_v1_.+')])
1616
)
17+
.addPanelIf(
18+
$._config.per_instance_label != '',
19+
$.panel('Per %s p99 Latency' % $._config.per_instance_label) +
20+
$.hiddenLegendQueryPanel(
21+
'histogram_quantile(0.99, sum by(le, %s) (rate(cortex_request_duration_seconds_bucket{%s, route=~"api_prom_api_v1_.+"}[$__interval])))' % [$._config.per_instance_label, $.jobMatcherEquality($._config.job_names.gateway)], ''
22+
) +
23+
{ yaxes: $.yaxes('s') }
24+
)
1725
)
1826
.addRow(
1927
$.row('Query Frontend')
@@ -25,6 +33,14 @@ local utils = import 'mixin-utils/utils.libsonnet';
2533
$.panel('Latency') +
2634
utils.latencyRecordingRulePanel('cortex_request_duration_seconds', $.jobSelector($._config.job_names.query_frontend) + [utils.selector.re('route', 'api_prom_api_v1_.+')])
2735
)
36+
.addPanelIf(
37+
$._config.per_instance_label != '',
38+
$.panel('Per %s p99 Latency' % $._config.per_instance_label) +
39+
$.hiddenLegendQueryPanel(
40+
'histogram_quantile(0.99, sum by(le, %s) (rate(cortex_request_duration_seconds_bucket{%s, route=~"api_prom_api_v1_.+"}[$__interval])))' % [$._config.per_instance_label, $.jobMatcherEquality($._config.job_names.query_frontend)], ''
41+
) +
42+
{ yaxes: $.yaxes('s') }
43+
)
2844
)
2945
.addRow(
3046
$.row('Cache - Query Results')
@@ -47,6 +63,14 @@ local utils = import 'mixin-utils/utils.libsonnet';
4763
$.panel('Latency') +
4864
utils.latencyRecordingRulePanel('cortex_request_duration_seconds', $.jobSelector($._config.job_names.querier) + [utils.selector.re('route', 'api_prom_api_v1_.+')])
4965
)
66+
.addPanelIf(
67+
$._config.per_instance_label != '',
68+
$.panel('Per %s p99 Latency' % $._config.per_instance_label) +
69+
$.hiddenLegendQueryPanel(
70+
'histogram_quantile(0.99, sum by(le, %s) (rate(cortex_request_duration_seconds_bucket{%s, route=~"api_prom_api_v1_.+"}[$__interval])))' % [$._config.per_instance_label, $.jobMatcherEquality($._config.job_names.querier)], ''
71+
) +
72+
{ yaxes: $.yaxes('s') }
73+
)
5074
)
5175
.addRow(
5276
$.row('Ingester')
@@ -58,6 +82,14 @@ local utils = import 'mixin-utils/utils.libsonnet';
5882
$.panel('Latency') +
5983
utils.latencyRecordingRulePanel('cortex_request_duration_seconds', $.jobSelector($._config.job_names.ingester) + [utils.selector.re('route', '/cortex.Ingester/Query(Stream)?|/cortex.Ingester/MetricsForLabelMatchers|/cortex.Ingester/LabelValues|/cortex.Ingester/MetricsMetadata')])
6084
)
85+
.addPanelIf(
86+
$._config.per_instance_label != '',
87+
$.panel('Per %s p99 Latency' % $._config.per_instance_label) +
88+
$.hiddenLegendQueryPanel(
89+
'histogram_quantile(0.99, sum by(le, %s) (rate(cortex_request_duration_seconds_bucket{%s, route=~"/cortex.Ingester/Query(Stream)?|/cortex.Ingester/MetricsForLabelMatchers|/cortex.Ingester/LabelValues|/cortex.Ingester/MetricsMetadata"}[$__interval])))' % [$._config.per_instance_label, $.jobMatcherEquality($._config.job_names.ingester)], ''
90+
) +
91+
{ yaxes: $.yaxes('s') }
92+
)
6193
)
6294
.addRowIf(
6395
std.member($._config.storage_engine, 'blocks'),
@@ -70,6 +102,14 @@ local utils = import 'mixin-utils/utils.libsonnet';
70102
$.panel('Latency') +
71103
utils.latencyRecordingRulePanel('cortex_request_duration_seconds', $.jobSelector($._config.job_names.store_gateway) + [utils.selector.re('route', '/gatewaypb.StoreGateway/.*')])
72104
)
105+
.addPanelIf(
106+
$._config.per_instance_label != '',
107+
$.panel('Per %s p99 Latency' % $._config.per_instance_label) +
108+
$.hiddenLegendQueryPanel(
109+
'histogram_quantile(0.99, sum by(le, %s) (rate(cortex_request_duration_seconds_bucket{%s, route=~"/gatewaypb.StoreGateway/.*"}[$__interval])))' % [$._config.per_instance_label, $.jobMatcherEquality($._config.job_names.store_gateway)], ''
110+
) +
111+
{ yaxes: $.yaxes('s') }
112+
)
73113
)
74114
.addRowIf(
75115
std.member($._config.storage_engine, 'chunks'),

0 commit comments

Comments
 (0)