diff --git a/docker-compose.yml b/docker-compose.yml index 4e39d7d..748bc65 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,10 +2,10 @@ prometheus: build: "prom/" ports: - "9090:9090" - container_name: prometheus + name: prometheus links: - "exporter:export" - - "cadvisor:cad" + - "cadvisor:cadvisor" exporter: image: "prom/container-exporter" @@ -16,7 +16,7 @@ exporter: - "9104:9104" expose: - "9104" - container_name: exporter + name: exporter sqlite3: image: "prom/promdash" @@ -37,7 +37,7 @@ promdash: - /tmp/prom:/tmp/prom environment: - "DATABASE_URL=sqlite3:/tmp/prom/file.sqlite3" - container_name: promdash + name: "promdash" cadvisor: image: "google/cadvisor" @@ -50,4 +50,4 @@ cadvisor: - "8080:8080" expose: - "8080" - container_name: cadvisor + name: "cadvisor" diff --git a/prom/Dockerfile b/prom/Dockerfile index e55a3a4..549a383 100644 --- a/prom/Dockerfile +++ b/prom/Dockerfile @@ -1,4 +1,4 @@ -FROM prom/prometheus:latest +FROM prom/prometheus:0.16.1 ADD prometheus.yml /etc/prometheus/prometheus.yml diff --git a/prom/prometheus.yml b/prom/prometheus.yml index 92af058..a928480 100644 --- a/prom/prometheus.yml +++ b/prom/prometheus.yml @@ -4,8 +4,9 @@ global: evaluation_interval: 15s # By default, scrape targets every 15 seconds. # scrape_timeout is set to the global default (10s). - # Attach these extra labels to all timeseries collected by this Prometheus instance. - labels: + # Attach these labels to any time series or alerts when communicating with + # external systems (federation, remote storage, Alertmanager). + external_labels: monitor: 'codelab-monitor' # Load and evaluate rules in this file every 'evaluation_interval' seconds. @@ -27,4 +28,4 @@ scrape_configs: # scheme defaults to 'http'. target_groups: - - targets: ['localhost:9090','exporter:9104','cadvisor:8080'] + - targets: ['localhost:9090','cadvisor:8080']