Skip to content

Commit

Permalink
Disable multi-selection for variables in resources dashboards. (#251)
Browse files Browse the repository at this point in the history
* Disable multi-selection for variables in resources dashboards.

* CHANGELOG.md
  • Loading branch information
pstibrany authored Jan 20, 2021
1 parent 491c500 commit b9814fe
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## master / unreleased

* [CHANGE] Only single cluster and namespace can now be selected in "resources" dashboards. #251
* [ENHANCEMENT] Added `unregister_ingesters_on_shutdown` config option to disable unregistering ingesters on shutdown (default is enabled). #213
* [ENHANCEMENT] Improved blocks storage observability: #237
- Cortex / Queries: added bucket index load operations and latency (available only when bucket index is enabled)
Expand Down
2 changes: 1 addition & 1 deletion cortex-mixin/dashboards/alertmanager-resources.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ local utils = import 'mixin-utils/utils.libsonnet';
(import 'dashboard-utils.libsonnet') {
'alertmanager-resources.json':
($.dashboard('Cortex / Alertmanager Resources') + { uid: '68b66aed90ccab448009089544a8d6c6' })
.addClusterSelectorTemplates()
.addClusterSelectorTemplates(false)
.addRow(
$.row('Gateway')
.addPanel(
Expand Down
20 changes: 14 additions & 6 deletions cortex-mixin/dashboards/dashboard-utils.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ local utils = import 'mixin-utils/utils.libsonnet';
then self.addRow(row)
else self,

addClusterSelectorTemplates()::
addClusterSelectorTemplates(multi=true)::
local d = self {
tags: $._config.tags,
links: [
Expand All @@ -31,11 +31,19 @@ local utils = import 'mixin-utils/utils.libsonnet';
],
};

if $._config.singleBinary
then d.addMultiTemplate('job', 'cortex_build_info', 'job')
else d
.addMultiTemplate('cluster', 'cortex_build_info', 'cluster')
.addMultiTemplate('namespace', 'cortex_build_info', 'namespace'),
if multi then
if $._config.singleBinary
then d.addMultiTemplate('job', 'cortex_build_info', 'job')
else d
.addMultiTemplate('cluster', 'cortex_build_info', 'cluster')
.addMultiTemplate('namespace', 'cortex_build_info', 'namespace')
else
if $._config.singleBinary
then d.addTemplate('job', 'cortex_build_info', 'job')
else d
.addTemplate('cluster', 'cortex_build_info', 'cluster')
.addTemplate('namespace', 'cortex_build_info', 'namespace'),

},

// The mixin allow specialism of the job selector depending on if its a single binary
Expand Down
2 changes: 1 addition & 1 deletion cortex-mixin/dashboards/reads-resources.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ local utils = import 'mixin-utils/utils.libsonnet';
(import 'dashboard-utils.libsonnet') {
'cortex-reads-resources.json':
($.dashboard('Cortex / Reads Resources') + { uid: '2fd2cda9eea8d8af9fbc0a5960425120' })
.addClusterSelectorTemplates()
.addClusterSelectorTemplates(false)
.addRow(
$.row('Gateway')
.addPanel(
Expand Down
2 changes: 1 addition & 1 deletion cortex-mixin/dashboards/writes-resources.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ local utils = import 'mixin-utils/utils.libsonnet';
(import 'dashboard-utils.libsonnet') {
'cortex-writes-resources.json':
($.dashboard('Cortex / Writes Resources') + { uid: 'c0464f0d8bd026f776c9006b0591bb0b' })
.addClusterSelectorTemplates()
.addClusterSelectorTemplates(false)
.addRow(
$.row('Gateway')
.addPanel(
Expand Down

0 comments on commit b9814fe

Please sign in to comment.