From ac32d75215d94e8478df02280b3f0a14512e6584 Mon Sep 17 00:00:00 2001 From: Patryk Gudalewicz Date: Wed, 1 Mar 2023 18:48:12 +0100 Subject: [PATCH 1/6] "Migrating from Monaco to Terraform for management zone: CD_VDLM_tsbgservice" --- .../alerting/cd_vdlm_tsbgservice_int.tf | 38 ++ .../dashboard/cd_vdlm_tsbgservice_int.tf | 330 ++++++++++++++++++ .../dashboard/cd_vdlm_tsbgservice_test.tf | 330 ++++++++++++++++++ .../management_zone/cd_vdlm_tsbgservice.tf | 20 ++ 4 files changed, 718 insertions(+) create mode 100644 CN_PREPROD/alerting/cd_vdlm_tsbgservice_int.tf create mode 100644 CN_PREPROD/dashboard/cd_vdlm_tsbgservice_int.tf create mode 100644 CN_PREPROD/dashboard/cd_vdlm_tsbgservice_test.tf create mode 100644 CN_PREPROD/management_zone/cd_vdlm_tsbgservice.tf diff --git a/CN_PREPROD/alerting/cd_vdlm_tsbgservice_int.tf b/CN_PREPROD/alerting/cd_vdlm_tsbgservice_int.tf new file mode 100644 index 00000000..1cbd42ed --- /dev/null +++ b/CN_PREPROD/alerting/cd_vdlm_tsbgservice_int.tf @@ -0,0 +1,38 @@ +# DEFINE dynatrace_alerting.CD_VDLM_tsbgservice_INT.id = vu9U3hXa3q0AAAABABhidWlsdGluOmFsZXJ0aW5nLnByb2ZpbGUABnRlbmFudAAGdGVuYW50ACQyNWY5MDllYi0zNWEzLTM5NjEtOWIyNS0xNDg3YWYzYWY4MDS-71TeFdrerQ +data "dynatrace_management_zone" "CD_VDLM_tsbgservice_INT"{ name="CD_VDLM_tsbgservice" } +resource "dynatrace_alerting" "CD_VDLM_tsbgservice_INT" { + name = "CD_VDLM_tsbgservice INT" + management_zone = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_vdlm_tsbgservice_int.tf b/CN_PREPROD/dashboard/cd_vdlm_tsbgservice_int.tf new file mode 100644 index 00000000..55a0dd92 --- /dev/null +++ b/CN_PREPROD/dashboard/cd_vdlm_tsbgservice_int.tf @@ -0,0 +1,330 @@ +# DEFINE dynatrace_dashboard.CD_VDLM_tsbgservice_INT.id = 6688e8c5-91c9-4445-85f7-c69dfd8544bb +data "dynatrace_management_zone" "CD_VDLM_tsbgservice_INT"{ name="CD_VDLM_tsbgservice" } +resource "dynatrace_dashboard" "CD_VDLM_tsbgservice_INT" { + dashboard_metadata { + name = "CD_VDLM_tsbgservice INT" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "CD_VDLM_tsbgservice" ] + 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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_vdlm_tsbgservice_test.tf b/CN_PREPROD/dashboard/cd_vdlm_tsbgservice_test.tf new file mode 100644 index 00000000..5fe68ffc --- /dev/null +++ b/CN_PREPROD/dashboard/cd_vdlm_tsbgservice_test.tf @@ -0,0 +1,330 @@ +# DEFINE dynatrace_dashboard.CD_VDLM_tsbgservice_TEST.id = 20c18150-5b97-4d25-87a1-deaf1fc9f7ad +data "dynatrace_management_zone" "CD_VDLM_tsbgservice_TEST"{ name="CD_VDLM_tsbgservice" } +resource "dynatrace_dashboard" "CD_VDLM_tsbgservice_TEST" { + dashboard_metadata { + name = "CD_VDLM_tsbgservice TEST" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "CD_VDLM_tsbgservice" ] + 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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_vdlm_tsbgservice.tf b/CN_PREPROD/management_zone/cd_vdlm_tsbgservice.tf new file mode 100644 index 00000000..54160474 --- /dev/null +++ b/CN_PREPROD/management_zone/cd_vdlm_tsbgservice.tf @@ -0,0 +1,20 @@ +# DEFINE dynatrace_management_zone.CD_VDLM_tsbgservice.id = 8599309439620060820 +resource "dynatrace_management_zone" "CD_VDLM_tsbgservice" { + name = "CD_VDLM_tsbgservice" + entity_selector_based_rule { + enabled = true + selector = "type(SERVICE),databaseName.exists(),toRelationship.calls(type(SERVICE),tag(\"compass-id:tsbgservice\"))" + } + entity_selector_based_rule { + enabled = true + selector = "type(Service),tag(\"compass-id:tsbgservice\")" + } + entity_selector_based_rule { + enabled = true + selector = "type(PROCESS_GROUP_INSTANCE),tag(\"compass-id:tsbgservice\")" + } + entity_selector_based_rule { + enabled = true + selector = "type(HOST),tag(\"compass-id:tsbgservice\")" + } +} From f378ccfefa8ecdaf763ce5e277025ba4cca0ab8c Mon Sep 17 00:00:00 2001 From: Patryk Gudalewicz Date: Wed, 1 Mar 2023 18:53:44 +0100 Subject: [PATCH 2/6] "Migrating from Monaco to Terraform for management zone: CD_VDLM_tsbgservice" --- CN_PROD/alerting/cd_vdlm_tsbgservice_prod.tf | 38 ++ CN_PROD/dashboard/cd_vdlm_tsbgservice_e2e.tf | 330 ++++++++++++++++++ CN_PROD/dashboard/cd_vdlm_tsbgservice_prod.tf | 330 ++++++++++++++++++ .../management_zone/cd_vdlm_tsbgservice.tf | 20 ++ 4 files changed, 718 insertions(+) create mode 100644 CN_PROD/alerting/cd_vdlm_tsbgservice_prod.tf create mode 100644 CN_PROD/dashboard/cd_vdlm_tsbgservice_e2e.tf create mode 100644 CN_PROD/dashboard/cd_vdlm_tsbgservice_prod.tf create mode 100644 CN_PROD/management_zone/cd_vdlm_tsbgservice.tf diff --git a/CN_PROD/alerting/cd_vdlm_tsbgservice_prod.tf b/CN_PROD/alerting/cd_vdlm_tsbgservice_prod.tf new file mode 100644 index 00000000..74144c28 --- /dev/null +++ b/CN_PROD/alerting/cd_vdlm_tsbgservice_prod.tf @@ -0,0 +1,38 @@ +# DEFINE dynatrace_alerting.CD_VDLM_tsbgservice_PROD.id = vu9U3hXa3q0AAAABABhidWlsdGluOmFsZXJ0aW5nLnByb2ZpbGUABnRlbmFudAAGdGVuYW50ACRiZWI2ZjI0Yi0xMDdiLTM1NWEtOGE5NS0wNTI4NTFjYTE0NDi-71TeFdrerQ +data "dynatrace_management_zone" "CD_VDLM_tsbgservice_PROD"{ name="CD_VDLM_tsbgservice" } +resource "dynatrace_alerting" "CD_VDLM_tsbgservice_PROD" { + name = "CD_VDLM_tsbgservice PROD" + management_zone = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_vdlm_tsbgservice_e2e.tf b/CN_PROD/dashboard/cd_vdlm_tsbgservice_e2e.tf new file mode 100644 index 00000000..70d94e2d --- /dev/null +++ b/CN_PROD/dashboard/cd_vdlm_tsbgservice_e2e.tf @@ -0,0 +1,330 @@ +# DEFINE dynatrace_dashboard.CD_VDLM_tsbgservice_E2E.id = b43f6d58-ebb9-456b-a53d-4182e8bf9e88 +data "dynatrace_management_zone" "CD_VDLM_tsbgservice_E2E"{ name="CD_VDLM_tsbgservice" } +resource "dynatrace_dashboard" "CD_VDLM_tsbgservice_E2E" { + dashboard_metadata { + name = "CD_VDLM_tsbgservice E2E" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "CD_VDLM_tsbgservice" ] + 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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_vdlm_tsbgservice_prod.tf b/CN_PROD/dashboard/cd_vdlm_tsbgservice_prod.tf new file mode 100644 index 00000000..48cdb7bb --- /dev/null +++ b/CN_PROD/dashboard/cd_vdlm_tsbgservice_prod.tf @@ -0,0 +1,330 @@ +# DEFINE dynatrace_dashboard.CD_VDLM_tsbgservice_PROD.id = 2d79e79b-18c6-4f21-a551-7897418e5096 +data "dynatrace_management_zone" "CD_VDLM_tsbgservice_PROD"{ name="CD_VDLM_tsbgservice" } +resource "dynatrace_dashboard" "CD_VDLM_tsbgservice_PROD" { + dashboard_metadata { + name = "CD_VDLM_tsbgservice PROD" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "CD_VDLM_tsbgservice" ] + 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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_vdlm_tsbgservice.tf b/CN_PROD/management_zone/cd_vdlm_tsbgservice.tf new file mode 100644 index 00000000..3a4182a7 --- /dev/null +++ b/CN_PROD/management_zone/cd_vdlm_tsbgservice.tf @@ -0,0 +1,20 @@ +# DEFINE dynatrace_management_zone.CD_VDLM_tsbgservice.id = -1860485165757176866 +resource "dynatrace_management_zone" "CD_VDLM_tsbgservice" { + name = "CD_VDLM_tsbgservice" + entity_selector_based_rule { + enabled = true + selector = "type(SERVICE),databaseName.exists(),toRelationship.calls(type(SERVICE),tag(\"compass-id:tsbgservice\"))" + } + entity_selector_based_rule { + enabled = true + selector = "type(Service),tag(\"compass-id:tsbgservice\")" + } + entity_selector_based_rule { + enabled = true + selector = "type(PROCESS_GROUP_INSTANCE),tag(\"compass-id:tsbgservice\")" + } + entity_selector_based_rule { + enabled = true + selector = "type(HOST),tag(\"compass-id:tsbgservice\")" + } +} From 7d69b47eb417bbfc750fb1908868c9481af24b2e Mon Sep 17 00:00:00 2001 From: Patryk Gudalewicz Date: Wed, 1 Mar 2023 18:58:18 +0100 Subject: [PATCH 3/6] "Migrating from Monaco to Terraform for management zone: CD_VDLM_tsbgservice" --- .../alerting/cd_vdlm_tsbgservice_int.tf | 38 ++ .../dashboard/cd_vdlm_tsbgservice_int.tf | 357 ++++++++++++++++++ .../dashboard/cd_vdlm_tsbgservice_test.tf | 357 ++++++++++++++++++ .../management_zone/cd_vdlm_tsbgservice.tf | 20 + 4 files changed, 772 insertions(+) create mode 100644 EMEA_PREPROD/alerting/cd_vdlm_tsbgservice_int.tf create mode 100644 EMEA_PREPROD/dashboard/cd_vdlm_tsbgservice_int.tf create mode 100644 EMEA_PREPROD/dashboard/cd_vdlm_tsbgservice_test.tf create mode 100644 EMEA_PREPROD/management_zone/cd_vdlm_tsbgservice.tf diff --git a/EMEA_PREPROD/alerting/cd_vdlm_tsbgservice_int.tf b/EMEA_PREPROD/alerting/cd_vdlm_tsbgservice_int.tf new file mode 100644 index 00000000..3d893c43 --- /dev/null +++ b/EMEA_PREPROD/alerting/cd_vdlm_tsbgservice_int.tf @@ -0,0 +1,38 @@ +# DEFINE dynatrace_alerting.CD_VDLM_tsbgservice_INT.id = vu9U3hXa3q0AAAABABhidWlsdGluOmFsZXJ0aW5nLnByb2ZpbGUABnRlbmFudAAGdGVuYW50ACQyNDdkOTEyMC1kN2QyLTNjYTQtYjQ2MC1jZjBhZjg3Mjc3ZjO-71TeFdrerQ +data "dynatrace_management_zone" "CD_VDLM_tsbgservice_INT"{ name="CD_VDLM_tsbgservice" } +resource "dynatrace_alerting" "CD_VDLM_tsbgservice_INT" { + name = "CD_VDLM_tsbgservice INT" + management_zone = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_vdlm_tsbgservice_int.tf b/EMEA_PREPROD/dashboard/cd_vdlm_tsbgservice_int.tf new file mode 100644 index 00000000..64bbae1a --- /dev/null +++ b/EMEA_PREPROD/dashboard/cd_vdlm_tsbgservice_int.tf @@ -0,0 +1,357 @@ +# DEFINE dynatrace_dashboard.CD_VDLM_tsbgservice_INT.id = 62c826ac-e4b7-420e-a0ba-4cb83b2198d9 +data "dynatrace_management_zone" "CD_VDLM_tsbgservice_INT"{ name="CD_VDLM_tsbgservice" } +resource "dynatrace_dashboard" "CD_VDLM_tsbgservice_INT" { + dashboard_metadata { + name = "CD_VDLM_tsbgservice INT" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "CD_VDLM_tsbgservice" ] + 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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_vdlm_tsbgservice_test.tf b/EMEA_PREPROD/dashboard/cd_vdlm_tsbgservice_test.tf new file mode 100644 index 00000000..234d123f --- /dev/null +++ b/EMEA_PREPROD/dashboard/cd_vdlm_tsbgservice_test.tf @@ -0,0 +1,357 @@ +# DEFINE dynatrace_dashboard.CD_VDLM_tsbgservice_TEST.id = db8e2048-d3b3-4ff5-947e-503dfe4efe90 +data "dynatrace_management_zone" "CD_VDLM_tsbgservice_TEST"{ name="CD_VDLM_tsbgservice" } +resource "dynatrace_dashboard" "CD_VDLM_tsbgservice_TEST" { + dashboard_metadata { + name = "CD_VDLM_tsbgservice TEST" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "CD_VDLM_tsbgservice" ] + 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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_vdlm_tsbgservice.tf b/EMEA_PREPROD/management_zone/cd_vdlm_tsbgservice.tf new file mode 100644 index 00000000..233271e4 --- /dev/null +++ b/EMEA_PREPROD/management_zone/cd_vdlm_tsbgservice.tf @@ -0,0 +1,20 @@ +# DEFINE dynatrace_management_zone.CD_VDLM_tsbgservice.id = 3226805806611839394 +resource "dynatrace_management_zone" "CD_VDLM_tsbgservice" { + name = "CD_VDLM_tsbgservice" + entity_selector_based_rule { + enabled = true + selector = "type(SERVICE),databaseName.exists(),toRelationship.calls(type(SERVICE),tag(\"compass-id:tsbgservice\"))" + } + entity_selector_based_rule { + enabled = true + selector = "type(Service),tag(\"compass-id:tsbgservice\")" + } + entity_selector_based_rule { + enabled = true + selector = "type(HOST),tag(\"compass-id:tsbgservice\")" + } + entity_selector_based_rule { + enabled = true + selector = "type(PROCESS_GROUP_INSTANCE),tag(\"compass-id:tsbgservice\")" + } +} From 4030eb0f30e5056108b4680f111b79641f652fb5 Mon Sep 17 00:00:00 2001 From: Patryk Gudalewicz Date: Wed, 1 Mar 2023 19:07:15 +0100 Subject: [PATCH 4/6] "Migrating from Monaco to Terraform for management zone: CD_VDLM_tsbgservice" --- .../alerting/cd_vdlm_tsbgservice_prod.tf | 38 ++ .../dashboard/cd_vdlm_tsbgservice_e2e.tf | 357 ++++++++++++++++++ .../dashboard/cd_vdlm_tsbgservice_prod.tf | 357 ++++++++++++++++++ .../management_zone/cd_vdlm_tsbgservice.tf | 20 + 4 files changed, 772 insertions(+) create mode 100644 EMEA_PROD/alerting/cd_vdlm_tsbgservice_prod.tf create mode 100644 EMEA_PROD/dashboard/cd_vdlm_tsbgservice_e2e.tf create mode 100644 EMEA_PROD/dashboard/cd_vdlm_tsbgservice_prod.tf create mode 100644 EMEA_PROD/management_zone/cd_vdlm_tsbgservice.tf diff --git a/EMEA_PROD/alerting/cd_vdlm_tsbgservice_prod.tf b/EMEA_PROD/alerting/cd_vdlm_tsbgservice_prod.tf new file mode 100644 index 00000000..2e76aa97 --- /dev/null +++ b/EMEA_PROD/alerting/cd_vdlm_tsbgservice_prod.tf @@ -0,0 +1,38 @@ +# DEFINE dynatrace_alerting.CD_VDLM_tsbgservice_PROD.id = vu9U3hXa3q0AAAABABhidWlsdGluOmFsZXJ0aW5nLnByb2ZpbGUABnRlbmFudAAGdGVuYW50ACQ1ZWY5NzY3MS04Nzc1LTM2MjQtODA1MS05ZTcwNTFhN2Q3YTm-71TeFdrerQ +data "dynatrace_management_zone" "CD_VDLM_tsbgservice_PROD"{ name="CD_VDLM_tsbgservice" } +resource "dynatrace_alerting" "CD_VDLM_tsbgservice_PROD" { + name = "CD_VDLM_tsbgservice PROD" + management_zone = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_vdlm_tsbgservice_e2e.tf b/EMEA_PROD/dashboard/cd_vdlm_tsbgservice_e2e.tf new file mode 100644 index 00000000..77c5ba20 --- /dev/null +++ b/EMEA_PROD/dashboard/cd_vdlm_tsbgservice_e2e.tf @@ -0,0 +1,357 @@ +# DEFINE dynatrace_dashboard.CD_VDLM_tsbgservice_E2E.id = 5298f233-f6b0-4d75-91fd-a9ca47eb2e10 +data "dynatrace_management_zone" "CD_VDLM_tsbgservice_E2E"{ name="CD_VDLM_tsbgservice" } +resource "dynatrace_dashboard" "CD_VDLM_tsbgservice_E2E" { + dashboard_metadata { + name = "CD_VDLM_tsbgservice E2E" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "CD_VDLM_tsbgservice" ] + 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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_vdlm_tsbgservice_prod.tf b/EMEA_PROD/dashboard/cd_vdlm_tsbgservice_prod.tf new file mode 100644 index 00000000..6ea40bfe --- /dev/null +++ b/EMEA_PROD/dashboard/cd_vdlm_tsbgservice_prod.tf @@ -0,0 +1,357 @@ +# DEFINE dynatrace_dashboard.CD_VDLM_tsbgservice_PROD.id = 3509e7a5-0ca7-4804-a453-b3d9c396e1a6 +data "dynatrace_management_zone" "CD_VDLM_tsbgservice_PROD"{ name="CD_VDLM_tsbgservice" } +resource "dynatrace_dashboard" "CD_VDLM_tsbgservice_PROD" { + dashboard_metadata { + name = "CD_VDLM_tsbgservice PROD" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "CD_VDLM_tsbgservice" ] + 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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_vdlm_tsbgservice.tf b/EMEA_PROD/management_zone/cd_vdlm_tsbgservice.tf new file mode 100644 index 00000000..301d239b --- /dev/null +++ b/EMEA_PROD/management_zone/cd_vdlm_tsbgservice.tf @@ -0,0 +1,20 @@ +# DEFINE dynatrace_management_zone.CD_VDLM_tsbgservice.id = -4478845202524336485 +resource "dynatrace_management_zone" "CD_VDLM_tsbgservice" { + name = "CD_VDLM_tsbgservice" + entity_selector_based_rule { + enabled = true + selector = "type(PROCESS_GROUP_INSTANCE),tag(\"compass-id:tsbgservice\")" + } + entity_selector_based_rule { + enabled = true + selector = "type(HOST),tag(\"compass-id:tsbgservice\")" + } + entity_selector_based_rule { + enabled = true + selector = "type(Service),tag(\"compass-id:tsbgservice\")" + } + entity_selector_based_rule { + enabled = true + selector = "type(SERVICE),databaseName.exists(),toRelationship.calls(type(SERVICE),tag(\"compass-id:tsbgservice\"))" + } +} From e717d8421faea20535b88f0a972c14cbd979cd24 Mon Sep 17 00:00:00 2001 From: Patryk Gudalewicz Date: Wed, 1 Mar 2023 19:10:32 +0100 Subject: [PATCH 5/6] "Migrating from Monaco to Terraform for management zone: CD_VDLM_tsbgservice" --- .../alerting/cd_vdlm_tsbgservice_int.tf | 38 ++ .../dashboard/cd_vdlm_tsbgservice_int.tf | 357 ++++++++++++++++++ .../dashboard/cd_vdlm_tsbgservice_test.tf | 357 ++++++++++++++++++ .../management_zone/cd_vdlm_tsbgservice.tf | 20 + 4 files changed, 772 insertions(+) create mode 100644 NA_PREPROD/alerting/cd_vdlm_tsbgservice_int.tf create mode 100644 NA_PREPROD/dashboard/cd_vdlm_tsbgservice_int.tf create mode 100644 NA_PREPROD/dashboard/cd_vdlm_tsbgservice_test.tf create mode 100644 NA_PREPROD/management_zone/cd_vdlm_tsbgservice.tf diff --git a/NA_PREPROD/alerting/cd_vdlm_tsbgservice_int.tf b/NA_PREPROD/alerting/cd_vdlm_tsbgservice_int.tf new file mode 100644 index 00000000..c079a997 --- /dev/null +++ b/NA_PREPROD/alerting/cd_vdlm_tsbgservice_int.tf @@ -0,0 +1,38 @@ +# DEFINE dynatrace_alerting.CD_VDLM_tsbgservice_INT.id = vu9U3hXa3q0AAAABABhidWlsdGluOmFsZXJ0aW5nLnByb2ZpbGUABnRlbmFudAAGdGVuYW50ACQyYmU5NGUzYS04ZDZjLTM2ZjQtYjYwMS0wMjRiMDE0ZGQ2NjK-71TeFdrerQ +data "dynatrace_management_zone" "CD_VDLM_tsbgservice_INT"{ name="CD_VDLM_tsbgservice" } +resource "dynatrace_alerting" "CD_VDLM_tsbgservice_INT" { + name = "CD_VDLM_tsbgservice INT" + management_zone = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_vdlm_tsbgservice_int.tf b/NA_PREPROD/dashboard/cd_vdlm_tsbgservice_int.tf new file mode 100644 index 00000000..af4a184d --- /dev/null +++ b/NA_PREPROD/dashboard/cd_vdlm_tsbgservice_int.tf @@ -0,0 +1,357 @@ +# DEFINE dynatrace_dashboard.CD_VDLM_tsbgservice_INT.id = c40e3c66-ad92-4285-93e5-26988ea46a5d +data "dynatrace_management_zone" "CD_VDLM_tsbgservice_INT"{ name="CD_VDLM_tsbgservice" } +resource "dynatrace_dashboard" "CD_VDLM_tsbgservice_INT" { + dashboard_metadata { + name = "CD_VDLM_tsbgservice INT" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "CD_VDLM_tsbgservice" ] + 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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_vdlm_tsbgservice_test.tf b/NA_PREPROD/dashboard/cd_vdlm_tsbgservice_test.tf new file mode 100644 index 00000000..b6a6666c --- /dev/null +++ b/NA_PREPROD/dashboard/cd_vdlm_tsbgservice_test.tf @@ -0,0 +1,357 @@ +# DEFINE dynatrace_dashboard.CD_VDLM_tsbgservice_TEST.id = e5047d54-8be0-48a3-9a8c-b320e25aea77 +data "dynatrace_management_zone" "CD_VDLM_tsbgservice_TEST"{ name="CD_VDLM_tsbgservice" } +resource "dynatrace_dashboard" "CD_VDLM_tsbgservice_TEST" { + dashboard_metadata { + name = "CD_VDLM_tsbgservice TEST" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "CD_VDLM_tsbgservice" ] + 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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_vdlm_tsbgservice.tf b/NA_PREPROD/management_zone/cd_vdlm_tsbgservice.tf new file mode 100644 index 00000000..88eec0ae --- /dev/null +++ b/NA_PREPROD/management_zone/cd_vdlm_tsbgservice.tf @@ -0,0 +1,20 @@ +# DEFINE dynatrace_management_zone.CD_VDLM_tsbgservice.id = -1142741674939749661 +resource "dynatrace_management_zone" "CD_VDLM_tsbgservice" { + name = "CD_VDLM_tsbgservice" + entity_selector_based_rule { + enabled = true + selector = "type(HOST),tag(\"compass-id:tsbgservice\")" + } + entity_selector_based_rule { + enabled = true + selector = "type(PROCESS_GROUP_INSTANCE),tag(\"compass-id:tsbgservice\")" + } + entity_selector_based_rule { + enabled = true + selector = "type(Service),tag(\"compass-id:tsbgservice\")" + } + entity_selector_based_rule { + enabled = true + selector = "type(SERVICE),databaseName.exists(),toRelationship.calls(type(SERVICE),tag(\"compass-id:tsbgservice\"))" + } +} From 9f4ca011dc685abf4c151f04e3c22f31bfb9cf44 Mon Sep 17 00:00:00 2001 From: Patryk Gudalewicz Date: Wed, 1 Mar 2023 19:13:35 +0100 Subject: [PATCH 6/6] "Migrating from Monaco to Terraform for management zone: CD_VDLM_tsbgservice" --- NA_PROD/alerting/cd_vdlm_tsbgservice_prod.tf | 38 ++ NA_PROD/dashboard/cd_vdlm_tsbgservice_e2e.tf | 357 ++++++++++++++++++ NA_PROD/dashboard/cd_vdlm_tsbgservice_prod.tf | 357 ++++++++++++++++++ .../management_zone/cd_vdlm_tsbgservice.tf | 20 + 4 files changed, 772 insertions(+) create mode 100644 NA_PROD/alerting/cd_vdlm_tsbgservice_prod.tf create mode 100644 NA_PROD/dashboard/cd_vdlm_tsbgservice_e2e.tf create mode 100644 NA_PROD/dashboard/cd_vdlm_tsbgservice_prod.tf create mode 100644 NA_PROD/management_zone/cd_vdlm_tsbgservice.tf diff --git a/NA_PROD/alerting/cd_vdlm_tsbgservice_prod.tf b/NA_PROD/alerting/cd_vdlm_tsbgservice_prod.tf new file mode 100644 index 00000000..0490e7fc --- /dev/null +++ b/NA_PROD/alerting/cd_vdlm_tsbgservice_prod.tf @@ -0,0 +1,38 @@ +# DEFINE dynatrace_alerting.CD_VDLM_tsbgservice_PROD.id = vu9U3hXa3q0AAAABABhidWlsdGluOmFsZXJ0aW5nLnByb2ZpbGUABnRlbmFudAAGdGVuYW50ACRmZWY4MDcxYy1mNzAwLTM0YjctOGIwZS1hM2I0ZTkxOTc1NDO-71TeFdrerQ +data "dynatrace_management_zone" "CD_VDLM_tsbgservice_PROD"{ name="CD_VDLM_tsbgservice" } +resource "dynatrace_alerting" "CD_VDLM_tsbgservice_PROD" { + name = "CD_VDLM_tsbgservice PROD" + management_zone = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_vdlm_tsbgservice_e2e.tf b/NA_PROD/dashboard/cd_vdlm_tsbgservice_e2e.tf new file mode 100644 index 00000000..d3955a61 --- /dev/null +++ b/NA_PROD/dashboard/cd_vdlm_tsbgservice_e2e.tf @@ -0,0 +1,357 @@ +# DEFINE dynatrace_dashboard.CD_VDLM_tsbgservice_E2E.id = aaad917d-5d7d-4cb8-bb0c-406b9f9db230 +data "dynatrace_management_zone" "CD_VDLM_tsbgservice_E2E"{ name="CD_VDLM_tsbgservice" } +resource "dynatrace_dashboard" "CD_VDLM_tsbgservice_E2E" { + dashboard_metadata { + name = "CD_VDLM_tsbgservice E2E" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "CD_VDLM_tsbgservice" ] + 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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_vdlm_tsbgservice_prod.tf b/NA_PROD/dashboard/cd_vdlm_tsbgservice_prod.tf new file mode 100644 index 00000000..5184343b --- /dev/null +++ b/NA_PROD/dashboard/cd_vdlm_tsbgservice_prod.tf @@ -0,0 +1,357 @@ +# DEFINE dynatrace_dashboard.CD_VDLM_tsbgservice_PROD.id = e9a68357-028c-446d-999d-ecfafa8b1cf1 +data "dynatrace_management_zone" "CD_VDLM_tsbgservice_PROD"{ name="CD_VDLM_tsbgservice" } +resource "dynatrace_dashboard" "CD_VDLM_tsbgservice_PROD" { + dashboard_metadata { + name = "CD_VDLM_tsbgservice PROD" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "CD_VDLM_tsbgservice" ] + 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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_VDLM_tsbgservice" + id = data.dynatrace_management_zone.CD_VDLM_tsbgservice_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_vdlm_tsbgservice.tf b/NA_PROD/management_zone/cd_vdlm_tsbgservice.tf new file mode 100644 index 00000000..18fe4ad5 --- /dev/null +++ b/NA_PROD/management_zone/cd_vdlm_tsbgservice.tf @@ -0,0 +1,20 @@ +# DEFINE dynatrace_management_zone.CD_VDLM_tsbgservice.id = 7753479156298531441 +resource "dynatrace_management_zone" "CD_VDLM_tsbgservice" { + name = "CD_VDLM_tsbgservice" + entity_selector_based_rule { + enabled = true + selector = "type(PROCESS_GROUP_INSTANCE),tag(\"compass-id:tsbgservice\")" + } + entity_selector_based_rule { + enabled = true + selector = "type(HOST),tag(\"compass-id:tsbgservice\")" + } + entity_selector_based_rule { + enabled = true + selector = "type(Service),tag(\"compass-id:tsbgservice\")" + } + entity_selector_based_rule { + enabled = true + selector = "type(SERVICE),databaseName.exists(),toRelationship.calls(type(SERVICE),tag(\"compass-id:tsbgservice\"))" + } +}