From 8cdd14b185a645ef8648b0326852db5431ec9448 Mon Sep 17 00:00:00 2001 From: William Date: Fri, 30 Dec 2022 10:30:34 +0100 Subject: [PATCH] feat: Add local monitoring --- monitoring/docker-compose.yml | 15 +++++++++++++++ monitoring/prometheus.example.yml | 5 +++++ 2 files changed, 20 insertions(+) diff --git a/monitoring/docker-compose.yml b/monitoring/docker-compose.yml index 1ca0a90..f524ca6 100644 --- a/monitoring/docker-compose.yml +++ b/monitoring/docker-compose.yml @@ -61,3 +61,18 @@ services: networks: - web - monitoring + + nodeexporter: + image: prom/node-exporter:v1.5.0 + restart: unless-stopped + volumes: + - /proc:/host/proc:ro + - /sys:/host/sys:ro + - /:/rootfs:ro + command: + - '--path.procfs=/host/proc' + - '--path.rootfs=/rootfs' + - '--path.sysfs=/host/sys' + - '--collector.filesystem.ignored-mount-points=^/(sys|proc|dev|host|etc)($$|/)' + networks: + - monitoring diff --git a/monitoring/prometheus.example.yml b/monitoring/prometheus.example.yml index 0c56be8..43ca78d 100644 --- a/monitoring/prometheus.example.yml +++ b/monitoring/prometheus.example.yml @@ -5,6 +5,11 @@ global: monitor: codelab-monitor scrape_configs: + - job_name: 'node-local' + static_configs: + - targets: + - 'nodeexporter:9100' + - job_name: 'node' scheme: https basic_auth: