Unverified Commit d7b33582 authored by 田浩's avatar 田浩 Committed by GitHub
Browse files

Merge pull request #69 from llitfkitfk/version-2

Update prometheus to v2.0.0 & remove docker compose file 3.2 Volume LONG SYNTAX
parents b699d049 806d49c0
version: '3.2'
version: '3.1'
volumes:
prometheus_data: {}
......@@ -11,16 +11,15 @@ networks:
services:
prometheus:
image: prom/prometheus
image: prom/prometheus:v2.0.0
volumes:
- ./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:
......@@ -39,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'
......
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.",
}
\ No newline at end of file
groups:
- name: example
rules:
- alert: InstanceDown
expr: up == 0
for: 5m
labels:
severity: page
annotations:
summary: "Instance {{ $labels.instance }} down"
description: "{{ $labels.instance }} of job {{ $labels.job }} has been down for more than 5 minutes."
\ No newline at end of file
......@@ -15,6 +15,14 @@ rule_files:
# - "first.rules"
# - "second.rules"
# alert
alerting:
alertmanagers:
- scheme: http
static_configs:
- targets:
- "alertmanager:9093"
# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment