update configs to Prometheus v2
This commit is contained in:
parent
b699d0491a
commit
4cb6ecfd88
@ -16,11 +16,10 @@ services:
|
||||
- ./prometheus/:/etc/prometheus/
|
||||
- prometheus_data:/prometheus
|
||||
command:
|
||||
- '-config.file=/etc/prometheus/prometheus.yml'
|
||||
- '-storage.local.path=/prometheus'
|
||||
- '-alertmanager.url=http://alertmanager:9093'
|
||||
- '-web.console.libraries=/usr/share/prometheus/console_libraries'
|
||||
- '-web.console.templates=/usr/share/prometheus/consoles'
|
||||
- '--config.file=/etc/prometheus/prometheus.yml'
|
||||
- '--storage.tsdb.path=/prometheus'
|
||||
- '--web.console.libraries=/usr/share/prometheus/console_libraries'
|
||||
- '--web.console.templates=/usr/share/prometheus/consoles'
|
||||
ports:
|
||||
- 9090:9090
|
||||
links:
|
||||
|
@ -1,9 +0,0 @@
|
||||
ALERT service_down
|
||||
IF up == 0
|
||||
|
||||
ALERT high_load
|
||||
IF node_load1 > 0.5
|
||||
ANNOTATIONS {
|
||||
summary = "Instance {{ $labels.instance }} under high load",
|
||||
description = "{{ $labels.instance }} of job {{ $labels.job }} is under high load.",
|
||||
}
|
22
prometheus/alert.rules.yml
Normal file
22
prometheus/alert.rules.yml
Normal file
@ -0,0 +1,22 @@
|
||||
groups:
|
||||
- name: example
|
||||
rules:
|
||||
|
||||
# Alert for any instance that is unreachable for >5 minutes.
|
||||
- alert: service_down
|
||||
expr: up == 0
|
||||
for: 2m
|
||||
labels:
|
||||
severity: page
|
||||
annotations:
|
||||
summary: "Instance {{ $labels.instance }} down"
|
||||
description: "{{ $labels.instance }} of job {{ $labels.job }} has been down for more than 5 minutes."
|
||||
|
||||
- alert: high_load
|
||||
expr: node_load1 > 0.5
|
||||
for: 2m
|
||||
labels:
|
||||
severity: page
|
||||
annotations:
|
||||
summary: "Instance {{ $labels.instance }} under high load"
|
||||
description: "{{ $labels.instance }} of job {{ $labels.job }} is under high load."
|
@ -11,7 +11,7 @@ global:
|
||||
|
||||
# Load and evaluate rules in this file every 'evaluation_interval' seconds.
|
||||
rule_files:
|
||||
- "alert.rules"
|
||||
- 'alert.rules.yml'
|
||||
# - "first.rules"
|
||||
# - "second.rules"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user