Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Docker Monitoring
- Loading branch information
0 parents
commit cb2a79d
Showing
3 changed files
with
100 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
services: | ||
cadvisor: | ||
image: gcr.io/cadvisor/cadvisor:latest | ||
container_name: cadvisor | ||
#network_mode: "host" | ||
ports: | ||
- "8080:8080" | ||
restart: unless-stopped | ||
command: | ||
- '-housekeeping_interval=10s' | ||
- '-docker_only=true' | ||
volumes: | ||
- "/:/rootfs:ro" | ||
- "/var/run:/var/run:rw" | ||
- "/sys:/sys:ro" | ||
- "/var/lib/docker/:/var/lib/docker:ro" | ||
- "/dev/disk/:/dev/disk" | ||
# privileged: true | ||
devices: | ||
- "/dev/kmsg:/dev/kmsg" | ||
prometheus: | ||
image: prom/prometheus | ||
container_name: prometheus | ||
command: | ||
- '--config.file=/etc/prometheus/prometheus.yml' | ||
ports: | ||
- 9090:9090 | ||
restart: unless-stopped | ||
volumes: | ||
- ./prometheus:/etc/prometheus | ||
- prom_data:/prometheus | ||
extra_hosts: | ||
- "host.docker.internal:host-gateway" #Magic to allow node exporter to see the real network | ||
|
||
grafana: | ||
image: grafana/grafana | ||
container_name: grafana | ||
ports: | ||
- 3000:3000 | ||
restart: unless-stopped | ||
environment: | ||
- GF_SECURITY_ADMIN_USER=admin | ||
- GF_SECURITY_ADMIN_PASSWORD=grafana | ||
volumes: | ||
- ./grafana:/etc/grafana/provisioning/datasources | ||
- grafana_data:/var/lib/grafana | ||
|
||
node_exporter: | ||
image: quay.io/prometheus/node-exporter:latest | ||
container_name: node_exporter | ||
command: | ||
- '--path.rootfs=/host' | ||
network_mode: host | ||
pid: host | ||
restart: unless-stopped | ||
volumes: | ||
- '/:/host:ro,rslave' | ||
|
||
volumes: | ||
prom_data: | ||
grafana_data: |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
apiVersion: 1 | ||
|
||
datasources: | ||
- name: Prometheus | ||
type: prometheus | ||
url: http://prometheus:9090 | ||
isDefault: true | ||
access: proxy | ||
editable: true |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
global: | ||
scrape_interval: 15s | ||
scrape_timeout: 10s | ||
evaluation_interval: 15s | ||
alerting: | ||
alertmanagers: | ||
- static_configs: | ||
- targets: [] | ||
scheme: http | ||
timeout: 10s | ||
api_version: v1 | ||
scrape_configs: | ||
- job_name: prometheus | ||
honor_timestamps: true | ||
scrape_interval: 15s | ||
scrape_timeout: 10s | ||
metrics_path: /metrics | ||
scheme: http | ||
static_configs: | ||
- targets: | ||
- localhost:9090 | ||
|
||
- job_name: cadvisor | ||
static_configs: | ||
- targets: ["cadvisor:8080"] | ||
|
||
- job_name: node | ||
static_configs: | ||
- targets: ['host.docker.internal:9100'] | ||
|