Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dashboards: add flag to skip gateway #1761

Merged
merged 2 commits into from
Apr 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
* [ENHANCEMENT] Dashboards: Show QPS and latency of the Alertmanager Distributor. #1696
* [ENHANCEMENT] Playbooks: Add Alertmanager suggestions for `MimirRequestErrors` and `MimirRequestLatency` #1702
* [ENHANCEMENT] Dashboards: Allow custom datasources. #1749
* [ENHANCEMENT] Dashboards: Add config option `gateway_enabled` (defaults to `true`) to disable gateway panels from dashboards. #1761
* [BUGFIX] Dashboards: Fix "Failed evaluation rate" panel on Tenants dashboard. #1629
* [BUGFIX] Honor the configured `per_instance_label` in all dashboards and alerts. #1697

Expand Down
3 changes: 3 additions & 0 deletions operations/mimir-mixin/config.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
// Whether resources dashboards are enabled (based on cAdvisor metrics).
resources_dashboards_enabled: true,

// Whether mimir gateway is enabled
gateway_enabled: true,

// The label used to differentiate between different application instances (i.e. 'pod' in a kubernetes install).
per_instance_label: 'pod',

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ local utils = import 'mixin-utils/utils.libsonnet';
'mimir-alertmanager-resources.json':
($.dashboard('Alertmanager resources') + { uid: '68b66aed90ccab448009089544a8d6c6' })
.addClusterSelectorTemplates(false)
.addRow(
.addRowIf(
$._config.gateway_enabled,
$.row('Gateway')
.addPanel(
$.containerCPUUsagePanel('CPU', $._config.job_names.gateway),
Expand Down
3 changes: 2 additions & 1 deletion operations/mimir-mixin/dashboards/alertmanager.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ local utils = import 'mixin-utils/utils.libsonnet';
$.latencyPanel('cortex_alertmanager_notification_latency_seconds', '{%s}' % $.jobMatcher($._config.job_names.alertmanager))
)
)
.addRow(
.addRowIf(
$._config.gateway_enabled,
$.row('Configuration API (gateway) + Alertmanager UI')
.addPanel(
$.panel('QPS') +
Expand Down
8 changes: 8 additions & 0 deletions operations/mimir-mixin/dashboards/dashboard-utils.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ local utils = import 'mixin-utils/utils.libsonnet';

_config:: error 'must provide _config',

row(title)::
super.row(title) + {
addPanelIf(condition, panel)::
if condition
then self.addPanel(panel)
else self,
},

// Override the dashboard constructor to add:
// - default tags,
// - some links that propagate the selectred cluster.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ local utils = import 'mixin-utils/utils.libsonnet';
'mimir-reads-networking.json':
($.dashboard('Reads networking') + { uid: 'c0464f0d8bd026f776c9006b05910000' })
.addClusterSelectorTemplates(false)
.addRow($.jobNetworkingRow('Gateway', 'gateway'))
.addRowIf($._config.gateway_enabled, $.jobNetworkingRow('Gateway', 'gateway'))
.addRow($.jobNetworkingRow('Query-frontend', 'query_frontend'))
.addRow($.jobNetworkingRow('Query-scheduler', 'query_scheduler'))
.addRow($.jobNetworkingRow('Querier', 'querier'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ local utils = import 'mixin-utils/utils.libsonnet';
'mimir-reads-resources.json':
($.dashboard('Reads resources') + { uid: '2fd2cda9eea8d8af9fbc0a5960425120' })
.addClusterSelectorTemplates(false)
.addRow(
.addRowIf(
$._config.gateway_enabled,
$.row('Gateway')
.addPanel(
$.containerCPUUsagePanel('CPU', $._config.job_names.gateway),
Expand Down
3 changes: 2 additions & 1 deletion operations/mimir-mixin/dashboards/reads.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ local utils = import 'mixin-utils/utils.libsonnet';
),
)
)
.addRow(
.addRowIf(
$._config.gateway_enabled,
$.row('Gateway')
.addPanel(
$.panel('Requests / sec') +
Expand Down
3 changes: 2 additions & 1 deletion operations/mimir-mixin/dashboards/ruler.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ local utils = import 'mixin-utils/utils.libsonnet';
),
)
)
.addRow(
.addRowIf(
$._config.gateway_enabled,
$.row('Configuration API (gateway)')
.addPanel(
$.panel('QPS') +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ local utils = import 'mixin-utils/utils.libsonnet';
'mimir-writes-networking.json':
($.dashboard('Writes networking') + { uid: '681cd62b680b7154811fe73af55dcfd4' })
.addClusterSelectorTemplates(false)
.addRow($.jobNetworkingRow('Gateway', 'gateway'))
.addRowIf($._config.gateway_enabled, $.jobNetworkingRow('Gateway', 'gateway'))
.addRow($.jobNetworkingRow('Distributor', 'distributor'))
.addRow($.jobNetworkingRow('Ingester', 'ingester'))
+ {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ local utils = import 'mixin-utils/utils.libsonnet';
'mimir-writes-resources.json':
($.dashboard('Writes resources') + { uid: 'c0464f0d8bd026f776c9006b0591bb0b' })
.addClusterSelectorTemplates(false)
.addRow(
.addRowIf(
$._config.gateway_enabled,
$.row('Gateway')
.addPanel(
$.containerCPUUsagePanel('CPU', $._config.job_names.gateway),
Expand Down
6 changes: 4 additions & 2 deletions operations/mimir-mixin/dashboards/writes.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,14 @@ local utils = import 'mixin-utils/utils.libsonnet';
$.panel('Tenants') +
$.statPanel('count(count by(user) (cortex_ingester_active_series{%s}))' % $.jobMatcher($._config.job_names.ingester), format='short')
)
.addPanel(
.addPanelIf(
$._config.gateway_enabled,
$.panel('Requests / sec') +
$.statPanel('sum(rate(cortex_request_duration_seconds_count{%s, route=~"api_(v1|prom)_push"}[5m]))' % $.jobMatcher($._config.job_names.gateway), format='reqps')
)
)
.addRow(
.addRowIf(
$._config.gateway_enabled,
$.row('Gateway')
.addPanel(
$.panel('Requests / sec') +
Expand Down