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

Commit ebdf1f2

Browse files
committed
Consolidated panel logic
Signed-off-by: Joe Elliott <[email protected]>
1 parent 3ca0e0f commit ebdf1f2

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

cortex-mixin/dashboards/dashboard-utils.libsonnet

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,16 @@ local utils = import 'mixin-utils/utils.libsonnet';
7878
],
7979
},
8080

81+
// hiddenLegendQueryPanel is a standard query panel designed to handle a large number of series. it hides the legend, doesn't fill the series and
82+
// sorts the tooltip descending
83+
hiddenLegendQueryPanel(queries, legends, legendLink=null)::
84+
$.queryPanel(queries, legends, legendLink) +
85+
{
86+
legend: { show: false },
87+
fill: 0,
88+
tooltip: { sort: 2 },
89+
},
90+
8191
qpsPanel(selector)::
8292
super.qpsPanel(selector) + {
8393
targets: [

cortex-mixin/dashboards/writes.libsonnet

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ local utils = import 'mixin-utils/utils.libsonnet';
4242
)
4343
.addPanelIf(
4444
$._config.per_instance_label != '',
45-
$.panel('Per %s Latency' % $._config.per_instance_label) +
46-
$.queryPanel(
45+
$.panel('Per %s p99 Latency' % $._config.per_instance_label) +
46+
$.hiddenLegendQueryPanel(
4747
'histogram_quantile(0.99, sum by(le, %s) (rate(cortex_request_duration_seconds_bucket{%s, route="api_prom_push"}[$__interval])))' % [$._config.per_instance_label, $.jobMatcherEquality($._config.job_names.gateway)], ''
4848
) +
49-
{ yaxes: $.yaxes('s'), legend: { show: false }, fill: 0, tooltip: { sort: 2 } }
49+
{ yaxes: $.yaxes('s') }
5050
)
5151
)
5252
.addRow(

0 commit comments

Comments
 (0)