1
0
mirror of https://github.com/prometheus/node_exporter.git synced 2026-02-05 15:45:10 +01:00

feat(mixin): add "All" option to cluster variable in dashboards

Enable the cluster variable to support an "All" option in Grafana
dashboards, allowing users to view metrics across all clusters or
in environments where the cluster label may be missing.

Changes:
- Add includeAll with allValue=".*" to cluster variable definitions
- Change all PromQL queries from exact matching (cluster="$cluster")
to regex matching (cluster=~"$cluster")

Affected dashboards:
- Node Exporter / Nodes (Linux, Darwin, AIX)
- USE Method / Node
- USE Method / Cluster

Signed-off-by: Willian Paixao <willian@ufpa.br>
This commit is contained in:
Willian Paixao
2025-12-22 22:36:29 +01:00
committed by Johannes 'fish' Ziemke
parent 53186b30e3
commit f09a706b76
2 changed files with 78 additions and 77 deletions

View File

@@ -112,7 +112,7 @@ local diskSpaceUtilisation =
)
+ (if $._config.showMultiCluster then variable.query.generalOptions.showOnDashboard.withLabelAndValue() else variable.query.generalOptions.showOnDashboard.withNothing())
+ variable.query.refresh.onTime()
+ variable.query.selectionOptions.withIncludeAll(false)
+ variable.query.selectionOptions.withIncludeAll(true, '.*')
+ variable.query.withSort(asc=true),
grafanaDashboards+:: {
@@ -133,7 +133,7 @@ local diskSpaceUtilisation =
+ variable.query.withDatasourceFromVariable(datasource)
+ variable.query.queryTypes.withLabelValues(
'instance',
'node_exporter_build_info{%(nodeExporterSelector)s, %(clusterLabel)s="$cluster"}' % $._config,
'node_exporter_build_info{%(nodeExporterSelector)s, %(clusterLabel)s=~"$cluster"}' % $._config,
)
+ variable.query.refresh.onTime()
+ variable.query.withSort(asc=true),
@@ -142,29 +142,29 @@ local diskSpaceUtilisation =
grafana.util.grid.makeGrid([
row.new('CPU')
+ row.withPanels([
CPUUtilisation + tsQueryOptions.withTargets([prometheus.new('$datasource', 'instance:node_cpu_utilisation:rate%(rateInterval)s{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"} != 0' % $._config) + prometheus.withLegendFormat('Utilisation')]),
CPUSaturation + tsQueryOptions.withTargets([prometheus.new('$datasource', 'instance:node_load1_per_cpu:ratio{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"} != 0' % $._config) + prometheus.withLegendFormat('Saturation')]),
CPUUtilisation + tsQueryOptions.withTargets([prometheus.new('$datasource', 'instance:node_cpu_utilisation:rate%(rateInterval)s{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s=~"$cluster"} != 0' % $._config) + prometheus.withLegendFormat('Utilisation')]),
CPUSaturation + tsQueryOptions.withTargets([prometheus.new('$datasource', 'instance:node_load1_per_cpu:ratio{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s=~"$cluster"} != 0' % $._config) + prometheus.withLegendFormat('Saturation')]),
]),
row.new('Memory')
+ row.withPanels([
memoryUtilisation + tsQueryOptions.withTargets([prometheus.new('$datasource', 'instance:node_memory_utilisation:ratio{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"} != 0' % $._config) + prometheus.withLegendFormat('Utilisation')]),
memorySaturation + tsQueryOptions.withTargets([prometheus.new('$datasource', 'instance:node_vmstat_pgmajfault:rate%(rateInterval)s{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"} != 0' % $._config) + prometheus.withLegendFormat('Major page Faults')]),
memoryUtilisation + tsQueryOptions.withTargets([prometheus.new('$datasource', 'instance:node_memory_utilisation:ratio{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s=~"$cluster"} != 0' % $._config) + prometheus.withLegendFormat('Utilisation')]),
memorySaturation + tsQueryOptions.withTargets([prometheus.new('$datasource', 'instance:node_vmstat_pgmajfault:rate%(rateInterval)s{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s=~"$cluster"} != 0' % $._config) + prometheus.withLegendFormat('Major page Faults')]),
]),
row.new('Network')
+ row.withPanels([
networkUtilisation + tsQueryOptions.withTargets([
prometheus.new('$datasource', 'instance:node_network_receive_bytes_excluding_lo:rate%(rateInterval)s{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"} != 0' % $._config) + prometheus.withLegendFormat('Receive'),
prometheus.new('$datasource', 'instance:node_network_transmit_bytes_excluding_lo:rate%(rateInterval)s{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"} != 0' % $._config) + prometheus.withLegendFormat('Transmit'),
prometheus.new('$datasource', 'instance:node_network_receive_bytes_excluding_lo:rate%(rateInterval)s{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s=~"$cluster"} != 0' % $._config) + prometheus.withLegendFormat('Receive'),
prometheus.new('$datasource', 'instance:node_network_transmit_bytes_excluding_lo:rate%(rateInterval)s{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s=~"$cluster"} != 0' % $._config) + prometheus.withLegendFormat('Transmit'),
]),
networkSaturation + tsQueryOptions.withTargets([
prometheus.new('$datasource', 'instance:node_network_receive_drop_excluding_lo:rate%(rateInterval)s{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"} != 0' % $._config) + prometheus.withLegendFormat('Receive'),
prometheus.new('$datasource', 'instance:node_network_transmit_drop_excluding_lo:rate%(rateInterval)s{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"} != 0' % $._config) + prometheus.withLegendFormat('Transmit'),
prometheus.new('$datasource', 'instance:node_network_receive_drop_excluding_lo:rate%(rateInterval)s{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s=~"$cluster"} != 0' % $._config) + prometheus.withLegendFormat('Receive'),
prometheus.new('$datasource', 'instance:node_network_transmit_drop_excluding_lo:rate%(rateInterval)s{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s=~"$cluster"} != 0' % $._config) + prometheus.withLegendFormat('Transmit'),
]),
]),
row.new('Disk IO')
+ row.withPanels([
diskIOUtilisation + tsQueryOptions.withTargets([prometheus.new('$datasource', 'instance_device:node_disk_io_time_seconds:rate%(rateInterval)s{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"} != 0' % $._config) + prometheus.withLegendFormat('{{device}}')]),
diskIOSaturation + tsQueryOptions.withTargets([prometheus.new('$datasource', 'instance_device:node_disk_io_time_weighted_seconds:rate%(rateInterval)s{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"} != 0' % $._config) + prometheus.withLegendFormat('{{device}}')]),
diskIOUtilisation + tsQueryOptions.withTargets([prometheus.new('$datasource', 'instance_device:node_disk_io_time_seconds:rate%(rateInterval)s{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s=~"$cluster"} != 0' % $._config) + prometheus.withLegendFormat('{{device}}')]),
diskIOSaturation + tsQueryOptions.withTargets([prometheus.new('$datasource', 'instance_device:node_disk_io_time_weighted_seconds:rate%(rateInterval)s{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s=~"$cluster"} != 0' % $._config) + prometheus.withLegendFormat('{{device}}')]),
]),
], panelWidth=12, panelHeight=7)
+ grafana.util.grid.makeGrid([
@@ -176,9 +176,9 @@ local diskSpaceUtilisation =
|||
sort_desc(1 -
(
max without (mountpoint, fstype) (node_filesystem_avail_bytes{%(nodeExporterSelector)s, fstype!="", instance="$instance", %(clusterLabel)s="$cluster"})
max without (mountpoint, fstype) (node_filesystem_avail_bytes{%(nodeExporterSelector)s, fstype!="", instance="$instance", %(clusterLabel)s=~"$cluster"})
/
max without (mountpoint, fstype) (node_filesystem_size_bytes{%(nodeExporterSelector)s, fstype!="", instance="$instance", %(clusterLabel)s="$cluster"})
max without (mountpoint, fstype) (node_filesystem_size_bytes{%(nodeExporterSelector)s, fstype!="", instance="$instance", %(clusterLabel)s=~"$cluster"})
) != 0
)
||| % $._config
@@ -210,11 +210,11 @@ local diskSpaceUtilisation =
'$datasource',
|||
((
instance:node_cpu_utilisation:rate%(rateInterval)s{%(nodeExporterSelector)s, %(clusterLabel)s="$cluster"}
instance:node_cpu_utilisation:rate%(rateInterval)s{%(nodeExporterSelector)s, %(clusterLabel)s=~"$cluster"}
*
instance:node_num_cpu:sum{%(nodeExporterSelector)s, %(clusterLabel)s="$cluster"}
instance:node_num_cpu:sum{%(nodeExporterSelector)s, %(clusterLabel)s=~"$cluster"}
) != 0 )
/ scalar(sum(instance:node_num_cpu:sum{%(nodeExporterSelector)s, %(clusterLabel)s="$cluster"}))
/ scalar(sum(instance:node_num_cpu:sum{%(nodeExporterSelector)s, %(clusterLabel)s=~"$cluster"}))
||| % $._config
) + prometheus.withLegendFormat('{{ instance }}'),
]),
@@ -223,8 +223,8 @@ local diskSpaceUtilisation =
'$datasource',
|||
(
instance:node_load1_per_cpu:ratio{%(nodeExporterSelector)s, %(clusterLabel)s="$cluster"}
/ scalar(count(instance:node_load1_per_cpu:ratio{%(nodeExporterSelector)s, %(clusterLabel)s="$cluster"}))
instance:node_load1_per_cpu:ratio{%(nodeExporterSelector)s, %(clusterLabel)s=~"$cluster"}
/ scalar(count(instance:node_load1_per_cpu:ratio{%(nodeExporterSelector)s, %(clusterLabel)s=~"$cluster"}))
) != 0
||| % $._config
) + prometheus.withLegendFormat('{{ instance }}'),
@@ -237,8 +237,8 @@ local diskSpaceUtilisation =
'$datasource',
|||
(
instance:node_memory_utilisation:ratio{%(nodeExporterSelector)s, %(clusterLabel)s="$cluster"}
/ scalar(count(instance:node_memory_utilisation:ratio{%(nodeExporterSelector)s, %(clusterLabel)s="$cluster"}))
instance:node_memory_utilisation:ratio{%(nodeExporterSelector)s, %(clusterLabel)s=~"$cluster"}
/ scalar(count(instance:node_memory_utilisation:ratio{%(nodeExporterSelector)s, %(clusterLabel)s=~"$cluster"}))
) != 0
||| % $._config
) + prometheus.withLegendFormat('{{ instance }}'),
@@ -246,7 +246,7 @@ local diskSpaceUtilisation =
memorySaturation + tsQueryOptions.withTargets([
prometheus.new(
'$datasource',
'instance:node_vmstat_pgmajfault:rate%(rateInterval)s{%(nodeExporterSelector)s, %(clusterLabel)s="$cluster"}' % $._config
'instance:node_vmstat_pgmajfault:rate%(rateInterval)s{%(nodeExporterSelector)s, %(clusterLabel)s=~"$cluster"}' % $._config
) + prometheus.withLegendFormat('{{ instance }}'),
]),
]),
@@ -255,21 +255,21 @@ local diskSpaceUtilisation =
networkUtilisation + tsQueryOptions.withTargets([
prometheus.new(
'$datasource',
'instance:node_network_receive_bytes_excluding_lo:rate%(rateInterval)s{%(nodeExporterSelector)s, %(clusterLabel)s="$cluster"} != 0' % $._config
'instance:node_network_receive_bytes_excluding_lo:rate%(rateInterval)s{%(nodeExporterSelector)s, %(clusterLabel)s=~"$cluster"} != 0' % $._config
) + prometheus.withLegendFormat('{{ instance }} Receive'),
prometheus.new(
'$datasource',
'instance:node_network_transmit_bytes_excluding_lo:rate%(rateInterval)s{%(nodeExporterSelector)s, %(clusterLabel)s="$cluster"} != 0' % $._config
'instance:node_network_transmit_bytes_excluding_lo:rate%(rateInterval)s{%(nodeExporterSelector)s, %(clusterLabel)s=~"$cluster"} != 0' % $._config
) + prometheus.withLegendFormat('{{ instance }} Transmit'),
]),
networkSaturation + tsQueryOptions.withTargets([
prometheus.new(
'$datasource',
'instance:node_network_receive_drop_excluding_lo:rate%(rateInterval)s{%(nodeExporterSelector)s, %(clusterLabel)s="$cluster"} != 0' % $._config
'instance:node_network_receive_drop_excluding_lo:rate%(rateInterval)s{%(nodeExporterSelector)s, %(clusterLabel)s=~"$cluster"} != 0' % $._config
) + prometheus.withLegendFormat('{{ instance }} Receive'),
prometheus.new(
'$datasource',
'instance:node_network_transmit_drop_excluding_lo:rate%(rateInterval)s{%(nodeExporterSelector)s, %(clusterLabel)s="$cluster"} != 0' % $._config
'instance:node_network_transmit_drop_excluding_lo:rate%(rateInterval)s{%(nodeExporterSelector)s, %(clusterLabel)s=~"$cluster"} != 0' % $._config
) + prometheus.withLegendFormat('{{ instance }} Transmit'),
]),
]),
@@ -279,16 +279,16 @@ local diskSpaceUtilisation =
prometheus.new(
'$datasource',
|||
instance_device:node_disk_io_time_seconds:rate%(rateInterval)s{%(nodeExporterSelector)s, %(clusterLabel)s="$cluster"}
/ scalar(count(instance_device:node_disk_io_time_seconds:rate%(rateInterval)s{%(nodeExporterSelector)s, %(clusterLabel)s="$cluster"}))
instance_device:node_disk_io_time_seconds:rate%(rateInterval)s{%(nodeExporterSelector)s, %(clusterLabel)s=~"$cluster"}
/ scalar(count(instance_device:node_disk_io_time_seconds:rate%(rateInterval)s{%(nodeExporterSelector)s, %(clusterLabel)s=~"$cluster"}))
||| % $._config
) + prometheus.withLegendFormat('{{ instance }} {{device}}'),
]),
diskIOSaturation + tsQueryOptions.withTargets([prometheus.new(
'$datasource',
|||
instance_device:node_disk_io_time_weighted_seconds:rate%(rateInterval)s{%(nodeExporterSelector)s, %(clusterLabel)s="$cluster"}
/ scalar(count(instance_device:node_disk_io_time_weighted_seconds:rate%(rateInterval)s{%(nodeExporterSelector)s, %(clusterLabel)s="$cluster"}))
instance_device:node_disk_io_time_weighted_seconds:rate%(rateInterval)s{%(nodeExporterSelector)s, %(clusterLabel)s=~"$cluster"}
/ scalar(count(instance_device:node_disk_io_time_weighted_seconds:rate%(rateInterval)s{%(nodeExporterSelector)s, %(clusterLabel)s=~"$cluster"}))
||| % $._config
) + prometheus.withLegendFormat('{{ instance }} {{device}}')]),
]),
@@ -302,12 +302,12 @@ local diskSpaceUtilisation =
|||
sum without (device) (
max without (fstype, mountpoint) ((
node_filesystem_size_bytes{%(nodeExporterSelector)s, %(fsSelector)s, %(fsMountpointSelector)s, %(clusterLabel)s="$cluster"}
node_filesystem_size_bytes{%(nodeExporterSelector)s, %(fsSelector)s, %(fsMountpointSelector)s, %(clusterLabel)s=~"$cluster"}
-
node_filesystem_avail_bytes{%(nodeExporterSelector)s, %(fsSelector)s, %(fsMountpointSelector)s, %(clusterLabel)s="$cluster"}
node_filesystem_avail_bytes{%(nodeExporterSelector)s, %(fsSelector)s, %(fsMountpointSelector)s, %(clusterLabel)s=~"$cluster"}
) != 0)
)
/ scalar(sum(max without (fstype, mountpoint) (node_filesystem_size_bytes{%(nodeExporterSelector)s, %(fsSelector)s, %(fsMountpointSelector)s, %(clusterLabel)s="$cluster"})))
/ scalar(sum(max without (fstype, mountpoint) (node_filesystem_size_bytes{%(nodeExporterSelector)s, %(fsSelector)s, %(fsMountpointSelector)s, %(clusterLabel)s=~"$cluster"})))
||| % $._config
) + prometheus.withLegendFormat('{{ instance }}'),
]),

View File

@@ -31,7 +31,8 @@ local tableTransformation = table.queryOptions.transformation;
+ variable.query.withDatasourceFromVariable(prometheusDatasourceVariable)
+ (if config.showMultiCluster then variable.query.generalOptions.showOnDashboard.withLabelAndValue() else variable.query.generalOptions.showOnDashboard.withNothing())
+ variable.query.refresh.onTime()
+ variable.query.generalOptions.withLabel('Cluster'),
+ variable.query.generalOptions.withLabel('Cluster')
+ variable.query.selectionOptions.withIncludeAll(true, '.*'),
local clusterVariable =
if platform == 'Darwin' then
@@ -58,13 +59,13 @@ local tableTransformation = table.queryOptions.transformation;
instanceVariablePrototype
+ variable.query.queryTypes.withLabelValues(
'instance',
'node_uname_info{%(nodeExporterSelector)s, %(clusterLabel)s="$cluster", sysname="Darwin"}' % config,
'node_uname_info{%(nodeExporterSelector)s, %(clusterLabel)s=~"$cluster", sysname="Darwin"}' % config,
)
else
instanceVariablePrototype
+ variable.query.queryTypes.withLabelValues(
'instance',
'node_uname_info{%(nodeExporterSelector)s, %(clusterLabel)s="$cluster", sysname!="Darwin"}' % config,
'node_uname_info{%(nodeExporterSelector)s, %(clusterLabel)s=~"$cluster", sysname!="Darwin"}' % config,
),
local idleCPU =
@@ -82,9 +83,9 @@ local tableTransformation = table.queryOptions.transformation;
'$datasource',
|||
(
(1 - sum without (mode) (rate(node_cpu_seconds_total{%(nodeExporterSelector)s, mode=~"idle|iowait|steal", instance="$instance", %(clusterLabel)s="$cluster"}[$__rate_interval])))
(1 - sum without (mode) (rate(node_cpu_seconds_total{%(nodeExporterSelector)s, mode=~"idle|iowait|steal", instance="$instance", %(clusterLabel)s=~"$cluster"}[$__rate_interval])))
/ ignoring(cpu) group_left
count without (cpu, mode) (node_cpu_seconds_total{%(nodeExporterSelector)s, mode="idle", instance="$instance", %(clusterLabel)s="$cluster"})
count without (cpu, mode) (node_cpu_seconds_total{%(nodeExporterSelector)s, mode="idle", instance="$instance", %(clusterLabel)s=~"$cluster"})
)
||| % config,
)
@@ -101,10 +102,10 @@ local tableTransformation = table.queryOptions.transformation;
+ tsCustom.withShowPoints('never')
+ tsOptions.tooltip.withMode('multi')
+ tsQueryOptions.withTargets([
prometheus.new('$datasource', 'node_load1{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"}' % config) + prometheus.withLegendFormat('1m load average'),
prometheus.new('$datasource', 'node_load5{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"}' % config) + prometheus.withLegendFormat('5m load average'),
prometheus.new('$datasource', 'node_load15{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"}' % config) + prometheus.withLegendFormat('15m load average'),
prometheus.new('$datasource', 'count(node_cpu_seconds_total{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster", mode="idle"})' % config) + prometheus.withLegendFormat('logical cores'),
prometheus.new('$datasource', 'node_load1{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s=~"$cluster"}' % config) + prometheus.withLegendFormat('1m load average'),
prometheus.new('$datasource', 'node_load5{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s=~"$cluster"}' % config) + prometheus.withLegendFormat('5m load average'),
prometheus.new('$datasource', 'node_load15{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s=~"$cluster"}' % config) + prometheus.withLegendFormat('15m load average'),
prometheus.new('$datasource', 'count(node_cpu_seconds_total{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s=~"$cluster", mode="idle"})' % config) + prometheus.withLegendFormat('logical cores'),
]),
local memoryGraphPanelPrototype =
@@ -125,34 +126,34 @@ local tableTransformation = table.queryOptions.transformation;
'$datasource',
|||
(
node_memory_MemTotal_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"}
node_memory_MemTotal_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s=~"$cluster"}
-
node_memory_MemFree_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"}
node_memory_MemFree_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s=~"$cluster"}
-
node_memory_Buffers_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"}
node_memory_Buffers_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s=~"$cluster"}
-
node_memory_Cached_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"}
node_memory_Cached_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s=~"$cluster"}
)
||| % config,
) + prometheus.withLegendFormat('memory used'),
prometheus.new('$datasource', 'node_memory_Buffers_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"}' % config) + prometheus.withLegendFormat('memory buffers'),
prometheus.new('$datasource', 'node_memory_Cached_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"}' % config) + prometheus.withLegendFormat('memory cached'),
prometheus.new('$datasource', 'node_memory_MemFree_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"}' % config) + prometheus.withLegendFormat('memory free'),
prometheus.new('$datasource', 'node_memory_Buffers_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s=~"$cluster"}' % config) + prometheus.withLegendFormat('memory buffers'),
prometheus.new('$datasource', 'node_memory_Cached_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s=~"$cluster"}' % config) + prometheus.withLegendFormat('memory cached'),
prometheus.new('$datasource', 'node_memory_MemFree_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s=~"$cluster"}' % config) + prometheus.withLegendFormat('memory free'),
])
else if platform == 'Darwin' then
// not useful to stack
memoryGraphPanelPrototype
+ tsCustom.stacking.withMode('none')
+ tsQueryOptions.withTargets([
prometheus.new('$datasource', 'node_memory_total_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"}' % config) + prometheus.withLegendFormat('Physical Memory'),
prometheus.new('$datasource', 'node_memory_total_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s=~"$cluster"}' % config) + prometheus.withLegendFormat('Physical Memory'),
prometheus.new(
'$datasource',
|||
(
node_memory_internal_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"} -
node_memory_purgeable_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"} +
node_memory_wired_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"} +
node_memory_compressed_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"}
node_memory_internal_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s=~"$cluster"} -
node_memory_purgeable_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s=~"$cluster"} +
node_memory_wired_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s=~"$cluster"} +
node_memory_compressed_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s=~"$cluster"}
)
||| % config
) + prometheus.withLegendFormat(
@@ -162,28 +163,28 @@ local tableTransformation = table.queryOptions.transformation;
'$datasource',
|||
(
node_memory_internal_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"} -
node_memory_purgeable_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"}
node_memory_internal_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s=~"$cluster"} -
node_memory_purgeable_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s=~"$cluster"}
)
||| % config
) + prometheus.withLegendFormat(
'App Memory'
),
prometheus.new('$datasource', 'node_memory_wired_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"}' % config) + prometheus.withLegendFormat('Wired Memory'),
prometheus.new('$datasource', 'node_memory_compressed_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"}' % config) + prometheus.withLegendFormat('Compressed'),
prometheus.new('$datasource', 'node_memory_wired_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s=~"$cluster"}' % config) + prometheus.withLegendFormat('Wired Memory'),
prometheus.new('$datasource', 'node_memory_compressed_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s=~"$cluster"}' % config) + prometheus.withLegendFormat('Compressed'),
])
else if platform == 'AIX' then
memoryGraphPanelPrototype
+ tsCustom.stacking.withMode('none')
+ tsQueryOptions.withTargets([
prometheus.new('$datasource', 'node_memory_total_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"}' % config) + prometheus.withLegendFormat('Physical Memory'),
prometheus.new('$datasource', 'node_memory_total_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s=~"$cluster"}' % config) + prometheus.withLegendFormat('Physical Memory'),
prometheus.new(
'$datasource',
|||
(
node_memory_total_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"} -
node_memory_available_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"}
node_memory_total_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s=~"$cluster"} -
node_memory_available_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s=~"$cluster"}
)
||| % config
) + prometheus.withLegendFormat('Memory Used'),
@@ -212,8 +213,8 @@ local tableTransformation = table.queryOptions.transformation;
|||
100 -
(
avg(node_memory_MemAvailable_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"}) /
avg(node_memory_MemTotal_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"})
avg(node_memory_MemAvailable_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s=~"$cluster"}) /
avg(node_memory_MemTotal_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s=~"$cluster"})
* 100
)
||| % config,
@@ -228,12 +229,12 @@ local tableTransformation = table.queryOptions.transformation;
|||
(
(
avg(node_memory_internal_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"}) -
avg(node_memory_purgeable_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"}) +
avg(node_memory_wired_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"}) +
avg(node_memory_compressed_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"})
avg(node_memory_internal_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s=~"$cluster"}) -
avg(node_memory_purgeable_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s=~"$cluster"}) +
avg(node_memory_wired_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s=~"$cluster"}) +
avg(node_memory_compressed_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s=~"$cluster"})
) /
avg(node_memory_total_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"})
avg(node_memory_total_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s=~"$cluster"})
)
*
100
@@ -249,8 +250,8 @@ local tableTransformation = table.queryOptions.transformation;
|||
100 -
(
avg(node_memory_available_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"}) /
avg(node_memory_total_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"})
avg(node_memory_available_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s=~"$cluster"}) /
avg(node_memory_total_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s=~"$cluster"})
* 100
)
||| % config
@@ -267,13 +268,13 @@ local tableTransformation = table.queryOptions.transformation;
+ tsOptions.tooltip.withMode('multi')
+ tsQueryOptions.withTargets([
// TODO: Does it make sense to have those three in the same panel?
prometheus.new('$datasource', 'rate(node_disk_read_bytes_total{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster", %(diskDeviceSelector)s}[$__rate_interval])' % config)
prometheus.new('$datasource', 'rate(node_disk_read_bytes_total{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s=~"$cluster", %(diskDeviceSelector)s}[$__rate_interval])' % config)
+ prometheus.withLegendFormat('{{device}} read')
+ prometheus.withIntervalFactor(1),
prometheus.new('$datasource', 'rate(node_disk_written_bytes_total{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster", %(diskDeviceSelector)s}[$__rate_interval])' % config)
prometheus.new('$datasource', 'rate(node_disk_written_bytes_total{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s=~"$cluster", %(diskDeviceSelector)s}[$__rate_interval])' % config)
+ prometheus.withLegendFormat('{{device}} written')
+ prometheus.withIntervalFactor(1),
prometheus.new('$datasource', 'rate(node_disk_io_time_seconds_total{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster", %(diskDeviceSelector)s}[$__rate_interval])' % config)
prometheus.new('$datasource', 'rate(node_disk_io_time_seconds_total{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s=~"$cluster", %(diskDeviceSelector)s}[$__rate_interval])' % config)
+ prometheus.withLegendFormat('{{device}} io time')
+ prometheus.withIntervalFactor(1),
])
@@ -303,7 +304,7 @@ local tableTransformation = table.queryOptions.transformation;
prometheus.new(
'$datasource',
|||
max by (mountpoint) (node_filesystem_size_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster", %(fsSelector)s, %(fsMountpointSelector)s})
max by (mountpoint) (node_filesystem_size_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s=~"$cluster", %(fsSelector)s, %(fsMountpointSelector)s})
||| % config
)
+ prometheus.withLegendFormat('')
@@ -312,7 +313,7 @@ local tableTransformation = table.queryOptions.transformation;
prometheus.new(
'$datasource',
|||
max by (mountpoint) (node_filesystem_avail_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster", %(fsSelector)s, %(fsMountpointSelector)s})
max by (mountpoint) (node_filesystem_avail_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s=~"$cluster", %(fsSelector)s, %(fsMountpointSelector)s})
||| % config
)
+ prometheus.withLegendFormat('')
@@ -431,7 +432,7 @@ local tableTransformation = table.queryOptions.transformation;
+ tsCustom.withShowPoints('never')
+ tsOptions.tooltip.withMode('multi')
+ tsQueryOptions.withTargets([
prometheus.new('$datasource', 'rate(node_network_receive_bytes_total{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster", device!="lo"}[$__rate_interval]) * 8' % config)
prometheus.new('$datasource', 'rate(node_network_receive_bytes_total{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s=~"$cluster", device!="lo"}[$__rate_interval]) * 8' % config)
+ prometheus.withLegendFormat('{{device}}')
+ prometheus.withIntervalFactor(1),
]),
@@ -445,7 +446,7 @@ local tableTransformation = table.queryOptions.transformation;
+ tsCustom.withFillOpacity(0)
+ tsOptions.tooltip.withMode('multi')
+ tsQueryOptions.withTargets([
prometheus.new('$datasource', 'rate(node_network_transmit_bytes_total{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster", device!="lo"}[$__rate_interval]) * 8' % config)
prometheus.new('$datasource', 'rate(node_network_transmit_bytes_total{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s=~"$cluster", device!="lo"}[$__rate_interval]) * 8' % config)
+ prometheus.withLegendFormat('{{device}}')
+ prometheus.withIntervalFactor(1),
]),