From 0f94d4cf2bc15692f0f4f8c188ee50bf2bab64d9 Mon Sep 17 00:00:00 2001 From: Thomas Sibley Date: Thu, 5 Nov 2020 14:27:11 -0800 Subject: [PATCH] wip! enable systemd collector for prometheus' node_exporter Collects metrics for systemd units. XXX TODO: Likely needs more configuration in the form of additional node_exporter CLI options. --- backoffice.yaml | 5 +++++ tasks/prometheus.yaml | 13 +++++++++++++ 2 files changed, 18 insertions(+) diff --git a/backoffice.yaml b/backoffice.yaml index 0ea4a4a..4082776 100644 --- a/backoffice.yaml +++ b/backoffice.yaml @@ -33,6 +33,11 @@ name: prometheus state: reloaded + - name: prometheus-node-exporter is restarted + service: + name: prometheus-node-exporter + state: restarted + - name: promtail is restarted service: name: promtail diff --git a/tasks/prometheus.yaml b/tasks/prometheus.yaml index 8a9589e..232d123 100644 --- a/tasks/prometheus.yaml +++ b/tasks/prometheus.yaml @@ -48,6 +48,19 @@ notify: - prometheus is reloaded +- name: prometheus-node-exporter invocation is configured + replace: + path: /etc/default/prometheus-node-exporter + regexp: '(?ms)^ARGS=".+?"$' + replace: |- + ARGS="--collector.diskstats.ignored-devices=^(ram|loop|fd|(h|s|v|xv)d[a-z]|nvme\\d+n\\d+p)\\d+$ \ + --collector.filesystem.ignored-mount-points=^/(sys|proc|dev|run)($|/) \ + --collector.netdev.ignored-devices=^lo$ \ + --collector.textfile.directory=/var/lib/prometheus/node-exporter \ + --collector.systemd" + notify: + - prometheus-node-exporter is restarted + - name: prometheus-textfile group exists group: name: prometheus-textfile