diff --git a/docker-compose.yml b/docker-compose.yml index a9027c0..59deb0d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,4 @@ -version: '3.2' +version: '3.1' volumes: prometheus_data: {} @@ -11,7 +11,7 @@ networks: services: prometheus: - image: prom/prometheus + image: prom/prometheus:v2.0.0 volumes: - ./prometheus/:/etc/prometheus/ - prometheus_data:/prometheus @@ -38,15 +38,9 @@ services: node-exporter: image: prom/node-exporter volumes: - - type: bind - source: /proc - target: /host/proc - - type: bind - source: /sys - target: /host/sys - - type: bind - source: / - target: /rootfs + - /proc:/host/proc + - /sys:/host/sys + - /:/rootfs command: - '--path.procfs=/host/proc' - '--path.sysfs=/host/sys' diff --git a/prometheus/alert.rules b/prometheus/alert.rules index 0cc6836..9b6df9b 100644 --- a/prometheus/alert.rules +++ b/prometheus/alert.rules @@ -10,7 +10,7 @@ groups: severity: page annotations: summary: "Instance {{ $labels.instance }} down" - description: "{{ $labels.instance }} of job {{ $labels.job }} has been down for more than 5 minutes." + description: "{{ $labels.instance }} of job {{ $labels.job }} has been down for more than 2 minutes." - alert: high_load expr: node_load1 > 0.5 @@ -19,4 +19,4 @@ groups: severity: page annotations: summary: "Instance {{ $labels.instance }} under high load" - description: "{{ $labels.instance }} of job {{ $labels.job }} is under high load." + description: "{{ $labels.instance }} of job {{ $labels.job }} is under high load." \ No newline at end of file diff --git a/prometheus/prometheus.yml b/prometheus/prometheus.yml index ffecd9f..58c5293 100644 --- a/prometheus/prometheus.yml +++ b/prometheus/prometheus.yml @@ -15,11 +15,13 @@ rule_files: # - "first.rules" # - "second.rules" +# alert alerting: alertmanagers: - - static_configs: + - scheme: http + static_configs: - targets: - - alertmanager:9093 + - "alertmanager:9093" # A scrape configuration containing exactly one endpoint to scrape: # Here it's Prometheus itself.