Add Prometheus and Alertmanager configurations: implement custom rules, alerting, and Telegram notifications
This commit is contained in:
@@ -11,15 +11,9 @@ variable "retention_time" {
|
||||
}
|
||||
|
||||
variable "rules" {
|
||||
description = "Prometheus alerting rules"
|
||||
type = list(object({
|
||||
alert = string
|
||||
expr = string
|
||||
for = string
|
||||
labels = map(string)
|
||||
annotations = map(string)
|
||||
}))
|
||||
default = []
|
||||
description = "Prometheus alerting rules in YAML format"
|
||||
type = string
|
||||
default = ""
|
||||
}
|
||||
|
||||
variable "config" {
|
||||
@@ -32,3 +26,44 @@ variable "persistent_folder" {
|
||||
description = "The path to the persistent folder"
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "alertmanager_config" {
|
||||
description = "Custom Alertmanager configuration in YAML format"
|
||||
type = string
|
||||
default = ""
|
||||
}
|
||||
|
||||
variable "cluster_name" {
|
||||
description = "The name of the Kubernetes cluster"
|
||||
type = string
|
||||
default = "kubernetes"
|
||||
}
|
||||
|
||||
variable "email_config" {
|
||||
description = "Email configuration for Alertmanager in YAML format"
|
||||
type = object({
|
||||
to = optional(string, "root@localhost")
|
||||
from = optional(string, "root@localhost")
|
||||
smarthost = optional(string, "localhost:25")
|
||||
auth_username = optional(string, "")
|
||||
auth_password = optional(string, "")
|
||||
})
|
||||
default = {
|
||||
to = "root@localhost"
|
||||
from = "root@localhost"
|
||||
smarthost = "localhost:25"
|
||||
auth_username = ""
|
||||
auth_password = ""
|
||||
}
|
||||
}
|
||||
|
||||
variable "telegram_config" {
|
||||
description = "Telegram configuration for Alertmanager in YAML format"
|
||||
type = object({
|
||||
bot_token = string
|
||||
chat_id = string
|
||||
parse_mode = optional(string, "HTML")
|
||||
message = optional(string, "")
|
||||
})
|
||||
default = null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user