Created
June 26, 2024 06:34
-
-
Save zettalyst/ba0d970c1ff9da052718548710b6369b to your computer and use it in GitHub Desktop.
docker-compose: grafana, prometheus, node_exporter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| services: | |
| prometheus: | |
| image: prom/prometheus:v2.52.0 | |
| volumes: | |
| - ./prometheus.yml:/etc/prometheus/prometheus.yml | |
| command: | |
| - '--config.file=/etc/prometheus/prometheus.yml' | |
| ports: | |
| - '9090:9090' | |
| node_exporter: | |
| image: prom/node-exporter:v1.8.0 | |
| 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)($$|/)' | |
| ports: | |
| - '9100:9100' | |
| grafana: | |
| image: grafana/grafana-oss:10.4.2 | |
| environment: | |
| - GF_SECURITY_ADMIN_PASSWORD=admin # Set the admin password | |
| - GF_USERS_ALLOW_SIGN_UP=false | |
| ports: | |
| - '3000:3000' | |
| depends_on: | |
| - prometheus |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| global: | |
| scrape_interval: 15s | |
| scrape_configs: | |
| - job_name: 'prometheus' # prometheus | |
| static_configs: | |
| - targets: ['localhost:9090'] | |
| - job_name: 'node' # node_exporter | |
| static_configs: | |
| - targets: ['node_exporter:9100'] |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$ docker-compose up