Skip to content

Commit ae46e80

Browse files
committed
Configure node-exporter to report correct file system metrics
Without this configuration, all mount points are reporting the same utilisation metrics [1]. With the rslave option, all root mounts from the host are visible in the container, so we can remove the bind mounts for /proc and /sys. [1] https://github.com/prometheus/node_exporter#docker Change-Id: I4087dc81f9d1fa5daa24b9df6daf1f9e1ccd702f Closes-Bug: #1961438 (cherry picked from commit b210dcd)
1 parent 5fadf56 commit ae46e80

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

ansible/roles/prometheus/defaults/main.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,7 @@ prometheus_node_exporter_default_volumes:
199199
- "/etc/localtime:/etc/localtime:ro"
200200
- "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}"
201201
- "kolla_logs:/var/log/kolla/"
202-
- "/proc:/host/proc:ro"
203-
- "/sys:/host/sys:ro"
202+
- "/:/host:ro,rslave"
204203
prometheus_memcached_exporter_default_volumes:
205204
- "{{ node_config_directory }}/prometheus-memcached-exporter/:{{ container_config_directory }}/:ro"
206205
- "/etc/localtime:/etc/localtime:ro"

ansible/roles/prometheus/templates/prometheus-node-exporter.json.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"command": "/opt/node_exporter/node_exporter --path.procfs /host/proc --path.sysfs /host/sys --web.listen-address {{ api_interface_address | put_address_in_context('url') }}:{{ prometheus_node_exporter_port }}",
2+
"command": "/opt/node_exporter/node_exporter --path.procfs /host/proc --path.sysfs /host/sys --path.rootfs /host --web.listen-address {{ api_interface_address | put_address_in_context('url') }}:{{ prometheus_node_exporter_port }}",
33
"config_files": [],
44
"permissions": [
55
{
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
fixes:
3+
- |
4+
Fixes a configuration issue with Node Exporter causing all file system
5+
metrics of a host to be identical.
6+
`LP#1961438 <https://bugs.launchpad.net/kolla-ansible/+bug/1961438>`__

0 commit comments

Comments
 (0)