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

Commit b9814fe

Browse files
authored
Disable multi-selection for variables in resources dashboards. (#251)
* Disable multi-selection for variables in resources dashboards. * CHANGELOG.md
1 parent 491c500 commit b9814fe

File tree

5 files changed

+18
-9
lines changed

5 files changed

+18
-9
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## master / unreleased
44

5+
* [CHANGE] Only single cluster and namespace can now be selected in "resources" dashboards. #251
56
* [ENHANCEMENT] Added `unregister_ingesters_on_shutdown` config option to disable unregistering ingesters on shutdown (default is enabled). #213
67
* [ENHANCEMENT] Improved blocks storage observability: #237
78
- Cortex / Queries: added bucket index load operations and latency (available only when bucket index is enabled)

cortex-mixin/dashboards/alertmanager-resources.libsonnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ local utils = import 'mixin-utils/utils.libsonnet';
33
(import 'dashboard-utils.libsonnet') {
44
'alertmanager-resources.json':
55
($.dashboard('Cortex / Alertmanager Resources') + { uid: '68b66aed90ccab448009089544a8d6c6' })
6-
.addClusterSelectorTemplates()
6+
.addClusterSelectorTemplates(false)
77
.addRow(
88
$.row('Gateway')
99
.addPanel(

cortex-mixin/dashboards/dashboard-utils.libsonnet

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ local utils = import 'mixin-utils/utils.libsonnet';
1414
then self.addRow(row)
1515
else self,
1616

17-
addClusterSelectorTemplates()::
17+
addClusterSelectorTemplates(multi=true)::
1818
local d = self {
1919
tags: $._config.tags,
2020
links: [
@@ -31,11 +31,19 @@ local utils = import 'mixin-utils/utils.libsonnet';
3131
],
3232
};
3333

34-
if $._config.singleBinary
35-
then d.addMultiTemplate('job', 'cortex_build_info', 'job')
36-
else d
37-
.addMultiTemplate('cluster', 'cortex_build_info', 'cluster')
38-
.addMultiTemplate('namespace', 'cortex_build_info', 'namespace'),
34+
if multi then
35+
if $._config.singleBinary
36+
then d.addMultiTemplate('job', 'cortex_build_info', 'job')
37+
else d
38+
.addMultiTemplate('cluster', 'cortex_build_info', 'cluster')
39+
.addMultiTemplate('namespace', 'cortex_build_info', 'namespace')
40+
else
41+
if $._config.singleBinary
42+
then d.addTemplate('job', 'cortex_build_info', 'job')
43+
else d
44+
.addTemplate('cluster', 'cortex_build_info', 'cluster')
45+
.addTemplate('namespace', 'cortex_build_info', 'namespace'),
46+
3947
},
4048

4149
// The mixin allow specialism of the job selector depending on if its a single binary

cortex-mixin/dashboards/reads-resources.libsonnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ local utils = import 'mixin-utils/utils.libsonnet';
33
(import 'dashboard-utils.libsonnet') {
44
'cortex-reads-resources.json':
55
($.dashboard('Cortex / Reads Resources') + { uid: '2fd2cda9eea8d8af9fbc0a5960425120' })
6-
.addClusterSelectorTemplates()
6+
.addClusterSelectorTemplates(false)
77
.addRow(
88
$.row('Gateway')
99
.addPanel(

cortex-mixin/dashboards/writes-resources.libsonnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ local utils = import 'mixin-utils/utils.libsonnet';
33
(import 'dashboard-utils.libsonnet') {
44
'cortex-writes-resources.json':
55
($.dashboard('Cortex / Writes Resources') + { uid: 'c0464f0d8bd026f776c9006b0591bb0b' })
6-
.addClusterSelectorTemplates()
6+
.addClusterSelectorTemplates(false)
77
.addRow(
88
$.row('Gateway')
99
.addPanel(

0 commit comments

Comments
 (0)