updated to latest version of stack

Signed-off-by: Brian Christner <brian.christner@gmail.com>
This commit is contained in:
Brian Christner 2018-02-01 07:54:56 +01:00
parent 59e4ee9d89
commit 35ff636cdd
No known key found for this signature in database
GPG key ID: ECA21DC2A2758F38
3 changed files with 42 additions and 30 deletions

View file

@ -1,4 +1,4 @@
version: "2" version: "3.1"
volumes: volumes:
prometheus_data: {} prometheus_data: {}
@ -6,22 +6,19 @@ volumes:
networks: networks:
front-tier: front-tier:
driver: bridge
back-tier: back-tier:
driver: bridge
services: services:
prometheus: prometheus:
image: prom/prometheus image: prom/prometheus:v2.0.0
container_name: prometheus
volumes: volumes:
- ./prometheus/:/etc/prometheus/ - ./prometheus/:/etc/prometheus/
- prometheus_data:/prometheus - prometheus_data:/prometheus
command: command:
- '-config.file=/etc/prometheus/prometheus.yml' - '--config.file=/etc/prometheus/prometheus.yml'
- '-storage.local.path=/prometheus' - '--storage.tsdb.path=/prometheus'
expose: - '--web.console.libraries=/usr/share/prometheus/console_libraries'
- 9090 - '--web.console.templates=/usr/share/prometheus/consoles'
ports: ports:
- 9090:9090 - 9090:9090
links: links:

View file

@ -1,13 +1,22 @@
ALERT service_down groups:
IF up == 0 - name: example
ANNOTATIONS { rules:
summary = "Instance {{ $labels.instance }} is down :( ",
description = "{{ $labels.instance }} of job {{ $labels.job }} is not happy.",
}
ALERT high_load # Alert for any instance that is unreachable for >5 minutes.
IF node_load1 > 0.5 - alert: service_down
ANNOTATIONS { expr: up == 0
summary = "Instance {{ $labels.instance }} under high load", for: 2m
description = "{{ $labels.instance }} of job {{ $labels.job }} is under high load.", labels:
} severity: page
annotations:
summary: "Instance {{ $labels.instance }} down"
description: "{{ $labels.instance }} of job {{ $labels.job }} has been down for more than 2 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."

View file

@ -11,21 +11,27 @@ global:
# Load and evaluate rules in this file every 'evaluation_interval' seconds. # Load and evaluate rules in this file every 'evaluation_interval' seconds.
rule_files: rule_files:
- "alert.rules" - 'alert.rules'
# - "first.rules" # - "first.rules"
# - "second.rules" # - "second.rules"
# A scrape configuration containing exactly one endpoint to scrape: # A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself. # Here it's Prometheus itself.
scrape_configs: scrape_configs:
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
- job_name: 'Monitoring_Mayhem' - job_name: 'prometheus'
# Override the global default and scrape targets from this job every 5 seconds. # Override the global default and scrape targets from this job every 5 seconds.
# scrape_interval: 5s scrape_interval: 5s
# metrics_path defaults to '/metrics'
# scheme defaults to 'http'.
static_configs: static_configs:
- targets: ['localhost:9090', 'metrics:9171'] - targets: ['localhost:9090']
- job_name: 'metrics'
# Override the global default and scrape targets from this job every 5 seconds.
scrape_interval: 5s
static_configs:
- targets: ['metrics:9171']