Skip to content

Instantly share code, notes, and snippets.

@leopard627
Forked from subicura/docker-prom-stack.yml
Last active January 11, 2020 12:14
Show Gist options
  • Save leopard627/7b1671e217b72f802f479aab85fba130 to your computer and use it in GitHub Desktop.
Save leopard627/7b1671e217b72f802f479aab85fba130 to your computer and use it in GitHub Desktop.
docker-prom-stack.yml
version: "3"
networks:
monitoring:
app-backend:
services:
cadvisor:
image: google/cadvisor:${CADVISOR_VERSION:-v0.26.1}
networks:
- app-backend
- monitoring
volumes:
- /var/run/docker.sock:/var/run/docker.sock,readonly
- /:/rootfs
- /var/run:/var/run
- /sys:/sys
- /var/lib/docker/:/var/lib/docker
deploy:
mode: global
resources:
limits:
cpus: '0.10'
memory: 128M
reservations:
cpus: '0.10'
memory: 64M
node-exporter:
image: basi/node-exporter:${NODE_EXPORTER_VERSION:-latest}
networks:
- app-backend
- monitoring
volumes:
- /proc:/host/proc
- /sys:/host/sys
- /:/rootfs
- /etc/hostname:/etc/host_hostname
hostname: "{{.Node.ID}}"
environment:
HOST_HOSTNAME: /etc/host_hostname
command: --path.procfs "/host/proc" --path.sysfs /host/sys --collector.textfile.directory /etc/node-exporter/ --collector.filesystem.ignored-mount-points "^/(sys|proc|dev|host|etc)($$|/)"
deploy:
mode: global
resources:
limits:
cpus: '0.10'
memory: 32M
reservations:
cpus: '0.10'
memory: 16M
docker-exporter:
image: basi/socat:${DOCKER_EXPORTER_VERSION:-v0.1.0}
networks:
- app-backend
- monitoring
deploy:
mode: global
resources:
limits:
cpus: '0.05'
memory: 6M
reservations:
cpus: '0.05'
memory: 4M
alertmanager:
image: basi/alertmanager:${ALERTMANAGER_VERSION:-v0.8.0}
networks:
- monitoring
- app-backend
# - logging
ports:
- "9093:9093"
environment:
SLACK_API: ${SLACK_API:-YOURTOKENGOESHERE}
LOGSTASH_URL: http://logstash:8080/
command: -config.file=/etc/alertmanager/config.yml
deploy:
mode: replicated
replicas: 1
resources:
limits:
cpus: '0.01'
memory: 32M
reservations:
cpus: '0.01'
memory: 16M
prometheus:
image: basi/prometheus-swarm:${PROMETHEUS_SWARM_VERSION:-latest}
ports:
- "9090"
networks:
- app-backend
- monitoring
command: -config.file=/etc/prometheus/prometheus.yml -storage.local.path=/prometheus -web.console.libraries=/etc/prometheus/console_libraries -web.console.templates=/etc/prometheus/consoles -alertmanager.url=http://alertmanager:9093
deploy:
mode: replicated
replicas: 1
resources:
limits:
cpus: '0.50'
memory: 1024M
reservations:
cpus: '0.50'
memory: 128M
grafana:
# image: basi/grafana:${GRAFANA_VERSION:-4.4.3}
image: basi/grafana:${GRAFANA_VERSION:-latest}
ports:
- "3000:3000"
networks:
- monitoring
- app-backend
environment:
GF_SECURITY_ADMIN_PASSWORD: ${GF_PASSWORD:-admin}
PROMETHEUS_ENDPOINT: http://prometheus:9090
ELASTICSEARCH_ENDPOINT: ${ES_ADDRESS:-http://elasticsearch:9200}
ELASTICSEARCH_USER: ${ES_USERNAME}
ELASTICSEARCH_PASSWORD: ${ES_PASSWORD}
deploy:
mode: replicated
replicas: 1
resources:
limits:
cpus: '0.50'
memory: 64M
reservations:
cpus: '0.50'
memory: 32M
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment