diff --git a/EMEA_PROD/alerting/cd_coco-health-monitor_prod.tf b/EMEA_PROD/alerting/cd_coco-health-monitor_prod.tf new file mode 100644 index 00000000..07fabb63 --- /dev/null +++ b/EMEA_PROD/alerting/cd_coco-health-monitor_prod.tf @@ -0,0 +1,38 @@ +# DEFINE dynatrace_alerting.CD_CoCo-Health-Monitor_PROD.id = vu9U3hXa3q0AAAABABhidWlsdGluOmFsZXJ0aW5nLnByb2ZpbGUABnRlbmFudAAGdGVuYW50ACQxYzVjYjdkMy1mY2NiLTNiMWMtOTg5Mi1jOGUzNmMzY2VmYWS-71TeFdrerQ +data "dynatrace_management_zone" "CD_CoCo-Health-Monitor_PROD"{ name="CD_CoCo-Health-Monitor" } +resource "dynatrace_alerting" "CD_CoCo-Health-Monitor_PROD" { + name = "CD_CoCo-Health-Monitor PROD" + management_zone = data.dynatrace_management_zone.CD_CoCo-Health-Monitor_PROD.id + rules { + rule { + delay_in_minutes = 0 + include_mode = "INCLUDE_ALL" + severity_level = "AVAILABILITY" + tags = [ "Environment:PROD" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ALL" + severity_level = "CUSTOM_ALERT" + tags = [ "Environment:PROD" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ALL" + severity_level = "ERRORS" + tags = [ "Environment:PROD" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ALL" + severity_level = "PERFORMANCE" + tags = [ "Environment:PROD" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ALL" + severity_level = "RESOURCE_CONTENTION" + tags = [ "Environment:PROD" ] + } + } +} \ No newline at end of file diff --git a/EMEA_PROD/management_zone/cd_coco-health-monitor.tf b/EMEA_PROD/management_zone/cd_coco-health-monitor.tf new file mode 100644 index 00000000..b6c77166 --- /dev/null +++ b/EMEA_PROD/management_zone/cd_coco-health-monitor.tf @@ -0,0 +1,52 @@ +# DEFINE dynatrace_management_zone.CD_CoCo-Health-Monitor.id = -1815087341939706383 +resource "dynatrace_management_zone" "CD_CoCo-Health-Monitor" { + name = "CD_CoCo-Health-Monitor" + entity_selector_based_rule { + enabled = true + selector = "type(SERVICE),databaseName.exists(),toRelationship.calls(type(SERVICE),tag(\"compass-id:coco-hm\"))" + } + entity_selector_based_rule { + enabled = true + selector = "type(PROCESS_GROUP_INSTANCE),tag(\"compass-id:coco-hm\")" + } + entity_selector_based_rule { + enabled = true + selector = "type(HOST),tag(\"compass-id:coco-hm\")" + } + entity_selector_based_rule { + enabled = true + selector = "type(Service),tag(\"compass-id:coco-hm\")" + } + rules { + type = "WEB_APPLICATION" + enabled = true + conditions { + key { + type = "STATIC" + attribute = "WEB_APPLICATION_NAME" + } + string { + case_sensitive = true + # negate = false + operator = "EQUALS" + value = "CoCo Health Monitor - EMEA - E2E" + } + } + } + rules { + type = "WEB_APPLICATION" + enabled = true + conditions { + key { + type = "STATIC" + attribute = "WEB_APPLICATION_NAME" + } + string { + case_sensitive = true + # negate = false + operator = "EQUALS" + value = "CoCo Health Monitor - EMEA - PROD" + } + } + } +}