Add Prometheus and Alertmanager configurations: implement custom rules, alerting, and Telegram notifications

This commit is contained in:
2025-10-04 18:05:10 +02:00
parent 7cad175406
commit 0d3fb56f78
23 changed files with 416 additions and 235 deletions
+15
View File
@@ -192,6 +192,21 @@ locals {
}
}
# prometheus
prometheus_config = file("${path.module}/resources/prometheus.yml")
prometheus_rules = file("${path.module}/resources/prometheus-rules.yml")
alertmanager_config = file("${path.module}/resources/alertmanager.yml")
alertmanager_email_config = {
to = "c.alexandre.pires@alexpires.me"
from = "alertmanager@${local.primary_domain}"
smarthost = "smtp.tem.scw.cloud:587"
auth_username = var.scaleway_project_id
auth_password = local.mail_app_api_secret_key
}
telegram_chat_id = "5432313610" # a13labs channel
telegram_message = file("${path.module}/resources/telegram.tpl")
# get secrets from remote state
backup_bucket_name = data.terraform_remote_state.scaleway.outputs.backup_bucket_name
backup_app_api_secret_key = data.terraform_remote_state.scaleway.outputs.backup_app_api_secret_key