Logomotion: Volet sécurité des applications Web, métrologie / prometheus

This commit is contained in:
2017-12-21 16:55:59 +01:00
committed by Benjamin Bohard
parent 884905c1db
commit c90015ab94
10 changed files with 212 additions and 0 deletions

View File

@ -0,0 +1,18 @@
version: '2'
services:
prometheus:
image: prom/prometheus
volumes:
- ./etc/prometheus:/etc/prometheus
ports:
- 9090:9090
alertmanager:
image: prom/alertmanager
volumes:
- ./etc/alertmanager:/etc/alertmanager
ports:
- 9093:9093
faketools:
image: bornholm/faketools
ports:
- 8080:8080

View File

@ -0,0 +1,14 @@
global:
smtp_smarthost: 'faketools:2525'
smtp_from: 'alertmanager@my.org'
smtp_auth_username: 'alertmanager'
smtp_auth_password: 'password'
smtp_require_tls: false
route:
receiver: dev-team
receivers:
- name: 'dev-team'
email_configs:
- to: 'dev-team@my.org'

View File

@ -0,0 +1,20 @@
# Configuration de l'application sur laquelle
# Prometheus doit récolter des informations
scrape_configs:
- job_name: demoapp
scrape_interval: 10s
metrics_path: /metrics
static_configs:
- targets: [ "172.17.0.1:3000" ]
# Configuration de l'alertmanager
alerting:
alertmanagers:
- static_configs:
- targets: [ "alertmanager:9093" ]
# Définition des règles d'alertes
rule_files:
- "/etc/prometheus/rules.d/*.yml"

View File

@ -0,0 +1,6 @@
groups:
- name: hello-world
rules:
- alert: HelloWorldAlert
expr: demoapp_hello_world > 5
for: 10s