Browse Source

Merge branch 'version-2' into version-2

master
田浩 5 years ago committed by GitHub
parent
commit
79321b1df6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 16
      docker-compose.yml
  2. 4
      prometheus/alert.rules
  3. 6
      prometheus/prometheus.yml

16
docker-compose.yml

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
version: '3.2'
version: '3.1'
volumes:
prometheus_data: {}
@ -11,7 +11,7 @@ networks: @@ -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: @@ -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'

4
prometheus/alert.rules

@ -10,7 +10,7 @@ groups: @@ -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: @@ -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."

6
prometheus/prometheus.yml

@ -15,11 +15,13 @@ rule_files: @@ -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.

Loading…
Cancel
Save