Skip to content

Commit 46406d9

Browse files
timursaikalievrexagod
authored andcommitted
fix(dashboards): disabling Multi-value selection option for the instance variable and other small fixes (kubernetes-monitoring#1013)
1 parent 252111d commit 46406d9

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

dashboards/dashboards.libsonnet

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@
66
(import 'scheduler.libsonnet') +
77
(import 'proxy.libsonnet') +
88
(import 'kubelet.libsonnet') +
9-
(import 'defaults.libsonnet')
9+
(import 'defaults.libsonnet') +
10+
(import 'windows.libsonnet')

dashboards/windows.libsonnet

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ local var = g.dashboard.variable;
7272
)
7373
+ var.query.generalOptions.withLabel('instance')
7474
+ var.query.refresh.onTime()
75-
+ var.query.generalOptions.showOnDashboard.withLabelAndValue()
76-
+ var.query.selectionOptions.withMulti(true),
75+
+ var.query.generalOptions.showOnDashboard.withLabelAndValue(),
7776

7877
namespace:
7978
var.query.new('namespace')
@@ -124,7 +123,7 @@ local var = g.dashboard.variable;
124123
statPanel(
125124
'CPU Utilisation',
126125
'none',
127-
'1 - avg(rate(windows_cpu_time_total{%(clusterLabel)s="$cluster", %(windowsExporterSelector)s, mode="idle"}[1m]))' % $._config
126+
'1 - avg(rate(windows_cpu_time_total{%(clusterLabel)s="$cluster", %(windowsExporterSelector)s, mode="idle"}[%(grafanaIntervalVar)s]))' % $._config
128127
)
129128
+ stat.gridPos.withW(4)
130129
+ stat.gridPos.withH(3),
@@ -830,13 +829,13 @@ local var = g.dashboard.variable;
830829
+ tsPanel.queryOptions.withTargets([
831830
prometheus.new(
832831
'${datasource}',
833-
'sort_desc(sum by (container) (rate(windows_container_network_received_bytes_total{%(clusterLabel)s="$cluster", namespace="$namespace", pod="$pod"}[1m])))' % $._config
832+
'sort_desc(sum by (container) (rate(windows_container_network_received_bytes_total{%(clusterLabel)s="$cluster", namespace="$namespace", pod="$pod"}[%(grafanaIntervalVar)s])))' % $._config
834833
)
835834
+ prometheus.withLegendFormat('Received : {{ container }}'),
836835

837836
prometheus.new(
838837
'${datasource}',
839-
'sort_desc(sum by (container) (rate(windows_container_network_transmitted_bytes_total{%(clusterLabel)s="$cluster", namespace="$namespace", pod="$pod"}[1m])))' % $._config
838+
'sort_desc(sum by (container) (rate(windows_container_network_transmitted_bytes_total{%(clusterLabel)s="$cluster", namespace="$namespace", pod="$pod"}[%(grafanaIntervalVar)s])))' % $._config
840839
)
841840
+ prometheus.withLegendFormat('Transmitted : {{ container }}'),
842841
]),
@@ -1025,19 +1024,19 @@ local var = g.dashboard.variable;
10251024
+ tsPanel.queryOptions.withTargets([
10261025
prometheus.new(
10271026
'${datasource}',
1028-
'max(rate(windows_logical_disk_read_bytes_total{%(clusterLabel)s="$cluster", %(windowsExporterSelector)s, instance="$instance"}[2m]))' % $._config
1027+
'max(rate(windows_logical_disk_read_bytes_total{%(clusterLabel)s="$cluster", %(windowsExporterSelector)s, instance="$instance"}[%(grafanaIntervalVar)s]))' % $._config
10291028
)
10301029
+ prometheus.withLegendFormat('read'),
10311030

10321031
prometheus.new(
10331032
'${datasource}',
1034-
'max(rate(windows_logical_disk_write_bytes_total{%(clusterLabel)s="$cluster", %(windowsExporterSelector)s, instance="$instance"}[2m]))' % $._config
1033+
'max(rate(windows_logical_disk_write_bytes_total{%(clusterLabel)s="$cluster", %(windowsExporterSelector)s, instance="$instance"}[%(grafanaIntervalVar)s]))' % $._config
10351034
)
10361035
+ prometheus.withLegendFormat('written'),
10371036

10381037
prometheus.new(
10391038
'${datasource}',
1040-
'max(rate(windows_logical_disk_read_seconds_total{%(clusterLabel)s="$cluster", %(windowsExporterSelector)s, instance="$instance"}[2m]) + rate(windows_logical_disk_write_seconds_total{%(clusterLabel)s="$cluster", %(windowsExporterSelector)s, instance="$instance"}[2m]))' % $._config
1039+
'max(rate(windows_logical_disk_read_seconds_total{%(clusterLabel)s="$cluster", %(windowsExporterSelector)s, instance="$instance"}[%(grafanaIntervalVar)s]) + rate(windows_logical_disk_write_seconds_total{%(clusterLabel)s="$cluster", %(windowsExporterSelector)s, instance="$instance"}[%(grafanaIntervalVar)s]))' % $._config
10411040
)
10421041
+ prometheus.withLegendFormat('io time'),
10431042
])

rules/rules.libsonnet

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
(import 'apps.libsonnet') +
33
(import 'kube_scheduler.libsonnet') +
44
(import 'node.libsonnet') +
5-
(import 'kubelet.libsonnet')
5+
(import 'kubelet.libsonnet') +
6+
(import 'windows.libsonnet')

0 commit comments

Comments
 (0)