From cdb42272ce5545458a81fae143de3739787d0776 Mon Sep 17 00:00:00 2001 From: Patryk Gudalewicz Date: Wed, 1 Mar 2023 18:47:11 +0100 Subject: [PATCH 1/6] "Migrating from Monaco to Terraform for management zone: CD_public-charging-management-composite-service" --- ...arging-management-composite-service_int.tf | 38 ++ ...arging-management-composite-service_int.tf | 330 ++++++++++++++++++ ...rging-management-composite-service_test.tf | 330 ++++++++++++++++++ ...c-charging-management-composite-service.tf | 20 ++ 4 files changed, 718 insertions(+) create mode 100644 CN_PREPROD/alerting/cd_public-charging-management-composite-service_int.tf create mode 100644 CN_PREPROD/dashboard/cd_public-charging-management-composite-service_int.tf create mode 100644 CN_PREPROD/dashboard/cd_public-charging-management-composite-service_test.tf create mode 100644 CN_PREPROD/management_zone/cd_public-charging-management-composite-service.tf diff --git a/CN_PREPROD/alerting/cd_public-charging-management-composite-service_int.tf b/CN_PREPROD/alerting/cd_public-charging-management-composite-service_int.tf new file mode 100644 index 00000000..93ed6f5e --- /dev/null +++ b/CN_PREPROD/alerting/cd_public-charging-management-composite-service_int.tf @@ -0,0 +1,38 @@ +# DEFINE dynatrace_alerting.CD_public-charging-management-composite-service_INT.id = vu9U3hXa3q0AAAABABhidWlsdGluOmFsZXJ0aW5nLnByb2ZpbGUABnRlbmFudAAGdGVuYW50ACRmOWFjNGY3Yy1lY2M3LTM5NjUtYmI1NC0zMjdlMTgwZmFkOWG-71TeFdrerQ +data "dynatrace_management_zone" "CD_public-charging-management-composite-service_INT"{ name="CD_public-charging-management-composite-service" } +resource "dynatrace_alerting" "CD_public-charging-management-composite-service_INT" { + name = "CD_public-charging-management-composite-service INT" + management_zone = data.dynatrace_management_zone.CD_public-charging-management-composite-service_INT.id + rules { + rule { + delay_in_minutes = 0 + include_mode = "INCLUDE_ALL" + severity_level = "AVAILABILITY" + tags = [ "Environment:INT" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ALL" + severity_level = "CUSTOM_ALERT" + tags = [ "Environment:INT" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ALL" + severity_level = "ERRORS" + tags = [ "Environment:INT" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ALL" + severity_level = "PERFORMANCE" + tags = [ "Environment:INT" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ALL" + severity_level = "RESOURCE_CONTENTION" + tags = [ "Environment:INT" ] + } + } +} \ No newline at end of file diff --git a/CN_PREPROD/dashboard/cd_public-charging-management-composite-service_int.tf b/CN_PREPROD/dashboard/cd_public-charging-management-composite-service_int.tf new file mode 100644 index 00000000..5ed536db --- /dev/null +++ b/CN_PREPROD/dashboard/cd_public-charging-management-composite-service_int.tf @@ -0,0 +1,330 @@ +# DEFINE dynatrace_dashboard.CD_public-charging-management-composite-service_INT.id = 37be7edb-0ef4-48b1-a467-afcdbbefbba1 +data "dynatrace_management_zone" "CD_public-charging-management-composite-service_INT"{ name="CD_public-charging-management-composite-service" } +resource "dynatrace_dashboard" "CD_public-charging-management-composite-service_INT" { + dashboard_metadata { + name = "CD_public-charging-management-composite-service INT" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "CD_public-charging-management-composite-service" ] + filter { + timeframe = "-24h to now" + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + bounds { + height = 304 + left = 38 + top = 228 + width = 1064 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_INT.id + } + } + filter_config { + type = "MIXED" + custom_name = "Failure rate (HTTP 4xx/5xx errors)" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#ff0000" + key = "nullbuiltin:service.errors.fivexx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956393463 + } + config { + custom_color = "#fff29a" + key = "nullbuiltin:service.errors.fourxx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956441725 + } + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fourxx.rate" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fivexx.rate" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:INT" ] + } + } + } + } + } + tile { + name = "Problems" + configured = true + tile_type = "OPEN_PROBLEMS" + bounds { + height = 152 + left = 950 + top = 38 + width = 152 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_INT.id + } + } + } + tile { + name = "Overall Health" + configured = true + tile_type = "HEADER" + bounds { + height = 38 + left = 38 + top = 0 + width = 1064 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_INT.id + } + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + bounds { + height = 38 + left = 38 + top = 532 + width = 1064 + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + bounds { + height = 304 + left = 38 + top = 570 + width = 1064 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_INT.id + } + } + filter_config { + type = "MIXED" + custom_name = "Response time, Request Count and Number of Errors" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#008cdb" + key = "nullbuiltin:service.requestCount.total|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275720776 + } + config { + custom_color = "#b4e5f9" + key = "nullbuiltin:service.response.time|AVG|TOTAL|LINE|SERVICE" + last_modified = 1595275686773 + } + config { + custom_color = "#ef651f" + key = "nullbuiltin:service.errors.total.count|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275955999 + } + } + series { + type = "LINE" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.response.time" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.requestCount.total" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.total.count" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:INT" ] + } + } + } + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + bounds { + height = 38 + left = 38 + top = 190 + width = 1064 + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "DATABASES_OVERVIEW" + bounds { + height = 152 + left = 646 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_INT.id + } + } + filter_config { + type = "DATABASE" + custom_name = "Databases" + default_name = "Databases" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "DATABASE" + match { + key = "AUTO_TAGS" + values = [ "Environment:INT" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "SERVICES" + bounds { + height = 152 + left = 342 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_INT.id + } + } + filter_config { + type = "SERVICE" + custom_name = "Services" + default_name = "Services" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:INT" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "HOSTS" + bounds { + height = 152 + left = 38 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_INT.id + } + } + filter_config { + type = "HOST" + custom_name = "Hosts" + default_name = "Hosts" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "HOST" + match { + key = "AUTO_TAGS" + values = [ "Environment:INT" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/CN_PREPROD/dashboard/cd_public-charging-management-composite-service_test.tf b/CN_PREPROD/dashboard/cd_public-charging-management-composite-service_test.tf new file mode 100644 index 00000000..e9c8209c --- /dev/null +++ b/CN_PREPROD/dashboard/cd_public-charging-management-composite-service_test.tf @@ -0,0 +1,330 @@ +# DEFINE dynatrace_dashboard.CD_public-charging-management-composite-service_TEST.id = bc46f2b6-48ef-4e50-a189-2c73f0047f15 +data "dynatrace_management_zone" "CD_public-charging-management-composite-service_TEST"{ name="CD_public-charging-management-composite-service" } +resource "dynatrace_dashboard" "CD_public-charging-management-composite-service_TEST" { + dashboard_metadata { + name = "CD_public-charging-management-composite-service TEST" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "CD_public-charging-management-composite-service" ] + filter { + timeframe = "-24h to now" + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + bounds { + height = 304 + left = 38 + top = 228 + width = 1064 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_TEST.id + } + } + filter_config { + type = "MIXED" + custom_name = "Failure rate (HTTP 4xx/5xx errors)" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#ff0000" + key = "nullbuiltin:service.errors.fivexx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956393463 + } + config { + custom_color = "#fff29a" + key = "nullbuiltin:service.errors.fourxx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956441725 + } + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fourxx.rate" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fivexx.rate" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:TEST" ] + } + } + } + } + } + tile { + name = "Problems" + configured = true + tile_type = "OPEN_PROBLEMS" + bounds { + height = 152 + left = 950 + top = 38 + width = 152 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_TEST.id + } + } + } + tile { + name = "Overall Health" + configured = true + tile_type = "HEADER" + bounds { + height = 38 + left = 38 + top = 0 + width = 1064 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_TEST.id + } + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + bounds { + height = 38 + left = 38 + top = 532 + width = 1064 + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + bounds { + height = 304 + left = 38 + top = 570 + width = 1064 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_TEST.id + } + } + filter_config { + type = "MIXED" + custom_name = "Response time, Request Count and Number of Errors" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#008cdb" + key = "nullbuiltin:service.requestCount.total|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275720776 + } + config { + custom_color = "#b4e5f9" + key = "nullbuiltin:service.response.time|AVG|TOTAL|LINE|SERVICE" + last_modified = 1595275686773 + } + config { + custom_color = "#ef651f" + key = "nullbuiltin:service.errors.total.count|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275955999 + } + } + series { + type = "LINE" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.response.time" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.requestCount.total" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.total.count" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:TEST" ] + } + } + } + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + bounds { + height = 38 + left = 38 + top = 190 + width = 1064 + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "DATABASES_OVERVIEW" + bounds { + height = 152 + left = 646 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_TEST.id + } + } + filter_config { + type = "DATABASE" + custom_name = "Databases" + default_name = "Databases" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "DATABASE" + match { + key = "AUTO_TAGS" + values = [ "Environment:TEST" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "SERVICES" + bounds { + height = 152 + left = 342 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_TEST.id + } + } + filter_config { + type = "SERVICE" + custom_name = "Services" + default_name = "Services" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:TEST" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "HOSTS" + bounds { + height = 152 + left = 38 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_TEST.id + } + } + filter_config { + type = "HOST" + custom_name = "Hosts" + default_name = "Hosts" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "HOST" + match { + key = "AUTO_TAGS" + values = [ "Environment:TEST" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/CN_PREPROD/management_zone/cd_public-charging-management-composite-service.tf b/CN_PREPROD/management_zone/cd_public-charging-management-composite-service.tf new file mode 100644 index 00000000..8dc7222a --- /dev/null +++ b/CN_PREPROD/management_zone/cd_public-charging-management-composite-service.tf @@ -0,0 +1,20 @@ +# DEFINE dynatrace_management_zone.CD_public-charging-management-composite-service.id = -3435996065629633647 +resource "dynatrace_management_zone" "CD_public-charging-management-composite-service" { + name = "CD_public-charging-management-composite-service" + entity_selector_based_rule { + enabled = true + selector = "type(PROCESS_GROUP_INSTANCE),tag(\"compass-id:mobile20-PCMCS\")" + } + entity_selector_based_rule { + enabled = true + selector = "type(HOST),tag(\"compass-id:mobile20-PCMCS\")" + } + entity_selector_based_rule { + enabled = true + selector = "type(Service),tag(\"compass-id:mobile20-PCMCS\")" + } + entity_selector_based_rule { + enabled = true + selector = "type(SERVICE),databaseName.exists(),toRelationship.calls(type(SERVICE),tag(\"compass-id:mobile20-PCMCS\"))" + } +} From 3871fe578a49da0d0c587f998913f33c423e2cf7 Mon Sep 17 00:00:00 2001 From: Patryk Gudalewicz Date: Wed, 1 Mar 2023 18:52:43 +0100 Subject: [PATCH 2/6] "Migrating from Monaco to Terraform for management zone: CD_public-charging-management-composite-service" --- ...rging-management-composite-service_prod.tf | 38 ++ ...arging-management-composite-service_e2e.tf | 330 ++++++++++++++++++ ...rging-management-composite-service_prod.tf | 330 ++++++++++++++++++ ...c-charging-management-composite-service.tf | 20 ++ 4 files changed, 718 insertions(+) create mode 100644 CN_PROD/alerting/cd_public-charging-management-composite-service_prod.tf create mode 100644 CN_PROD/dashboard/cd_public-charging-management-composite-service_e2e.tf create mode 100644 CN_PROD/dashboard/cd_public-charging-management-composite-service_prod.tf create mode 100644 CN_PROD/management_zone/cd_public-charging-management-composite-service.tf diff --git a/CN_PROD/alerting/cd_public-charging-management-composite-service_prod.tf b/CN_PROD/alerting/cd_public-charging-management-composite-service_prod.tf new file mode 100644 index 00000000..cf50283a --- /dev/null +++ b/CN_PROD/alerting/cd_public-charging-management-composite-service_prod.tf @@ -0,0 +1,38 @@ +# DEFINE dynatrace_alerting.CD_public-charging-management-composite-service_PROD.id = vu9U3hXa3q0AAAABABhidWlsdGluOmFsZXJ0aW5nLnByb2ZpbGUABnRlbmFudAAGdGVuYW50ACRmMmFkNTY5My0xZmUyLTM1NGEtYjQ5YS0xNGZmM2IxZjQ4NjK-71TeFdrerQ +data "dynatrace_management_zone" "CD_public-charging-management-composite-service_PROD"{ name="CD_public-charging-management-composite-service" } +resource "dynatrace_alerting" "CD_public-charging-management-composite-service_PROD" { + name = "CD_public-charging-management-composite-service PROD" + management_zone = data.dynatrace_management_zone.CD_public-charging-management-composite-service_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/CN_PROD/dashboard/cd_public-charging-management-composite-service_e2e.tf b/CN_PROD/dashboard/cd_public-charging-management-composite-service_e2e.tf new file mode 100644 index 00000000..f6a6167f --- /dev/null +++ b/CN_PROD/dashboard/cd_public-charging-management-composite-service_e2e.tf @@ -0,0 +1,330 @@ +# DEFINE dynatrace_dashboard.CD_public-charging-management-composite-service_E2E.id = 3fa40f13-f3cc-4ad4-bb68-c988a1f384c7 +data "dynatrace_management_zone" "CD_public-charging-management-composite-service_E2E"{ name="CD_public-charging-management-composite-service" } +resource "dynatrace_dashboard" "CD_public-charging-management-composite-service_E2E" { + dashboard_metadata { + name = "CD_public-charging-management-composite-service E2E" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "CD_public-charging-management-composite-service" ] + filter { + timeframe = "-24h to now" + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + bounds { + height = 304 + left = 38 + top = 228 + width = 1064 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_E2E.id + } + } + filter_config { + type = "MIXED" + custom_name = "Failure rate (HTTP 4xx/5xx errors)" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#ff0000" + key = "nullbuiltin:service.errors.fivexx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956393463 + } + config { + custom_color = "#fff29a" + key = "nullbuiltin:service.errors.fourxx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956441725 + } + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fourxx.rate" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fivexx.rate" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:E2E" ] + } + } + } + } + } + tile { + name = "Problems" + configured = true + tile_type = "OPEN_PROBLEMS" + bounds { + height = 152 + left = 950 + top = 38 + width = 152 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_E2E.id + } + } + } + tile { + name = "Overall Health" + configured = true + tile_type = "HEADER" + bounds { + height = 38 + left = 38 + top = 0 + width = 1064 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_E2E.id + } + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + bounds { + height = 38 + left = 38 + top = 532 + width = 1064 + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + bounds { + height = 304 + left = 38 + top = 570 + width = 1064 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_E2E.id + } + } + filter_config { + type = "MIXED" + custom_name = "Response time, Request Count and Number of Errors" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#008cdb" + key = "nullbuiltin:service.requestCount.total|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275720776 + } + config { + custom_color = "#b4e5f9" + key = "nullbuiltin:service.response.time|AVG|TOTAL|LINE|SERVICE" + last_modified = 1595275686773 + } + config { + custom_color = "#ef651f" + key = "nullbuiltin:service.errors.total.count|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275955999 + } + } + series { + type = "LINE" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.response.time" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.requestCount.total" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.total.count" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:E2E" ] + } + } + } + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + bounds { + height = 38 + left = 38 + top = 190 + width = 1064 + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "DATABASES_OVERVIEW" + bounds { + height = 152 + left = 646 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_E2E.id + } + } + filter_config { + type = "DATABASE" + custom_name = "Databases" + default_name = "Databases" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "DATABASE" + match { + key = "AUTO_TAGS" + values = [ "Environment:E2E" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "SERVICES" + bounds { + height = 152 + left = 342 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_E2E.id + } + } + filter_config { + type = "SERVICE" + custom_name = "Services" + default_name = "Services" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:E2E" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "HOSTS" + bounds { + height = 152 + left = 38 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_E2E.id + } + } + filter_config { + type = "HOST" + custom_name = "Hosts" + default_name = "Hosts" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "HOST" + match { + key = "AUTO_TAGS" + values = [ "Environment:E2E" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/CN_PROD/dashboard/cd_public-charging-management-composite-service_prod.tf b/CN_PROD/dashboard/cd_public-charging-management-composite-service_prod.tf new file mode 100644 index 00000000..c44769ef --- /dev/null +++ b/CN_PROD/dashboard/cd_public-charging-management-composite-service_prod.tf @@ -0,0 +1,330 @@ +# DEFINE dynatrace_dashboard.CD_public-charging-management-composite-service_PROD.id = 1f2c3c14-8828-41f5-8b6b-70813cde1339 +data "dynatrace_management_zone" "CD_public-charging-management-composite-service_PROD"{ name="CD_public-charging-management-composite-service" } +resource "dynatrace_dashboard" "CD_public-charging-management-composite-service_PROD" { + dashboard_metadata { + name = "CD_public-charging-management-composite-service PROD" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "CD_public-charging-management-composite-service" ] + filter { + timeframe = "-24h to now" + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + bounds { + height = 304 + left = 38 + top = 228 + width = 1064 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_PROD.id + } + } + filter_config { + type = "MIXED" + custom_name = "Failure rate (HTTP 4xx/5xx errors)" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#ff0000" + key = "nullbuiltin:service.errors.fivexx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956393463 + } + config { + custom_color = "#fff29a" + key = "nullbuiltin:service.errors.fourxx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956441725 + } + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fourxx.rate" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fivexx.rate" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:PROD" ] + } + } + } + } + } + tile { + name = "Problems" + configured = true + tile_type = "OPEN_PROBLEMS" + bounds { + height = 152 + left = 950 + top = 38 + width = 152 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_PROD.id + } + } + } + tile { + name = "Overall Health" + configured = true + tile_type = "HEADER" + bounds { + height = 38 + left = 38 + top = 0 + width = 1064 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_PROD.id + } + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + bounds { + height = 38 + left = 38 + top = 532 + width = 1064 + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + bounds { + height = 304 + left = 38 + top = 570 + width = 1064 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_PROD.id + } + } + filter_config { + type = "MIXED" + custom_name = "Response time, Request Count and Number of Errors" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#008cdb" + key = "nullbuiltin:service.requestCount.total|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275720776 + } + config { + custom_color = "#b4e5f9" + key = "nullbuiltin:service.response.time|AVG|TOTAL|LINE|SERVICE" + last_modified = 1595275686773 + } + config { + custom_color = "#ef651f" + key = "nullbuiltin:service.errors.total.count|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275955999 + } + } + series { + type = "LINE" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.response.time" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.requestCount.total" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.total.count" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:PROD" ] + } + } + } + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + bounds { + height = 38 + left = 38 + top = 190 + width = 1064 + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "DATABASES_OVERVIEW" + bounds { + height = 152 + left = 646 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_PROD.id + } + } + filter_config { + type = "DATABASE" + custom_name = "Databases" + default_name = "Databases" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "DATABASE" + match { + key = "AUTO_TAGS" + values = [ "Environment:PROD" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "SERVICES" + bounds { + height = 152 + left = 342 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_PROD.id + } + } + filter_config { + type = "SERVICE" + custom_name = "Services" + default_name = "Services" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:PROD" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "HOSTS" + bounds { + height = 152 + left = 38 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_PROD.id + } + } + filter_config { + type = "HOST" + custom_name = "Hosts" + default_name = "Hosts" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "HOST" + match { + key = "AUTO_TAGS" + values = [ "Environment:PROD" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/CN_PROD/management_zone/cd_public-charging-management-composite-service.tf b/CN_PROD/management_zone/cd_public-charging-management-composite-service.tf new file mode 100644 index 00000000..969fab01 --- /dev/null +++ b/CN_PROD/management_zone/cd_public-charging-management-composite-service.tf @@ -0,0 +1,20 @@ +# DEFINE dynatrace_management_zone.CD_public-charging-management-composite-service.id = 902691361032651402 +resource "dynatrace_management_zone" "CD_public-charging-management-composite-service" { + name = "CD_public-charging-management-composite-service" + entity_selector_based_rule { + enabled = true + selector = "type(PROCESS_GROUP_INSTANCE),tag(\"compass-id:mobile20-PCMCS\")" + } + entity_selector_based_rule { + enabled = true + selector = "type(HOST),tag(\"compass-id:mobile20-PCMCS\")" + } + entity_selector_based_rule { + enabled = true + selector = "type(Service),tag(\"compass-id:mobile20-PCMCS\")" + } + entity_selector_based_rule { + enabled = true + selector = "type(SERVICE),databaseName.exists(),toRelationship.calls(type(SERVICE),tag(\"compass-id:mobile20-PCMCS\"))" + } +} From 6d82766311ca0ce695d77fb6c0d0283941dc0f72 Mon Sep 17 00:00:00 2001 From: Patryk Gudalewicz Date: Wed, 1 Mar 2023 18:57:22 +0100 Subject: [PATCH 3/6] "Migrating from Monaco to Terraform for management zone: CD_public-charging-management-composite-service" --- ...arging-management-composite-service_int.tf | 38 ++ ...arging-management-composite-service_int.tf | 357 ++++++++++++++++++ ...rging-management-composite-service_test.tf | 357 ++++++++++++++++++ ...c-charging-management-composite-service.tf | 20 + 4 files changed, 772 insertions(+) create mode 100644 EMEA_PREPROD/alerting/cd_public-charging-management-composite-service_int.tf create mode 100644 EMEA_PREPROD/dashboard/cd_public-charging-management-composite-service_int.tf create mode 100644 EMEA_PREPROD/dashboard/cd_public-charging-management-composite-service_test.tf create mode 100644 EMEA_PREPROD/management_zone/cd_public-charging-management-composite-service.tf diff --git a/EMEA_PREPROD/alerting/cd_public-charging-management-composite-service_int.tf b/EMEA_PREPROD/alerting/cd_public-charging-management-composite-service_int.tf new file mode 100644 index 00000000..a12ace81 --- /dev/null +++ b/EMEA_PREPROD/alerting/cd_public-charging-management-composite-service_int.tf @@ -0,0 +1,38 @@ +# DEFINE dynatrace_alerting.CD_public-charging-management-composite-service_INT.id = vu9U3hXa3q0AAAABABhidWlsdGluOmFsZXJ0aW5nLnByb2ZpbGUABnRlbmFudAAGdGVuYW50ACQ5NTU0ZTM5YS00ZWVkLTM3Y2ItODgyNC0zYWU4MDA4YTZkNzi-71TeFdrerQ +data "dynatrace_management_zone" "CD_public-charging-management-composite-service_INT"{ name="CD_public-charging-management-composite-service" } +resource "dynatrace_alerting" "CD_public-charging-management-composite-service_INT" { + name = "CD_public-charging-management-composite-service INT" + management_zone = data.dynatrace_management_zone.CD_public-charging-management-composite-service_INT.id + rules { + rule { + delay_in_minutes = 0 + include_mode = "INCLUDE_ALL" + severity_level = "AVAILABILITY" + tags = [ "Environment:INT" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ALL" + severity_level = "CUSTOM_ALERT" + tags = [ "Environment:INT" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ALL" + severity_level = "ERRORS" + tags = [ "Environment:INT" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ALL" + severity_level = "PERFORMANCE" + tags = [ "Environment:INT" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ALL" + severity_level = "RESOURCE_CONTENTION" + tags = [ "Environment:INT" ] + } + } +} \ No newline at end of file diff --git a/EMEA_PREPROD/dashboard/cd_public-charging-management-composite-service_int.tf b/EMEA_PREPROD/dashboard/cd_public-charging-management-composite-service_int.tf new file mode 100644 index 00000000..67da0250 --- /dev/null +++ b/EMEA_PREPROD/dashboard/cd_public-charging-management-composite-service_int.tf @@ -0,0 +1,357 @@ +# DEFINE dynatrace_dashboard.CD_public-charging-management-composite-service_INT.id = ca89898d-8987-4abe-af85-944e7a1cacf4 +data "dynatrace_management_zone" "CD_public-charging-management-composite-service_INT"{ name="CD_public-charging-management-composite-service" } +resource "dynatrace_dashboard" "CD_public-charging-management-composite-service_INT" { + dashboard_metadata { + name = "CD_public-charging-management-composite-service INT" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "CD_public-charging-management-composite-service" ] + filter { + timeframe = "-24h to now" + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 304 + left = 38 + top = 228 + width = 1064 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_INT.id + } + } + filter_config { + type = "MIXED" + custom_name = "Failure rate (HTTP 4xx/5xx errors)" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#ff0000" + key = "nullbuiltin:service.errors.fivexx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956393463 + } + config { + custom_color = "#fff29a" + key = "nullbuiltin:service.errors.fourxx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956441725 + } + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fourxx.rate" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fivexx.rate" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:INT" ] + } + } + } + } + } + tile { + name = "Problems" + configured = true + tile_type = "OPEN_PROBLEMS" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 950 + top = 38 + width = 152 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_INT.id + } + } + } + tile { + name = "Overall Health" + configured = true + tile_type = "HEADER" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 0 + width = 1064 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_INT.id + } + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 532 + width = 1064 + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 304 + left = 38 + top = 570 + width = 1064 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_INT.id + } + } + filter_config { + type = "MIXED" + custom_name = "Response time, Request Count and Number of Errors" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#008cdb" + key = "nullbuiltin:service.requestCount.total|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275720776 + } + config { + custom_color = "#b4e5f9" + key = "nullbuiltin:service.response.time|AVG|TOTAL|LINE|SERVICE" + last_modified = 1595275686773 + } + config { + custom_color = "#ef651f" + key = "nullbuiltin:service.errors.total.count|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275955999 + } + } + series { + type = "LINE" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.response.time" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.requestCount.total" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.total.count" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:INT" ] + } + } + } + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 190 + width = 1064 + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "DATABASES_OVERVIEW" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 646 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_INT.id + } + } + filter_config { + type = "DATABASE" + custom_name = "Databases" + default_name = "Databases" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "DATABASE" + match { + key = "AUTO_TAGS" + values = [ "Environment:INT" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "SERVICES" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 342 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_INT.id + } + } + filter_config { + type = "SERVICE" + custom_name = "Services" + default_name = "Services" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:INT" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "HOSTS" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 38 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_INT.id + } + } + filter_config { + type = "HOST" + custom_name = "Hosts" + default_name = "Hosts" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "HOST" + match { + key = "AUTO_TAGS" + values = [ "Environment:INT" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/EMEA_PREPROD/dashboard/cd_public-charging-management-composite-service_test.tf b/EMEA_PREPROD/dashboard/cd_public-charging-management-composite-service_test.tf new file mode 100644 index 00000000..fb08e450 --- /dev/null +++ b/EMEA_PREPROD/dashboard/cd_public-charging-management-composite-service_test.tf @@ -0,0 +1,357 @@ +# DEFINE dynatrace_dashboard.CD_public-charging-management-composite-service_TEST.id = 39183c71-41d5-4cd1-894e-21aa497a16e5 +data "dynatrace_management_zone" "CD_public-charging-management-composite-service_TEST"{ name="CD_public-charging-management-composite-service" } +resource "dynatrace_dashboard" "CD_public-charging-management-composite-service_TEST" { + dashboard_metadata { + name = "CD_public-charging-management-composite-service TEST" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "CD_public-charging-management-composite-service" ] + filter { + timeframe = "-24h to now" + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 304 + left = 38 + top = 228 + width = 1064 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_TEST.id + } + } + filter_config { + type = "MIXED" + custom_name = "Failure rate (HTTP 4xx/5xx errors)" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#ff0000" + key = "nullbuiltin:service.errors.fivexx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956393463 + } + config { + custom_color = "#fff29a" + key = "nullbuiltin:service.errors.fourxx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956441725 + } + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fourxx.rate" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fivexx.rate" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:TEST" ] + } + } + } + } + } + tile { + name = "Problems" + configured = true + tile_type = "OPEN_PROBLEMS" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 950 + top = 38 + width = 152 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_TEST.id + } + } + } + tile { + name = "Overall Health" + configured = true + tile_type = "HEADER" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 0 + width = 1064 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_TEST.id + } + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 532 + width = 1064 + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 304 + left = 38 + top = 570 + width = 1064 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_TEST.id + } + } + filter_config { + type = "MIXED" + custom_name = "Response time, Request Count and Number of Errors" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#008cdb" + key = "nullbuiltin:service.requestCount.total|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275720776 + } + config { + custom_color = "#b4e5f9" + key = "nullbuiltin:service.response.time|AVG|TOTAL|LINE|SERVICE" + last_modified = 1595275686773 + } + config { + custom_color = "#ef651f" + key = "nullbuiltin:service.errors.total.count|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275955999 + } + } + series { + type = "LINE" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.response.time" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.requestCount.total" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.total.count" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:TEST" ] + } + } + } + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 190 + width = 1064 + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "DATABASES_OVERVIEW" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 646 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_TEST.id + } + } + filter_config { + type = "DATABASE" + custom_name = "Databases" + default_name = "Databases" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "DATABASE" + match { + key = "AUTO_TAGS" + values = [ "Environment:TEST" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "SERVICES" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 342 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_TEST.id + } + } + filter_config { + type = "SERVICE" + custom_name = "Services" + default_name = "Services" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:TEST" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "HOSTS" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 38 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_TEST.id + } + } + filter_config { + type = "HOST" + custom_name = "Hosts" + default_name = "Hosts" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "HOST" + match { + key = "AUTO_TAGS" + values = [ "Environment:TEST" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/EMEA_PREPROD/management_zone/cd_public-charging-management-composite-service.tf b/EMEA_PREPROD/management_zone/cd_public-charging-management-composite-service.tf new file mode 100644 index 00000000..da0ae558 --- /dev/null +++ b/EMEA_PREPROD/management_zone/cd_public-charging-management-composite-service.tf @@ -0,0 +1,20 @@ +# DEFINE dynatrace_management_zone.CD_public-charging-management-composite-service.id = 8472830203956524741 +resource "dynatrace_management_zone" "CD_public-charging-management-composite-service" { + name = "CD_public-charging-management-composite-service" + entity_selector_based_rule { + enabled = true + selector = "type(Service),tag(\"compass-id:mobile20-PCMCS\")" + } + entity_selector_based_rule { + enabled = true + selector = "type(SERVICE),databaseName.exists(),toRelationship.calls(type(SERVICE),tag(\"compass-id:mobile20-PCMCS\"))" + } + entity_selector_based_rule { + enabled = true + selector = "type(HOST),tag(\"compass-id:mobile20-PCMCS\")" + } + entity_selector_based_rule { + enabled = true + selector = "type(PROCESS_GROUP_INSTANCE),tag(\"compass-id:mobile20-PCMCS\")" + } +} From 9918695a5b5aea33ebf82dddb3f02b63cce1b599 Mon Sep 17 00:00:00 2001 From: Patryk Gudalewicz Date: Wed, 1 Mar 2023 19:06:14 +0100 Subject: [PATCH 4/6] "Migrating from Monaco to Terraform for management zone: CD_public-charging-management-composite-service" --- ...rging-management-composite-service_prod.tf | 38 ++ ...arging-management-composite-service_e2e.tf | 357 ++++++++++++++++++ ...rging-management-composite-service_prod.tf | 357 ++++++++++++++++++ ...c-charging-management-composite-service.tf | 20 + 4 files changed, 772 insertions(+) create mode 100644 EMEA_PROD/alerting/cd_public-charging-management-composite-service_prod.tf create mode 100644 EMEA_PROD/dashboard/cd_public-charging-management-composite-service_e2e.tf create mode 100644 EMEA_PROD/dashboard/cd_public-charging-management-composite-service_prod.tf create mode 100644 EMEA_PROD/management_zone/cd_public-charging-management-composite-service.tf diff --git a/EMEA_PROD/alerting/cd_public-charging-management-composite-service_prod.tf b/EMEA_PROD/alerting/cd_public-charging-management-composite-service_prod.tf new file mode 100644 index 00000000..98a74edc --- /dev/null +++ b/EMEA_PROD/alerting/cd_public-charging-management-composite-service_prod.tf @@ -0,0 +1,38 @@ +# DEFINE dynatrace_alerting.CD_public-charging-management-composite-service_PROD.id = vu9U3hXa3q0AAAABABhidWlsdGluOmFsZXJ0aW5nLnByb2ZpbGUABnRlbmFudAAGdGVuYW50ACQ3ZDg0MGQzOS03OWRmLTM3ZTUtYmJhMS03MjJlYTMzYjkxZWa-71TeFdrerQ +data "dynatrace_management_zone" "CD_public-charging-management-composite-service_PROD"{ name="CD_public-charging-management-composite-service" } +resource "dynatrace_alerting" "CD_public-charging-management-composite-service_PROD" { + name = "CD_public-charging-management-composite-service PROD" + management_zone = data.dynatrace_management_zone.CD_public-charging-management-composite-service_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/dashboard/cd_public-charging-management-composite-service_e2e.tf b/EMEA_PROD/dashboard/cd_public-charging-management-composite-service_e2e.tf new file mode 100644 index 00000000..4026ed00 --- /dev/null +++ b/EMEA_PROD/dashboard/cd_public-charging-management-composite-service_e2e.tf @@ -0,0 +1,357 @@ +# DEFINE dynatrace_dashboard.CD_public-charging-management-composite-service_E2E.id = b8f9360f-0e67-48cf-abb4-964893e65991 +data "dynatrace_management_zone" "CD_public-charging-management-composite-service_E2E"{ name="CD_public-charging-management-composite-service" } +resource "dynatrace_dashboard" "CD_public-charging-management-composite-service_E2E" { + dashboard_metadata { + name = "CD_public-charging-management-composite-service E2E" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "CD_public-charging-management-composite-service" ] + filter { + timeframe = "-24h to now" + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 304 + left = 38 + top = 228 + width = 1064 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_E2E.id + } + } + filter_config { + type = "MIXED" + custom_name = "Failure rate (HTTP 4xx/5xx errors)" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#ff0000" + key = "nullbuiltin:service.errors.fivexx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956393463 + } + config { + custom_color = "#fff29a" + key = "nullbuiltin:service.errors.fourxx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956441725 + } + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fourxx.rate" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fivexx.rate" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:E2E" ] + } + } + } + } + } + tile { + name = "Problems" + configured = true + tile_type = "OPEN_PROBLEMS" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 950 + top = 38 + width = 152 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_E2E.id + } + } + } + tile { + name = "Overall Health" + configured = true + tile_type = "HEADER" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 0 + width = 1064 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_E2E.id + } + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 532 + width = 1064 + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 304 + left = 38 + top = 570 + width = 1064 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_E2E.id + } + } + filter_config { + type = "MIXED" + custom_name = "Response time, Request Count and Number of Errors" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#008cdb" + key = "nullbuiltin:service.requestCount.total|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275720776 + } + config { + custom_color = "#b4e5f9" + key = "nullbuiltin:service.response.time|AVG|TOTAL|LINE|SERVICE" + last_modified = 1595275686773 + } + config { + custom_color = "#ef651f" + key = "nullbuiltin:service.errors.total.count|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275955999 + } + } + series { + type = "LINE" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.response.time" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.requestCount.total" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.total.count" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:E2E" ] + } + } + } + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 190 + width = 1064 + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "DATABASES_OVERVIEW" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 646 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_E2E.id + } + } + filter_config { + type = "DATABASE" + custom_name = "Databases" + default_name = "Databases" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "DATABASE" + match { + key = "AUTO_TAGS" + values = [ "Environment:E2E" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "SERVICES" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 342 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_E2E.id + } + } + filter_config { + type = "SERVICE" + custom_name = "Services" + default_name = "Services" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:E2E" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "HOSTS" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 38 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_E2E.id + } + } + filter_config { + type = "HOST" + custom_name = "Hosts" + default_name = "Hosts" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "HOST" + match { + key = "AUTO_TAGS" + values = [ "Environment:E2E" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/EMEA_PROD/dashboard/cd_public-charging-management-composite-service_prod.tf b/EMEA_PROD/dashboard/cd_public-charging-management-composite-service_prod.tf new file mode 100644 index 00000000..e4b93061 --- /dev/null +++ b/EMEA_PROD/dashboard/cd_public-charging-management-composite-service_prod.tf @@ -0,0 +1,357 @@ +# DEFINE dynatrace_dashboard.CD_public-charging-management-composite-service_PROD.id = 116dd5af-b9d7-440e-b74a-e43ed146aacd +data "dynatrace_management_zone" "CD_public-charging-management-composite-service_PROD"{ name="CD_public-charging-management-composite-service" } +resource "dynatrace_dashboard" "CD_public-charging-management-composite-service_PROD" { + dashboard_metadata { + name = "CD_public-charging-management-composite-service PROD" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "CD_public-charging-management-composite-service" ] + filter { + timeframe = "-24h to now" + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 304 + left = 38 + top = 228 + width = 1064 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_PROD.id + } + } + filter_config { + type = "MIXED" + custom_name = "Failure rate (HTTP 4xx/5xx errors)" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#ff0000" + key = "nullbuiltin:service.errors.fivexx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956393463 + } + config { + custom_color = "#fff29a" + key = "nullbuiltin:service.errors.fourxx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956441725 + } + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fourxx.rate" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fivexx.rate" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:PROD" ] + } + } + } + } + } + tile { + name = "Problems" + configured = true + tile_type = "OPEN_PROBLEMS" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 950 + top = 38 + width = 152 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_PROD.id + } + } + } + tile { + name = "Overall Health" + configured = true + tile_type = "HEADER" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 0 + width = 1064 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_PROD.id + } + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 532 + width = 1064 + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 304 + left = 38 + top = 570 + width = 1064 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_PROD.id + } + } + filter_config { + type = "MIXED" + custom_name = "Response time, Request Count and Number of Errors" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#008cdb" + key = "nullbuiltin:service.requestCount.total|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275720776 + } + config { + custom_color = "#b4e5f9" + key = "nullbuiltin:service.response.time|AVG|TOTAL|LINE|SERVICE" + last_modified = 1595275686773 + } + config { + custom_color = "#ef651f" + key = "nullbuiltin:service.errors.total.count|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275955999 + } + } + series { + type = "LINE" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.response.time" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.requestCount.total" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.total.count" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:PROD" ] + } + } + } + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 190 + width = 1064 + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "DATABASES_OVERVIEW" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 646 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_PROD.id + } + } + filter_config { + type = "DATABASE" + custom_name = "Databases" + default_name = "Databases" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "DATABASE" + match { + key = "AUTO_TAGS" + values = [ "Environment:PROD" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "SERVICES" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 342 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_PROD.id + } + } + filter_config { + type = "SERVICE" + custom_name = "Services" + default_name = "Services" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:PROD" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "HOSTS" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 38 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_PROD.id + } + } + filter_config { + type = "HOST" + custom_name = "Hosts" + default_name = "Hosts" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "HOST" + match { + key = "AUTO_TAGS" + values = [ "Environment:PROD" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/EMEA_PROD/management_zone/cd_public-charging-management-composite-service.tf b/EMEA_PROD/management_zone/cd_public-charging-management-composite-service.tf new file mode 100644 index 00000000..60f9ad3b --- /dev/null +++ b/EMEA_PROD/management_zone/cd_public-charging-management-composite-service.tf @@ -0,0 +1,20 @@ +# DEFINE dynatrace_management_zone.CD_public-charging-management-composite-service.id = 3228659652106618460 +resource "dynatrace_management_zone" "CD_public-charging-management-composite-service" { + name = "CD_public-charging-management-composite-service" + entity_selector_based_rule { + enabled = true + selector = "type(HOST),tag(\"compass-id:mobile20-PCMCS\")" + } + entity_selector_based_rule { + enabled = true + selector = "type(PROCESS_GROUP_INSTANCE),tag(\"compass-id:mobile20-PCMCS\")" + } + entity_selector_based_rule { + enabled = true + selector = "type(SERVICE),databaseName.exists(),toRelationship.calls(type(SERVICE),tag(\"compass-id:mobile20-PCMCS\"))" + } + entity_selector_based_rule { + enabled = true + selector = "type(Service),tag(\"compass-id:mobile20-PCMCS\")" + } +} From 7fdad110fe36c70879c8abb40145ae00d427f920 Mon Sep 17 00:00:00 2001 From: Patryk Gudalewicz Date: Wed, 1 Mar 2023 19:09:33 +0100 Subject: [PATCH 5/6] "Migrating from Monaco to Terraform for management zone: CD_public-charging-management-composite-service" --- ...arging-management-composite-service_int.tf | 38 ++ ...arging-management-composite-service_int.tf | 357 ++++++++++++++++++ ...rging-management-composite-service_test.tf | 357 ++++++++++++++++++ ...c-charging-management-composite-service.tf | 20 + 4 files changed, 772 insertions(+) create mode 100644 NA_PREPROD/alerting/cd_public-charging-management-composite-service_int.tf create mode 100644 NA_PREPROD/dashboard/cd_public-charging-management-composite-service_int.tf create mode 100644 NA_PREPROD/dashboard/cd_public-charging-management-composite-service_test.tf create mode 100644 NA_PREPROD/management_zone/cd_public-charging-management-composite-service.tf diff --git a/NA_PREPROD/alerting/cd_public-charging-management-composite-service_int.tf b/NA_PREPROD/alerting/cd_public-charging-management-composite-service_int.tf new file mode 100644 index 00000000..583bea10 --- /dev/null +++ b/NA_PREPROD/alerting/cd_public-charging-management-composite-service_int.tf @@ -0,0 +1,38 @@ +# DEFINE dynatrace_alerting.CD_public-charging-management-composite-service_INT.id = vu9U3hXa3q0AAAABABhidWlsdGluOmFsZXJ0aW5nLnByb2ZpbGUABnRlbmFudAAGdGVuYW50ACRiZTkzYTYxYy1iMWM2LTMyYmUtOTRhYy0xYTMzZDY0MmZlMzG-71TeFdrerQ +data "dynatrace_management_zone" "CD_public-charging-management-composite-service_INT"{ name="CD_public-charging-management-composite-service" } +resource "dynatrace_alerting" "CD_public-charging-management-composite-service_INT" { + name = "CD_public-charging-management-composite-service INT" + management_zone = data.dynatrace_management_zone.CD_public-charging-management-composite-service_INT.id + rules { + rule { + delay_in_minutes = 0 + include_mode = "INCLUDE_ALL" + severity_level = "AVAILABILITY" + tags = [ "Environment:INT" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ALL" + severity_level = "CUSTOM_ALERT" + tags = [ "Environment:INT" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ALL" + severity_level = "ERRORS" + tags = [ "Environment:INT" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ALL" + severity_level = "PERFORMANCE" + tags = [ "Environment:INT" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ALL" + severity_level = "RESOURCE_CONTENTION" + tags = [ "Environment:INT" ] + } + } +} \ No newline at end of file diff --git a/NA_PREPROD/dashboard/cd_public-charging-management-composite-service_int.tf b/NA_PREPROD/dashboard/cd_public-charging-management-composite-service_int.tf new file mode 100644 index 00000000..3563ef00 --- /dev/null +++ b/NA_PREPROD/dashboard/cd_public-charging-management-composite-service_int.tf @@ -0,0 +1,357 @@ +# DEFINE dynatrace_dashboard.CD_public-charging-management-composite-service_INT.id = f8da44f5-48a4-4c97-90d6-a31d3efa94e1 +data "dynatrace_management_zone" "CD_public-charging-management-composite-service_INT"{ name="CD_public-charging-management-composite-service" } +resource "dynatrace_dashboard" "CD_public-charging-management-composite-service_INT" { + dashboard_metadata { + name = "CD_public-charging-management-composite-service INT" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "CD_public-charging-management-composite-service" ] + filter { + timeframe = "-24h to now" + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 304 + left = 38 + top = 228 + width = 1064 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_INT.id + } + } + filter_config { + type = "MIXED" + custom_name = "Failure rate (HTTP 4xx/5xx errors)" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#ff0000" + key = "nullbuiltin:service.errors.fivexx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956393463 + } + config { + custom_color = "#fff29a" + key = "nullbuiltin:service.errors.fourxx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956441725 + } + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fourxx.rate" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fivexx.rate" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:INT" ] + } + } + } + } + } + tile { + name = "Problems" + configured = true + tile_type = "OPEN_PROBLEMS" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 950 + top = 38 + width = 152 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_INT.id + } + } + } + tile { + name = "Overall Health" + configured = true + tile_type = "HEADER" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 0 + width = 1064 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_INT.id + } + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 532 + width = 1064 + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 304 + left = 38 + top = 570 + width = 1064 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_INT.id + } + } + filter_config { + type = "MIXED" + custom_name = "Response time, Request Count and Number of Errors" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#008cdb" + key = "nullbuiltin:service.requestCount.total|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275720776 + } + config { + custom_color = "#b4e5f9" + key = "nullbuiltin:service.response.time|AVG|TOTAL|LINE|SERVICE" + last_modified = 1595275686773 + } + config { + custom_color = "#ef651f" + key = "nullbuiltin:service.errors.total.count|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275955999 + } + } + series { + type = "LINE" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.response.time" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.requestCount.total" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.total.count" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:INT" ] + } + } + } + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 190 + width = 1064 + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "DATABASES_OVERVIEW" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 646 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_INT.id + } + } + filter_config { + type = "DATABASE" + custom_name = "Databases" + default_name = "Databases" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "DATABASE" + match { + key = "AUTO_TAGS" + values = [ "Environment:INT" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "SERVICES" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 342 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_INT.id + } + } + filter_config { + type = "SERVICE" + custom_name = "Services" + default_name = "Services" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:INT" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "HOSTS" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 38 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_INT.id + } + } + filter_config { + type = "HOST" + custom_name = "Hosts" + default_name = "Hosts" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "HOST" + match { + key = "AUTO_TAGS" + values = [ "Environment:INT" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/NA_PREPROD/dashboard/cd_public-charging-management-composite-service_test.tf b/NA_PREPROD/dashboard/cd_public-charging-management-composite-service_test.tf new file mode 100644 index 00000000..4471520a --- /dev/null +++ b/NA_PREPROD/dashboard/cd_public-charging-management-composite-service_test.tf @@ -0,0 +1,357 @@ +# DEFINE dynatrace_dashboard.CD_public-charging-management-composite-service_TEST.id = f3273572-08ab-4b66-8d80-e6d92aebf35f +data "dynatrace_management_zone" "CD_public-charging-management-composite-service_TEST"{ name="CD_public-charging-management-composite-service" } +resource "dynatrace_dashboard" "CD_public-charging-management-composite-service_TEST" { + dashboard_metadata { + name = "CD_public-charging-management-composite-service TEST" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "CD_public-charging-management-composite-service" ] + filter { + timeframe = "-24h to now" + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 304 + left = 38 + top = 228 + width = 1064 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_TEST.id + } + } + filter_config { + type = "MIXED" + custom_name = "Failure rate (HTTP 4xx/5xx errors)" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#ff0000" + key = "nullbuiltin:service.errors.fivexx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956393463 + } + config { + custom_color = "#fff29a" + key = "nullbuiltin:service.errors.fourxx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956441725 + } + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fourxx.rate" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fivexx.rate" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:TEST" ] + } + } + } + } + } + tile { + name = "Problems" + configured = true + tile_type = "OPEN_PROBLEMS" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 950 + top = 38 + width = 152 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_TEST.id + } + } + } + tile { + name = "Overall Health" + configured = true + tile_type = "HEADER" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 0 + width = 1064 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_TEST.id + } + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 532 + width = 1064 + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 304 + left = 38 + top = 570 + width = 1064 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_TEST.id + } + } + filter_config { + type = "MIXED" + custom_name = "Response time, Request Count and Number of Errors" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#008cdb" + key = "nullbuiltin:service.requestCount.total|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275720776 + } + config { + custom_color = "#b4e5f9" + key = "nullbuiltin:service.response.time|AVG|TOTAL|LINE|SERVICE" + last_modified = 1595275686773 + } + config { + custom_color = "#ef651f" + key = "nullbuiltin:service.errors.total.count|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275955999 + } + } + series { + type = "LINE" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.response.time" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.requestCount.total" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.total.count" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:TEST" ] + } + } + } + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 190 + width = 1064 + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "DATABASES_OVERVIEW" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 646 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_TEST.id + } + } + filter_config { + type = "DATABASE" + custom_name = "Databases" + default_name = "Databases" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "DATABASE" + match { + key = "AUTO_TAGS" + values = [ "Environment:TEST" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "SERVICES" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 342 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_TEST.id + } + } + filter_config { + type = "SERVICE" + custom_name = "Services" + default_name = "Services" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:TEST" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "HOSTS" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 38 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_TEST.id + } + } + filter_config { + type = "HOST" + custom_name = "Hosts" + default_name = "Hosts" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "HOST" + match { + key = "AUTO_TAGS" + values = [ "Environment:TEST" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/NA_PREPROD/management_zone/cd_public-charging-management-composite-service.tf b/NA_PREPROD/management_zone/cd_public-charging-management-composite-service.tf new file mode 100644 index 00000000..a976832d --- /dev/null +++ b/NA_PREPROD/management_zone/cd_public-charging-management-composite-service.tf @@ -0,0 +1,20 @@ +# DEFINE dynatrace_management_zone.CD_public-charging-management-composite-service.id = 2304972700857772462 +resource "dynatrace_management_zone" "CD_public-charging-management-composite-service" { + name = "CD_public-charging-management-composite-service" + entity_selector_based_rule { + enabled = true + selector = "type(HOST),tag(\"compass-id:mobile20-PCMCS\")" + } + entity_selector_based_rule { + enabled = true + selector = "type(Service),tag(\"compass-id:mobile20-PCMCS\")" + } + entity_selector_based_rule { + enabled = true + selector = "type(SERVICE),databaseName.exists(),toRelationship.calls(type(SERVICE),tag(\"compass-id:mobile20-PCMCS\"))" + } + entity_selector_based_rule { + enabled = true + selector = "type(PROCESS_GROUP_INSTANCE),tag(\"compass-id:mobile20-PCMCS\")" + } +} From 966de4f8b1539ed03de1042e5e8a66bf2c669f0f Mon Sep 17 00:00:00 2001 From: Patryk Gudalewicz Date: Wed, 1 Mar 2023 19:12:40 +0100 Subject: [PATCH 6/6] "Migrating from Monaco to Terraform for management zone: CD_public-charging-management-composite-service" --- ...rging-management-composite-service_prod.tf | 38 ++ ...arging-management-composite-service_e2e.tf | 357 ++++++++++++++++++ ...rging-management-composite-service_prod.tf | 357 ++++++++++++++++++ ...c-charging-management-composite-service.tf | 20 + 4 files changed, 772 insertions(+) create mode 100644 NA_PROD/alerting/cd_public-charging-management-composite-service_prod.tf create mode 100644 NA_PROD/dashboard/cd_public-charging-management-composite-service_e2e.tf create mode 100644 NA_PROD/dashboard/cd_public-charging-management-composite-service_prod.tf create mode 100644 NA_PROD/management_zone/cd_public-charging-management-composite-service.tf diff --git a/NA_PROD/alerting/cd_public-charging-management-composite-service_prod.tf b/NA_PROD/alerting/cd_public-charging-management-composite-service_prod.tf new file mode 100644 index 00000000..9c39763b --- /dev/null +++ b/NA_PROD/alerting/cd_public-charging-management-composite-service_prod.tf @@ -0,0 +1,38 @@ +# DEFINE dynatrace_alerting.CD_public-charging-management-composite-service_PROD.id = vu9U3hXa3q0AAAABABhidWlsdGluOmFsZXJ0aW5nLnByb2ZpbGUABnRlbmFudAAGdGVuYW50ACQ3MDAxODZjMi1jNGYyLTM1OTgtOWU4My02NTc3M2QyYjZmMDe-71TeFdrerQ +data "dynatrace_management_zone" "CD_public-charging-management-composite-service_PROD"{ name="CD_public-charging-management-composite-service" } +resource "dynatrace_alerting" "CD_public-charging-management-composite-service_PROD" { + name = "CD_public-charging-management-composite-service PROD" + management_zone = data.dynatrace_management_zone.CD_public-charging-management-composite-service_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/NA_PROD/dashboard/cd_public-charging-management-composite-service_e2e.tf b/NA_PROD/dashboard/cd_public-charging-management-composite-service_e2e.tf new file mode 100644 index 00000000..f7a7b110 --- /dev/null +++ b/NA_PROD/dashboard/cd_public-charging-management-composite-service_e2e.tf @@ -0,0 +1,357 @@ +# DEFINE dynatrace_dashboard.CD_public-charging-management-composite-service_E2E.id = 619d7cf5-b190-4cab-b355-2e0ba8453dca +data "dynatrace_management_zone" "CD_public-charging-management-composite-service_E2E"{ name="CD_public-charging-management-composite-service" } +resource "dynatrace_dashboard" "CD_public-charging-management-composite-service_E2E" { + dashboard_metadata { + name = "CD_public-charging-management-composite-service E2E" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "CD_public-charging-management-composite-service" ] + filter { + timeframe = "-24h to now" + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 304 + left = 38 + top = 228 + width = 1064 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_E2E.id + } + } + filter_config { + type = "MIXED" + custom_name = "Failure rate (HTTP 4xx/5xx errors)" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#ff0000" + key = "nullbuiltin:service.errors.fivexx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956393463 + } + config { + custom_color = "#fff29a" + key = "nullbuiltin:service.errors.fourxx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956441725 + } + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fourxx.rate" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fivexx.rate" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:E2E" ] + } + } + } + } + } + tile { + name = "Problems" + configured = true + tile_type = "OPEN_PROBLEMS" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 950 + top = 38 + width = 152 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_E2E.id + } + } + } + tile { + name = "Overall Health" + configured = true + tile_type = "HEADER" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 0 + width = 1064 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_E2E.id + } + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 532 + width = 1064 + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 304 + left = 38 + top = 570 + width = 1064 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_E2E.id + } + } + filter_config { + type = "MIXED" + custom_name = "Response time, Request Count and Number of Errors" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#008cdb" + key = "nullbuiltin:service.requestCount.total|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275720776 + } + config { + custom_color = "#b4e5f9" + key = "nullbuiltin:service.response.time|AVG|TOTAL|LINE|SERVICE" + last_modified = 1595275686773 + } + config { + custom_color = "#ef651f" + key = "nullbuiltin:service.errors.total.count|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275955999 + } + } + series { + type = "LINE" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.response.time" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.requestCount.total" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.total.count" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:E2E" ] + } + } + } + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 190 + width = 1064 + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "DATABASES_OVERVIEW" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 646 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_E2E.id + } + } + filter_config { + type = "DATABASE" + custom_name = "Databases" + default_name = "Databases" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "DATABASE" + match { + key = "AUTO_TAGS" + values = [ "Environment:E2E" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "SERVICES" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 342 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_E2E.id + } + } + filter_config { + type = "SERVICE" + custom_name = "Services" + default_name = "Services" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:E2E" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "HOSTS" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 38 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_E2E.id + } + } + filter_config { + type = "HOST" + custom_name = "Hosts" + default_name = "Hosts" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "HOST" + match { + key = "AUTO_TAGS" + values = [ "Environment:E2E" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/NA_PROD/dashboard/cd_public-charging-management-composite-service_prod.tf b/NA_PROD/dashboard/cd_public-charging-management-composite-service_prod.tf new file mode 100644 index 00000000..c3c040da --- /dev/null +++ b/NA_PROD/dashboard/cd_public-charging-management-composite-service_prod.tf @@ -0,0 +1,357 @@ +# DEFINE dynatrace_dashboard.CD_public-charging-management-composite-service_PROD.id = 3b448a1f-d5fa-4d39-9770-546afa0ae112 +data "dynatrace_management_zone" "CD_public-charging-management-composite-service_PROD"{ name="CD_public-charging-management-composite-service" } +resource "dynatrace_dashboard" "CD_public-charging-management-composite-service_PROD" { + dashboard_metadata { + name = "CD_public-charging-management-composite-service PROD" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "CD_public-charging-management-composite-service" ] + filter { + timeframe = "-24h to now" + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 304 + left = 38 + top = 228 + width = 1064 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_PROD.id + } + } + filter_config { + type = "MIXED" + custom_name = "Failure rate (HTTP 4xx/5xx errors)" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#ff0000" + key = "nullbuiltin:service.errors.fivexx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956393463 + } + config { + custom_color = "#fff29a" + key = "nullbuiltin:service.errors.fourxx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956441725 + } + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fourxx.rate" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fivexx.rate" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:PROD" ] + } + } + } + } + } + tile { + name = "Problems" + configured = true + tile_type = "OPEN_PROBLEMS" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 950 + top = 38 + width = 152 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_PROD.id + } + } + } + tile { + name = "Overall Health" + configured = true + tile_type = "HEADER" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 0 + width = 1064 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_PROD.id + } + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 532 + width = 1064 + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 304 + left = 38 + top = 570 + width = 1064 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_PROD.id + } + } + filter_config { + type = "MIXED" + custom_name = "Response time, Request Count and Number of Errors" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#008cdb" + key = "nullbuiltin:service.requestCount.total|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275720776 + } + config { + custom_color = "#b4e5f9" + key = "nullbuiltin:service.response.time|AVG|TOTAL|LINE|SERVICE" + last_modified = 1595275686773 + } + config { + custom_color = "#ef651f" + key = "nullbuiltin:service.errors.total.count|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275955999 + } + } + series { + type = "LINE" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.response.time" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.requestCount.total" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.total.count" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:PROD" ] + } + } + } + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 190 + width = 1064 + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "DATABASES_OVERVIEW" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 646 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_PROD.id + } + } + filter_config { + type = "DATABASE" + custom_name = "Databases" + default_name = "Databases" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "DATABASE" + match { + key = "AUTO_TAGS" + values = [ "Environment:PROD" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "SERVICES" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 342 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_PROD.id + } + } + filter_config { + type = "SERVICE" + custom_name = "Services" + default_name = "Services" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:PROD" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "HOSTS" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 38 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_public-charging-management-composite-service" + id = data.dynatrace_management_zone.CD_public-charging-management-composite-service_PROD.id + } + } + filter_config { + type = "HOST" + custom_name = "Hosts" + default_name = "Hosts" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "HOST" + match { + key = "AUTO_TAGS" + values = [ "Environment:PROD" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/NA_PROD/management_zone/cd_public-charging-management-composite-service.tf b/NA_PROD/management_zone/cd_public-charging-management-composite-service.tf new file mode 100644 index 00000000..427f878b --- /dev/null +++ b/NA_PROD/management_zone/cd_public-charging-management-composite-service.tf @@ -0,0 +1,20 @@ +# DEFINE dynatrace_management_zone.CD_public-charging-management-composite-service.id = 3285959175716657890 +resource "dynatrace_management_zone" "CD_public-charging-management-composite-service" { + name = "CD_public-charging-management-composite-service" + entity_selector_based_rule { + enabled = true + selector = "type(HOST),tag(\"compass-id:mobile20-PCMCS\")" + } + entity_selector_based_rule { + enabled = true + selector = "type(PROCESS_GROUP_INSTANCE),tag(\"compass-id:mobile20-PCMCS\")" + } + entity_selector_based_rule { + enabled = true + selector = "type(SERVICE),databaseName.exists(),toRelationship.calls(type(SERVICE),tag(\"compass-id:mobile20-PCMCS\"))" + } + entity_selector_based_rule { + enabled = true + selector = "type(Service),tag(\"compass-id:mobile20-PCMCS\")" + } +}