mirror of
https://github.com/prometheus/node_exporter.git
synced 2025-03-05 21:00:12 -08:00
Merge pull request #1450 from prometheus/beorn7/mixin
More improvements for the node dashboard
This commit is contained in:
commit
d208140290
|
@ -12,7 +12,7 @@ local gauge = promgrafonnet.gauge;
|
||||||
'nodes.json':
|
'nodes.json':
|
||||||
local idleCPU =
|
local idleCPU =
|
||||||
graphPanel.new(
|
graphPanel.new(
|
||||||
'Idle CPU',
|
'CPU Usage',
|
||||||
datasource='$datasource',
|
datasource='$datasource',
|
||||||
span=6,
|
span=6,
|
||||||
format='percentunit',
|
format='percentunit',
|
||||||
|
@ -39,11 +39,13 @@ local gauge = promgrafonnet.gauge;
|
||||||
datasource='$datasource',
|
datasource='$datasource',
|
||||||
span=6,
|
span=6,
|
||||||
format='short',
|
format='short',
|
||||||
|
min=0,
|
||||||
fill=0,
|
fill=0,
|
||||||
)
|
)
|
||||||
.addTarget(prometheus.target('node_load1{%(nodeExporterSelector)s, instance="$instance"}' % $._config, legendFormat='1m load average'))
|
.addTarget(prometheus.target('node_load1{%(nodeExporterSelector)s, instance="$instance"}' % $._config, legendFormat='1m load average'))
|
||||||
.addTarget(prometheus.target('node_load5{%(nodeExporterSelector)s, instance="$instance"}' % $._config, legendFormat='5m load average'))
|
.addTarget(prometheus.target('node_load5{%(nodeExporterSelector)s, instance="$instance"}' % $._config, legendFormat='5m load average'))
|
||||||
.addTarget(prometheus.target('node_load15{%(nodeExporterSelector)s, instance="$instance"}' % $._config, legendFormat='15m load average'));
|
.addTarget(prometheus.target('node_load15{%(nodeExporterSelector)s, instance="$instance"}' % $._config, legendFormat='15m load average'))
|
||||||
|
.addTarget(prometheus.target('count(node_cpu_seconds_total{%(nodeExporterSelector)s, instance="$instance", mode="idle"})' % $._config, legendFormat='logical cores'));
|
||||||
|
|
||||||
local memoryGraph =
|
local memoryGraph =
|
||||||
graphPanel.new(
|
graphPanel.new(
|
||||||
|
@ -90,7 +92,8 @@ local gauge = promgrafonnet.gauge;
|
||||||
graphPanel.new(
|
graphPanel.new(
|
||||||
'Disk I/O',
|
'Disk I/O',
|
||||||
datasource='$datasource',
|
datasource='$datasource',
|
||||||
span=9,
|
span=6,
|
||||||
|
min=0,
|
||||||
fill=0,
|
fill=0,
|
||||||
)
|
)
|
||||||
// TODO: Does it make sense to have those three in the same panel?
|
// TODO: Does it make sense to have those three in the same panel?
|
||||||
|
@ -126,21 +129,51 @@ local gauge = promgrafonnet.gauge;
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO: It would be nicer to have a gauge that gets a 0-1 range and displays it as a percentage 0%-100%.
|
// TODO: Somehow partition this by device while excluding read-only devices.
|
||||||
// This needs to be added upstream in the promgrafonnet library and then changed here.
|
local diskSpaceUsage =
|
||||||
// TODO: Should this be partitioned by mountpoint?
|
graphPanel.new(
|
||||||
local diskSpaceUsage = gauge.new(
|
|
||||||
'Disk Space Usage',
|
'Disk Space Usage',
|
||||||
|
datasource='$datasource',
|
||||||
|
span=6,
|
||||||
|
format='bytes',
|
||||||
|
min=0,
|
||||||
|
fill=1,
|
||||||
|
stack=true,
|
||||||
|
)
|
||||||
|
.addTarget(prometheus.target(
|
||||||
|||
|
|||
|
||||||
100 -
|
sum(
|
||||||
(
|
max by (device) (
|
||||||
sum(node_filesystem_avail_bytes{%(nodeExporterSelector)s, instance="$instance", %(fsSelector)s})
|
node_filesystem_size_bytes{%(nodeExporterSelector)s, instance="$instance", %(fsSelector)s}
|
||||||
/
|
-
|
||||||
sum(node_filesystem_size_bytes{%(nodeExporterSelector)s, instance="$instance", %(fsSelector)s})
|
node_filesystem_avail_bytes{%(nodeExporterSelector)s, instance="$instance", %(fsSelector)s}
|
||||||
* 100
|
)
|
||||||
)
|
)
|
||||||
||| % $._config,
|
||| % $._config,
|
||||||
).withLowerBeingBetter();
|
legendFormat='used',
|
||||||
|
))
|
||||||
|
.addTarget(prometheus.target(
|
||||||
|
|||
|
||||||
|
sum(
|
||||||
|
max by (device) (
|
||||||
|
node_filesystem_avail_bytes{%(nodeExporterSelector)s, instance="$instance", %(fsSelector)s}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
||| % $._config,
|
||||||
|
legendFormat='available',
|
||||||
|
)) +
|
||||||
|
{
|
||||||
|
seriesOverrides: [
|
||||||
|
{
|
||||||
|
alias: 'used',
|
||||||
|
color: '#E0B400',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
alias: 'available',
|
||||||
|
color: '#73BF69',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
local networkReceived =
|
local networkReceived =
|
||||||
graphPanel.new(
|
graphPanel.new(
|
||||||
|
@ -148,6 +181,7 @@ local gauge = promgrafonnet.gauge;
|
||||||
datasource='$datasource',
|
datasource='$datasource',
|
||||||
span=6,
|
span=6,
|
||||||
format='bytes',
|
format='bytes',
|
||||||
|
min=0,
|
||||||
fill=0,
|
fill=0,
|
||||||
)
|
)
|
||||||
.addTarget(prometheus.target(
|
.addTarget(prometheus.target(
|
||||||
|
@ -162,6 +196,7 @@ local gauge = promgrafonnet.gauge;
|
||||||
datasource='$datasource',
|
datasource='$datasource',
|
||||||
span=6,
|
span=6,
|
||||||
format='bytes',
|
format='bytes',
|
||||||
|
min=0,
|
||||||
fill=0,
|
fill=0,
|
||||||
)
|
)
|
||||||
.addTarget(prometheus.target(
|
.addTarget(prometheus.target(
|
||||||
|
|
Loading…
Reference in a new issue