diff options
author | beorn7 <beorn@grafana.com> | 2019-08-15 16:32:54 +0200 |
---|---|---|
committer | beorn7 <beorn@grafana.com> | 2019-08-15 16:32:54 +0200 |
commit | a016d9cd6f43ba8be47f624de95113f897e1b9f9 (patch) | |
tree | ffa0b27345d0f4a6a8bdf3db46d23bc6f840ef3e /docs | |
parent | 7ef6f2576d5bef2fabb9e033a92da4d5a835915b (diff) | |
download | prometheus_node_collector-a016d9cd6f43ba8be47f624de95113f897e1b9f9.tar.bz2 prometheus_node_collector-a016d9cd6f43ba8be47f624de95113f897e1b9f9.tar.xz prometheus_node_collector-a016d9cd6f43ba8be47f624de95113f897e1b9f9.zip |
node-mixin: Improve disk usage panel
- Use a stacked graph instead of a gauge as development over time is
especially useful for disk space usage.
- By only taking one metric per device into account, we avoid
double-counting for devices that are mounted multiple times.
Signed-off-by: beorn7 <beorn@grafana.com>
Diffstat (limited to 'docs')
-rw-r--r-- | docs/node-mixin/dashboards/node.libsonnet | 66 |
1 files changed, 50 insertions, 16 deletions
diff --git a/docs/node-mixin/dashboards/node.libsonnet b/docs/node-mixin/dashboards/node.libsonnet index 8e279c8..8e29b38 100644 --- a/docs/node-mixin/dashboards/node.libsonnet +++ b/docs/node-mixin/dashboards/node.libsonnet | |||
@@ -39,6 +39,7 @@ local gauge = promgrafonnet.gauge; | |||
39 | datasource='$datasource', | 39 | datasource='$datasource', |
40 | span=6, | 40 | span=6, |
41 | format='short', | 41 | format='short', |
42 | min=0, | ||
42 | fill=0, | 43 | fill=0, |
43 | ) | 44 | ) |
44 | .addTarget(prometheus.target('node_load1{%(nodeExporterSelector)s, instance="$instance"}' % $._config, legendFormat='1m load average')) | 45 | .addTarget(prometheus.target('node_load1{%(nodeExporterSelector)s, instance="$instance"}' % $._config, legendFormat='1m load average')) |
@@ -90,7 +91,8 @@ local gauge = promgrafonnet.gauge; | |||
90 | graphPanel.new( | 91 | graphPanel.new( |
91 | 'Disk I/O', | 92 | 'Disk I/O', |
92 | datasource='$datasource', | 93 | datasource='$datasource', |
93 | span=9, | 94 | span=6, |
95 | min=0, | ||
94 | fill=0, | 96 | fill=0, |
95 | ) | 97 | ) |
96 | // TODO: Does it make sense to have those three in the same panel? | 98 | // TODO: Does it make sense to have those three in the same panel? |
@@ -126,21 +128,51 @@ local gauge = promgrafonnet.gauge; | |||
126 | ], | 128 | ], |
127 | }; | 129 | }; |
128 | 130 | ||
129 | // TODO: It would be nicer to have a gauge that gets a 0-1 range and displays it as a percentage 0%-100%. | 131 | // TODO: Somehow partition this by device while excluding read-only devices. |
130 | // This needs to be added upstream in the promgrafonnet library and then changed here. | 132 | local diskSpaceUsage = |
131 | // TODO: Should this be partitioned by mountpoint? | 133 | graphPanel.new( |
132 | local diskSpaceUsage = gauge.new( | 134 | 'Disk Space Usage', |
133 | 'Disk Space Usage', | 135 | datasource='$datasource', |
134 | ||| | 136 | span=6, |
135 | 100 - | 137 | format='bytes', |
136 | ( | 138 | min=0, |
137 | sum(node_filesystem_avail_bytes{%(nodeExporterSelector)s, instance="$instance", %(fsSelector)s}) | 139 | fill=1, |
138 | / | 140 | stack=true, |
139 | sum(node_filesystem_size_bytes{%(nodeExporterSelector)s, instance="$instance", %(fsSelector)s}) | 141 | ) |
140 | * 100 | 142 | .addTarget(prometheus.target( |
141 | ) | 143 | ||| |
142 | ||| % $._config, | 144 | sum( |
143 | ).withLowerBeingBetter(); | 145 | max by (device) ( |
146 | node_filesystem_size_bytes{%(nodeExporterSelector)s, instance="$instance", %(fsSelector)s} | ||
147 | - | ||
148 | node_filesystem_avail_bytes{%(nodeExporterSelector)s, instance="$instance", %(fsSelector)s} | ||
149 | ) | ||
150 | ) | ||
151 | ||| % $._config, | ||
152 | legendFormat='used', | ||
153 | )) | ||
154 | .addTarget(prometheus.target( | ||
155 | ||| | ||
156 | sum( | ||
157 | max by (device) ( | ||
158 | node_filesystem_avail_bytes{%(nodeExporterSelector)s, instance="$instance", %(fsSelector)s} | ||
159 | ) | ||
160 | ) | ||
161 | ||| % $._config, | ||
162 | legendFormat='available', | ||
163 | )) + | ||
164 | { | ||
165 | seriesOverrides: [ | ||
166 | { | ||
167 | alias: 'used', | ||
168 | color: '#E0B400', | ||
169 | }, | ||
170 | { | ||
171 | alias: 'available', | ||
172 | color: '#73BF69', | ||
173 | }, | ||
174 | ], | ||
175 | }; | ||
144 | 176 | ||
145 | local networkReceived = | 177 | local networkReceived = |
146 | graphPanel.new( | 178 | graphPanel.new( |
@@ -148,6 +180,7 @@ local gauge = promgrafonnet.gauge; | |||
148 | datasource='$datasource', | 180 | datasource='$datasource', |
149 | span=6, | 181 | span=6, |
150 | format='bytes', | 182 | format='bytes', |
183 | min=0, | ||
151 | fill=0, | 184 | fill=0, |
152 | ) | 185 | ) |
153 | .addTarget(prometheus.target( | 186 | .addTarget(prometheus.target( |
@@ -162,6 +195,7 @@ local gauge = promgrafonnet.gauge; | |||
162 | datasource='$datasource', | 195 | datasource='$datasource', |
163 | span=6, | 196 | span=6, |
164 | format='bytes', | 197 | format='bytes', |
198 | min=0, | ||
165 | fill=0, | 199 | fill=0, |
166 | ) | 200 | ) |
167 | .addTarget(prometheus.target( | 201 | .addTarget(prometheus.target( |