# AlertManager configuration
# Aut-O — T-12 Monitoring Stack
#
# Replace placeholder values with your actual notification endpoints.

global:
  resolve_timeout: 5m
  # Uncomment and configure for email notifications:
  # smtp_smarthost: "smtp.example.com:587"
  # smtp_from: "alertmanager@example.com"
  # smtp_auth_username: "alertmanager@example.com"
  # smtp_auth_password: "your-password"
  # smtp_require_tls: true

route:
  receiver: "log-only"
  group_by: ["alertname", "severity"]
  group_wait: 10s
  group_interval: 10m
  repeat_interval: 1h

  routes:
    # Critical alerts — configure slack/email when ready
    - receiver: "log-only"
      match:
        severity: critical
      group_wait: 5s
      repeat_interval: 30m
      continue: false

receivers:
  # Default: log alerts to stdout (visible via docker logs alertmanager)
  - name: "log-only"
    webhook_configs:
      - url: "http://localhost:9093/-/healthy"
        send_resolved: true

  # Uncomment when SMTP is configured:
  # - name: "default-email"
  #   email_configs:
  #     - to: "alerts@example.com"
  #       send_resolved: true

  # Uncomment when Slack webhook is configured:
  # - name: "critical-slack"
  #   slack_configs:
  #     - api_url: "https://hooks.slack.com/services/REPLACE/WITH/WEBHOOK"
  #       channel: "#alerts-critical"
  #       send_resolved: true
  #       title: '{{ .GroupLabels.alertname }}'
  #       text: >-
  #         {{ range .Alerts }}
  #         *Alert:* {{ .Annotations.summary }}
  #         *Description:* {{ .Annotations.description }}
  #         *Severity:* {{ .Labels.severity }}
  #         {{ end }}

inhibit_rules:
  # Critical alerts inhibit warnings for the same alert name and instance
  - source_match:
      severity: "critical"
    target_match:
      severity: "warning"
    equal: ["alertname", "instance"]
