chore(infra): Finalize local docker stack (Monitoring, Frontends, Fixes)

This commit is contained in:
2025-12-06 21:00:12 +01:00
parent edfa74365f
commit b3927ed97c
9 changed files with 120 additions and 102 deletions
@@ -0,0 +1,26 @@
global:
resolve_timeout: 5m
# FIX: Hier müssen echte Werte stehen, keine Variablen!
# Wenn du noch keinen SMTP hast, trag Dummy-Werte ein, damit der Container startet.
smtp_smarthost: 'smtp.gmail.com:587'
smtp_from: 'alertmanager@meldestelle.at'
smtp_auth_username: 'deine-email@gmail.com'
smtp_auth_password: 'dein-passwort'
smtp_require_tls: true
route:
receiver: 'email-notifications'
# ... (Rest bleibt gleich)
receivers:
- name: 'email-notifications'
email_configs:
- to: 'admin@meldestelle.at'
send_resolved: true
- name: 'slack-critical'
slack_configs:
# FIX: Auch hier die echte Webhook URL eintragen oder den Block entfernen, wenn nicht genutzt
- api_url: 'https://hooks.slack.com/services/example'
channel: '#alerts-critical'
# ...
@@ -1,82 +0,0 @@
global:
resolve_timeout: 5m
# SMTP configuration for email alerts - use environment variables
smtp_smarthost: '${SMTP_SMARTHOST:-smtp.example.com:587}'
smtp_from: '${SMTP_FROM:-alertmanager@meldestelle.at}'
smtp_auth_username: '${SMTP_AUTH_USERNAME:-alertmanager@meldestelle.at}'
smtp_auth_password: '${SMTP_AUTH_PASSWORD}'
smtp_require_tls: true
# The root route on which each incoming alert enters.
route:
# The root route must not have any matchers as it is the entry point for all alerts
# The default receiver is the one that handles alerts that don't match any of the specific routes
receiver: 'email-notifications'
# How long to wait before sending a notification again if it has already been sent successfully
repeat_interval: 4h
# How long to initially wait to send a notification for a group of alerts
group_wait: 30s
# How long to wait before sending a notification about new alerts that are added to a group
group_interval: 5m
# A default grouping of alerts
group_by: ['alertname', 'cluster', 'service']
# Child routes for specific alert categories
routes:
- receiver: 'slack-critical'
matchers:
- severity="critical"
repeat_interval: 1h
- receiver: 'slack-warnings'
matchers:
- severity="warning"
repeat_interval: 12h
# Inhibition rules allow to mute a set of alerts given that another alert is firing
inhibit_rules:
- source_matchers:
- severity="critical"
target_matchers:
- severity="warning"
# Apply inhibition if the alertname is the same
equal: ['alertname', 'cluster', 'service']
# Receivers define notification integrations
receivers:
- name: 'email-notifications'
email_configs:
- to: 'admin@meldestelle.at'
send_resolved: true
- name: 'slack-critical'
slack_configs:
- api_url: '${SLACK_WEBHOOK_URL_CRITICAL}'
channel: '${SLACK_CHANNEL_CRITICAL:-#alerts-critical}'
send_resolved: true
title: '{{ .CommonAnnotations.summary }}'
text: >-
{{ range .Alerts }}
*Alert:* {{ .Annotations.summary }}
*Description:* {{ .Annotations.description }}
*Severity:* {{ .Labels.severity }}
*Instance:* {{ .Labels.instance }}
{{ end }}
- name: 'slack-warnings'
slack_configs:
- api_url: '${SLACK_WEBHOOK_URL_WARNINGS}'
channel: '${SLACK_CHANNEL_WARNINGS:-#alerts-warnings}'
send_resolved: true
title: '{{ .CommonAnnotations.summary }}'
text: >-
{{ range .Alerts }}
*Alert:* {{ .Annotations.summary }}
*Description:* {{ .Annotations.description }}
*Severity:* {{ .Labels.severity }}
*Instance:* {{ .Labels.instance }}
{{ end }}
@@ -11,10 +11,10 @@ global:
alerting:
alertmanagers:
- static_configs:
- targets:
# Da wir Alertmanager noch nicht im Docker Compose haben (kommt noch!),
# lassen wir das vorerst auskommentiert oder fügen den Container hinzu.
- "alertmanager:9093"
- targets:
# Da wir Alertmanager noch nicht im Docker Compose haben (kommt noch!),
# lassen wir das vorerst auskommentiert oder fügen den Container hinzu.
- "alertmanager:9093"
rule_files:
- "/etc/prometheus/rules/alerts.yaml"
@@ -61,3 +61,8 @@ scrape_configs:
- source_labels: [ __meta_consul_address, __meta_consul_service_port ]
separator: ':'
target_label: instance
# Job 4: Postgres Exporter (Statisch, da kein Consul-Client im Image)
- job_name: 'postgres-exporter'
static_configs:
- targets: [ 'postgres-exporter:9187' ]
@@ -267,4 +267,3 @@ Implementieren Sie Überwachung für:
**Letzte Aktualisierung**: 25. Juli 2025
Für weitere Informationen zur Produktionsumgebung siehe [README-PRODUCTION.md](../../Tagebuch/README-PRODUCTION.md).