diff --git a/docker/graphana-prometheus/docker-compose.yml b/docker/graphana-prometheus/docker-compose.yml new file mode 100644 index 0000000..8ea8a83 --- /dev/null +++ b/docker/graphana-prometheus/docker-compose.yml @@ -0,0 +1,60 @@ +version: "3.3" + +networks: + monitoring: + +volumes: + grafana_data: + prometheus_data: + +services: + grafana: + image: grafana/grafana:10.4.0 + restart: unless-stopped + environment: + GF_SECURITY_ADMIN_USER: ${GRAFANA_ADMIN_USER:-admin} + GF_SECURITY_ADMIN_PASSWORD: ${GRAFANA_ADMIN_PASSWORD:-changeme} + expose: + - 3000 + ports: + - 5000:3000 + volumes: + - grafana_data:/var/lib/grafana + networks: + - monitoring + + prometheus: + image: prom/prometheus:v2.52.0 + restart: unless-stopped + command: + - '--config.file=/etc/prometheus/prometheus.yml' + - '--storage.tsdb.path=/prometheus' + - '--web.console.libraries=/usr/share/prometheus/console_libraries' + - '--web.console.templates=/usr/share/prometheus/consoles' + - '--web.enable-admin-api' + volumes: + - ./files/prometheus/etc/prometheus/:/etc/prometheus/ + - prometheus_data:/prometheus + ports: + - 5001:9090 + + networks: + - monitoring + + node_exporter: + image: prom/node-exporter:v1.8.1 + 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.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)' + + networks: + - monitoring diff --git a/docker/graphana-prometheus/files/prometheus/etc/prometheus/prometheus.yml b/docker/graphana-prometheus/files/prometheus/etc/prometheus/prometheus.yml new file mode 100644 index 0000000..4ab8c03 --- /dev/null +++ b/docker/graphana-prometheus/files/prometheus/etc/prometheus/prometheus.yml @@ -0,0 +1,8 @@ +scrape_configs: + - job_name: "prometheus" + static_configs: + - targets: ["localhost:9090"] + + - job_name: node_exporter_emperor + static_configs: + - targets: ["node_exporter:9100"]