/appdata/prometheus
├── config
│ └── prometheus.yml
└── data
prometheus.yml
# my global configglobal:scrape_interval:15s# Set the scrape interval to every 15 seconds. Default is every 1 minute.evaluation_interval:15s# Evaluate rules every 15 seconds. The default is every 1 minute.# scrape_timeout is set to the global default (10s).# Alertmanager configurationalerting:alertmanagers:- scheme:httpstatic_configs:- targets:- "alertmanager:9093"# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.#rule_files:# - "first_rules.yml"# - "second_rules.yml"# A scrape configuration containing exactly one endpoint to scrape:# Here it's Prometheus itself.scrape_configs:# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.- job_name:'prometheus'# Override the global default and scrape targets from this job every 5 seconds.scrape_interval:5sstatic_configs:- targets:['localhost:9090']- job_name:'cadvisor'scrape_interval:5sstatic_configs:- targets:['cadvisor:8080']- job_name:'node-exporter'scrape_interval:5sstatic_configs:- targets:['node-exporter:9100']
services:cadvisor:container_name:cadvisorimage:gcr.io/cadvisor/cadvisor:latesthostname:cadvisorrestart:unless-stoppedprivileged:truenetworks:- grafanaexpose:- 8080command:- '-housekeeping_interval=15s'- '-docker_only=true'- '-store_container_labels=false'devices:- /dev/kmsgvolumes:- /:/rootfs:ro- /var/run:/var/run:rw- /sys:/sys:ro- /var/lib/docker/:/var/lib/docker:ro- /dev/disk/:/dev/disk:ro- /etc/machine-id:/etc/machine-id:ronode-exporter:container_name:node-exporterimage:prom/node-exporter:latesthostname:node-exporterrestart:unless-stoppednetworks:- grafanaexpose:- 9100command:- --path.procfs=/host/proc- --path.sysfs=/host/sys- --path.rootfs=/host- --collector.filesystem.mount-points-exclude- ^/(sys|proc|dev|host|etc|rootfs/var/lib/docker/containers|rootfs/var/lib/docker/overlay2|rootfs/run/docker/netns|rootfs/var/lib/docker/aufs)($$|/)volumes:- /proc:/host/proc:ro- /sys:/host/sys:ro- /:/rootfs:ro- /:/host:ro,rslaveprometheus:container_name:prometheusimage:prom/prometheus:latesthostname:prometheusrestart:unless-stoppedcommand:- '--config.file=/etc/prometheus/prometheus.yml'- '--storage.tsdb.path=/prometheus'- '--storage.tsdb.retention.time=1y'# /!\ Uncomment the following line to set a size limit for the Prometheus database /!\# - '--storage.tsdb.retention.size=10GB'networks:- grafanaexpose:- 9090volumes:# /!\ To be modified depending on your needs /!\- /home/rxchi1d/appdata/prometheus/data:/prometheus- /home/rxchi1d/appdata/prometheus/config/prometheus.yml:/etc/prometheus/prometheus.ymldepends_on:- cadvisor- node-exporternetworks:grafana:external:true