From 2fd0cf769c1467c7126f5869790b7d9252b9099b Mon Sep 17 00:00:00 2001 From: jarno Date: Sun, 19 Jan 2025 12:39:06 +0100 Subject: [PATCH] ADD: cadvisor to prometheus datasource --- prometheus.yml | 6 +++++- swarm-compose.reverse-proxy.yml | 17 ++++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/prometheus.yml b/prometheus.yml index f5dce3f..e3268a6 100644 --- a/prometheus.yml +++ b/prometheus.yml @@ -8,4 +8,8 @@ scrape_configs: - job_name: 'node' static_configs: - - targets: [ 'node-exporter:9100' ] \ No newline at end of file + - targets: [ 'node-exporter:9100' ] + + - job_name: 'cadvisor' + static_configs: + - targets: [ 'cadvisor:8080' ] \ No newline at end of file diff --git a/swarm-compose.reverse-proxy.yml b/swarm-compose.reverse-proxy.yml index c196bef..8b781d3 100644 --- a/swarm-compose.reverse-proxy.yml +++ b/swarm-compose.reverse-proxy.yml @@ -72,13 +72,26 @@ services: node-exporter: networks: - - reverse_proxy_network + - logging_network image: prom/node-exporter + cadvisor: + image: gcr.io/cadvisor/cadvisor:latest + networks: + - logging_network + ports: + - ":8080" + volumes: + - /:/rootfs:ro + - /var/run:/var/run:rw + - /sys:/sys:ro + - /var/lib/docker/:/var/lib/docker:ro + prometheus: image: prom/prometheus networks: - reverse_proxy_network + - logging_network volumes: - ./prometheus.yml:/etc/prometheus/prometheus.yml command: @@ -90,6 +103,7 @@ services: image: grafana/grafana networks: - reverse_proxy_network + - logging_network environment: - GF_SECURITY_ADMIN_USER=admin - GF_SECURITY_ADMIN_PASSWORD=admin @@ -104,6 +118,7 @@ services: networks: reverse_proxy_network: external: true + logging_network: secrets: traefik_users: