nano docker-compose.yml
--> Prometheus section: replace with alertmanager ip.
nano prometheus.yml
--> Replace target_IP with those of cadvisor/node-exporter.
docker-compose up -d
Prometheus: http://your_ip:9090 Try: node_cpu --> execute
Grafana: http://your_ip:3001 Datasources > New > Prometheus, http://your_ip:9090, Proxy > test connection > OK
Dashboard > import > /dashboards/bity-test.json
Use template vars: (if not included in bity-test dashboard) Option > Templating:
Name: host, query Prometheus
query: up
regex: /instance="([^:"]+)/
all value: .* regex
Nane: container
query: container_fs_limit_bytes{instance=~"$host"}
regex: /name="([^"]*)"/
all value: .* regex
Help: https://www.youtube.com/watch?v=sKNZMtoSHN4
Run manually:
docker run \
--volume=/:/rootfs:ro \
--volume=/var/run:/var/run:rw \
--volume=/sys:/sys:ro \
--volume=/var/lib/docker/:/var/lib/docker:ro \
--publish=3002:8080 \
--detach=true \
--name=cadvisor \
google/cadvisor:latest
docker run -d -p 9093:9093 \
-v $PWD/alertmanager.conf:/alertmanager.conf \
prom/alertmanager \
-config.file=/alertmanager.conf
docker run -d -p 9090:9090 \
-v $PWD/prometheus.yml:/etc/prometheus/prometheus.yml \
-v $PWD/alert.rules:/etc/prometheus/alert.rules \
--name=prometheus \
prom/prometheus \
-config.file=/etc/prometheus/prometheus.yml \
-alertmanager.url=http://192.168.33.10:9093
Open dev.local:9090 container_memory_usage_bytes{instance="YOUR_IP:3002",job="panamax",name="prometheus"}
docker run -p 3306:3306 --name mysql \
-e MYSQL_DATABASE=dash \
-e MYSQL_USER=dbadmin \
-e MYSQL_PASSWORD=pw \
-e MYSQL_ROOT_PASSWORD=pw \
-d mysql
docker run --rm -it --link prometheus_mysql_1:db -e DATABASE_URL=mysql2://dbadmin:pw@db:3306/dash prom/promdash ./bin/rake db:migrate
docker run -d --link mysql:db -p 3000:3000 --name prometheus-dash -e DATABASE_URL=mysql2://dbadmin:pw@db:3306/dash prom/promdash
Add new server source http://YOUR_IP:9090 add expression cpu...