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
This commit is contained in:
Pierre Riteau 2022-02-18 18:36:22 +01:00
parent b668e27356
commit b210dcd6e2
3 changed files with 8 additions and 3 deletions

View File

@ -191,8 +191,7 @@ prometheus_node_exporter_default_volumes:
- "/etc/localtime:/etc/localtime:ro"
- "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}"
- "kolla_logs:/var/log/kolla/"
- "/proc:/host/proc:ro"
- "/sys:/host/sys:ro"
- "/:/host:ro,rslave"
prometheus_memcached_exporter_default_volumes:
- "{{ node_config_directory }}/prometheus-memcached-exporter/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro"

View File

@ -1,5 +1,5 @@
{
"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 }}{% if prometheus_node_exporter_cmdline_extras %} {{ prometheus_node_exporter_cmdline_extras }}{% endif %}",
"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 }}{% if prometheus_node_exporter_cmdline_extras %} {{ prometheus_node_exporter_cmdline_extras }}{% endif %}",
"config_files": [],
"permissions": [
{

View File

@ -0,0 +1,6 @@
---
fixes:
- |
Fixes a configuration issue with Node Exporter causing all file system
metrics of a host to be identical.
`LP#1961438 <https://bugs.launchpad.net/kolla-ansible/+bug/1961438>`__