From 50a15afea8260d3b1bfcb88c1cddb07d634d1004 Mon Sep 17 00:00:00 2001 From: kasra Date: Mon, 12 Feb 2024 00:18:36 +0330 Subject: [PATCH] Add node exporter for metrics --- docker-compose.yaml | 10 +++++++++- prometheus/prometheus.yml | 3 ++- test.docker-compose.yaml | 3 +++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 13b6a9d..43a3a36 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -13,7 +13,15 @@ services: resources: limits: cpus: '0.2' - memory: 200M + memory: 300M + + node_exporter: + image: prom/node-exporter:latest + deploy: + resources: + limits: + cpus: '0.1' + memory: 100M grafana: image: grafana/grafana diff --git a/prometheus/prometheus.yml b/prometheus/prometheus.yml index 7b31675..ca5eb6f 100644 --- a/prometheus/prometheus.yml +++ b/prometheus/prometheus.yml @@ -12,11 +12,12 @@ alerting: scrape_configs: - job_name: prometheus honor_timestamps: true - scrape_interval: 15s + scrape_interval: 5s scrape_timeout: 10s metrics_path: /metrics scheme: http static_configs: + - targets: ['node_exporter:9100'] - targets: ['leader_0:9000'] - targets: ['leader_1:9000'] - targets: ['datanode_0:9000'] diff --git a/test.docker-compose.yaml b/test.docker-compose.yaml index 299ec22..b9d6013 100644 --- a/test.docker-compose.yaml +++ b/test.docker-compose.yaml @@ -10,6 +10,9 @@ services: - ./prometheus:/etc/prometheus - prom_data:/prometheus + node_exporter: + image: prom/node-exporter:latest + grafana: image: grafana/grafana container_name: grafana