Files
grafana-terraform/environments/dev/adibrov/terraform.tfvars
Alexandr e95827b11f
All checks were successful
terraform-dev / validate (push) Successful in 6s
terraform-dev / plan (push) Successful in 12s
terraform-dev / apply (push) Has been skipped
feat: add test alert group with low thresholds for notification testing
2026-04-03 11:45:40 +03:00

249 lines
7.1 KiB
HCL

env = "dev"
# Maximum dashboard UID length after auto-generation from json uid + file path
dashboard_uid_max_length = 40
# Controls the ability to manually edit resources in Grafana.
#
# disable_provenance = true:
# - Removes provisioning tags and locks for alerting components.
# - Allows manual changes through the Grafana UI for the following resources:
# - Alert Rules
# - Contact Points
# - Mute Timings
# - Notification Templates
# - Notification Policies
#
# disable_provenance = false:
# - Preserves provisioning tags and locks for the above components.
# - Prevents manual changes in the Grafana UI from conflicting with Terraform-managed alerting resources.
# - This setting ensures that any changes made directly in the Grafana UI will not persist for these resources.
disable_provenance = true
enable_contact_points = true
# Grafana organization settings as an array of objects
organizations = [
{
create_new_organization = false
organization_name = "adibrov"
keep_manual_changes = true
prevent_destroy_on_recreate = true
}
]
# Current organization for deploying
org_id = "3"
# Alert groups configuration
groups = [
{
dashboard_alert_group_name = "System Alerts"
folder_uid = "system"
alert_definitions_path = "alerts/system"
dashboard_path_if_exist = "dashboards/system"
keep_manual_changes = false
prevent_destroy_on_recreate = false
alerts_on_datasources_uid = ["prometheus"]
},
{
dashboard_alert_group_name = "Self monitoring"
folder_uid = "self-monitoring"
alert_definitions_path = "alerts/self-monitoring"
dashboard_path_if_exist = "dashboards/self-monitoring"
keep_manual_changes = false
prevent_destroy_on_recreate = false
alerts_on_datasources_uid = ["prometheus"]
},
{
dashboard_alert_group_name = "Node Alerts"
folder_uid = "node"
alert_definitions_path = "alerts/node"
dashboard_path_if_exist = null
keep_manual_changes = false
prevent_destroy_on_recreate = false
alerts_on_datasources_uid = ["prometheus"]
},
{
dashboard_alert_group_name = "Container Alerts"
folder_uid = "containers"
alert_definitions_path = "alerts/containers"
dashboard_path_if_exist = null
keep_manual_changes = false
prevent_destroy_on_recreate = false
alerts_on_datasources_uid = ["prometheus"]
},
{
dashboard_alert_group_name = "Nginx Alerts"
folder_uid = "nginx"
alert_definitions_path = "alerts/nginx"
dashboard_path_if_exist = null
keep_manual_changes = false
prevent_destroy_on_recreate = false
alerts_on_datasources_uid = ["prometheus"]
},
{
dashboard_alert_group_name = "PostgreSQL Alerts"
folder_uid = "postgres"
alert_definitions_path = "alerts/postgres"
dashboard_path_if_exist = null
keep_manual_changes = false
prevent_destroy_on_recreate = false
alerts_on_datasources_uid = ["prometheus"]
},
{
dashboard_alert_group_name = "Gitea Alerts"
folder_uid = "gitea"
alert_definitions_path = "alerts/gitea"
dashboard_path_if_exist = null
keep_manual_changes = false
prevent_destroy_on_recreate = false
alerts_on_datasources_uid = ["prometheus"]
},
{
dashboard_alert_group_name = "Blackbox Alerts"
folder_uid = "blackbox"
alert_definitions_path = "alerts/blackbox"
dashboard_path_if_exist = null
keep_manual_changes = false
prevent_destroy_on_recreate = false
alerts_on_datasources_uid = ["prometheus"]
},
{
dashboard_alert_group_name = "Test Alerts"
folder_uid = "test-alerts"
alert_definitions_path = "alerts/test"
dashboard_path_if_exist = null
keep_manual_changes = false
prevent_destroy_on_recreate = false
alerts_on_datasources_uid = ["prometheus"]
}
]
# Data sources configuration
datasources = [
{
name = "prometheus"
uid = "prometheus"
type = "prometheus"
url = "http://192.168.0.105:9090"
access_mode = "proxy"
is_default = true
basic_auth = false
json_data = {
timeInterval = "15s"
}
keep_manual_changes = false
prevent_destroy_on_recreate = false
},
{
name = "loki"
uid = "loki"
type = "loki"
url = "http://192.168.0.112:3100"
access_mode = "proxy"
is_default = false
basic_auth = false
json_data = {}
keep_manual_changes = false
prevent_destroy_on_recreate = false
},
{
name = "victoriametrics"
uid = "victoriametrics"
type = "victoriametrics-metrics-datasource"
url = "http://192.168.0.104:8428"
access_mode = "proxy"
is_default = false
basic_auth = false
json_data = {}
keep_manual_changes = false
prevent_destroy_on_recreate = false
}
]
# Notification policies configuration
notification_policies = [
{
contact_point = "infra-alerts-critical"
continue = true
matchers = [
{
label = "severity"
match = "="
value = "disaster"
},
{
label = "team"
match = "="
value = "infra"
}
]
},
{
contact_point = "infra-alerts-critical"
continue = true
matchers = [
{
label = "severity"
match = "="
value = "critical"
},
{
label = "team"
match = "="
value = "infra"
}
]
},
{
contact_point = "infra-alerts-informational"
continue = true
matchers = [
{
label = "severity"
match = "="
value = "warning"
},
{
label = "team"
match = "="
value = "infra"
}
]
},
{
contact_point = "infra-alerts-informational"
continue = true
matchers = [
{
label = "severity"
match = "="
value = "perfomance"
},
{
label = "team"
match = "="
value = "infra"
}
]
},
{
contact_point = "infra-alerts-test"
continue = true
matchers = [
{
label = "status"
match = "="
value = "test"
}
]
}
]
# ── Grafana IRM ──────────────────────────────────────────────────────────────
# Цепочки эскалации описаны в locals.tf, ID пользователей — в Vault
# (app/groups/monitoring/grafana/dev/ext → irm_user_adibrov)
enable_irm = true