From 6a007e412cdcaff11531acea156527d3cdfad0d6 Mon Sep 17 00:00:00 2001 From: Patryk Gudalewicz Date: Wed, 1 Mar 2023 18:48:26 +0100 Subject: [PATCH 1/6] "Migrating from Monaco to Terraform for management zone: CD_Voice-Services" --- CN_PREPROD/alerting/cd_voice-services_int.tf | 38 +++ CN_PREPROD/dashboard/cd_voice-services_int.tf | 294 ++++++++++++++++++ .../dashboard/cd_voice-services_test.tf | 294 ++++++++++++++++++ .../management_zone/cd_voice-services.tf | 99 ++++++ 4 files changed, 725 insertions(+) create mode 100644 CN_PREPROD/alerting/cd_voice-services_int.tf create mode 100644 CN_PREPROD/dashboard/cd_voice-services_int.tf create mode 100644 CN_PREPROD/dashboard/cd_voice-services_test.tf create mode 100644 CN_PREPROD/management_zone/cd_voice-services.tf diff --git a/CN_PREPROD/alerting/cd_voice-services_int.tf b/CN_PREPROD/alerting/cd_voice-services_int.tf new file mode 100644 index 00000000..ec9d0059 --- /dev/null +++ b/CN_PREPROD/alerting/cd_voice-services_int.tf @@ -0,0 +1,38 @@ +# DEFINE dynatrace_alerting.CD_Voice-Services_INT.id = vu9U3hXa3q0AAAABABhidWlsdGluOmFsZXJ0aW5nLnByb2ZpbGUABnRlbmFudAAGdGVuYW50ACQyYzY1MDVjNy0wYjNiLTRkZDAtYWJmNS00OTA0MWUzZjRkNze-71TeFdrerQ +data "dynatrace_management_zone" "CD_Voice-Services_INT"{ name="CD_Voice-Services" } +resource "dynatrace_alerting" "CD_Voice-Services_INT" { + name = "CD_Voice-Services INT" + management_zone = data.dynatrace_management_zone.CD_Voice-Services_INT.id + rules { + rule { + delay_in_minutes = 0 + include_mode = "INCLUDE_ALL" + severity_level = "AVAILABILITY" + tags = [ "Component:Voice Services", "Environment:INT" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ALL" + severity_level = "CUSTOM_ALERT" + tags = [ "Component:Voice Services", "Environment:INT" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ALL" + severity_level = "ERRORS" + tags = [ "Component:Voice Services", "Environment:INT" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ALL" + severity_level = "PERFORMANCE" + tags = [ "Component:Voice Services", "Environment:INT" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ALL" + severity_level = "RESOURCE_CONTENTION" + tags = [ "Component:Voice Services", "Environment:INT" ] + } + } +} \ No newline at end of file diff --git a/CN_PREPROD/dashboard/cd_voice-services_int.tf b/CN_PREPROD/dashboard/cd_voice-services_int.tf new file mode 100644 index 00000000..0df58eee --- /dev/null +++ b/CN_PREPROD/dashboard/cd_voice-services_int.tf @@ -0,0 +1,294 @@ +# DEFINE dynatrace_dashboard.CD_Voice-Services_INT.id = e6d6a3ed-1f14-4acf-bd93-56ed1f60a44f +data "dynatrace_management_zone" "CD_Voice-Services_INT"{ name="CD_Voice-Services" } +resource "dynatrace_dashboard" "CD_Voice-Services_INT" { + dashboard_metadata { + name = "CD_Voice-Services INT" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "Voice Services" ] + 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_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 = [ "Component:Voice Services", "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_Voice-Services" + id = data.dynatrace_management_zone.CD_Voice-Services_INT.id + } + } + } + tile { + name = "Overall Health" + configured = true + tile_type = "HEADER" + bounds { + height = 38 + left = 38 + top = 0 + width = 1064 + } + } + 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_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 = [ "Component:Voice Services", "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_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 = [ "Component:Voice Services", "Environment:INT" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "SERVICES" + bounds { + height = 152 + left = 342 + top = 38 + width = 190 + } + 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 = [ "Component:Voice Services", "Environment:INT" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "HOSTS" + bounds { + height = 152 + left = 38 + top = 38 + width = 190 + } + 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 = [ "Component:Voice Services", "Environment:INT" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/CN_PREPROD/dashboard/cd_voice-services_test.tf b/CN_PREPROD/dashboard/cd_voice-services_test.tf new file mode 100644 index 00000000..11319218 --- /dev/null +++ b/CN_PREPROD/dashboard/cd_voice-services_test.tf @@ -0,0 +1,294 @@ +# DEFINE dynatrace_dashboard.CD_Voice-Services_TEST.id = 8ee59240-f03d-4e0e-82eb-81534e61d275 +data "dynatrace_management_zone" "CD_Voice-Services_TEST"{ name="CD_Voice-Services" } +resource "dynatrace_dashboard" "CD_Voice-Services_TEST" { + dashboard_metadata { + name = "CD_Voice-Services TEST" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "Voice Services" ] + 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_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 = [ "Component:Voice Services", "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_Voice-Services" + id = data.dynatrace_management_zone.CD_Voice-Services_TEST.id + } + } + } + tile { + name = "Overall Health" + configured = true + tile_type = "HEADER" + bounds { + height = 38 + left = 38 + top = 0 + width = 1064 + } + } + 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_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 = [ "Component:Voice Services", "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_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 = [ "Component:Voice Services", "Environment:TEST" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "SERVICES" + bounds { + height = 152 + left = 342 + top = 38 + width = 190 + } + 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 = [ "Component:Voice Services", "Environment:TEST" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "HOSTS" + bounds { + height = 152 + left = 38 + top = 38 + width = 190 + } + 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 = [ "Component:Voice Services", "Environment:TEST" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/CN_PREPROD/management_zone/cd_voice-services.tf b/CN_PREPROD/management_zone/cd_voice-services.tf new file mode 100644 index 00000000..5d934923 --- /dev/null +++ b/CN_PREPROD/management_zone/cd_voice-services.tf @@ -0,0 +1,99 @@ +# DEFINE dynatrace_management_zone.CD_Voice-Services.id = 4222761489321173167 +resource "dynatrace_management_zone" "CD_Voice-Services" { + name = "CD_Voice-Services" + rules { + type = "SERVICE" + enabled = true + propagation_types = [ "SERVICE_TO_HOST_LIKE", "SERVICE_TO_PROCESS_GROUP_LIKE" ] + conditions { + key { + type = "STATIC" + attribute = "SERVICE_NAME" + } + string { + case_sensitive = true + negate = true + operator = "CONTAINS" + value = "HealthResource" + } + } + conditions { + key { + type = "STATIC" + attribute = "SERVICE_NAME" + } + string { + case_sensitive = true + negate = true + operator = "CONTAINS" + value = "PingResource" + } + } + conditions { + key { + type = "STATIC" + attribute = "SERVICE_NAME" + } + string { + case_sensitive = true + negate = true + operator = "CONTAINS" + value = "PrometheusResource" + } + } + conditions { + key { + type = "STATIC" + attribute = "SERVICE_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = "Component" + value = "Voice Services" + } + } + } + } + rules { + type = "HOST" + enabled = true + conditions { + key { + type = "STATIC" + attribute = "HOST_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = "Component" + value = "Voice Services" + } + } + } + } + rules { + type = "PROCESS_GROUP" + enabled = true + propagation_types = [ "PROCESS_GROUP_TO_HOST" ] + conditions { + key { + type = "STATIC" + attribute = "PROCESS_GROUP_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = "Component" + value = "Voice Services" + } + } + } + } +} From 7364a62431160ce6e4384c549476447cc82a6080 Mon Sep 17 00:00:00 2001 From: Patryk Gudalewicz Date: Wed, 1 Mar 2023 18:53:57 +0100 Subject: [PATCH 2/6] "Migrating from Monaco to Terraform for management zone: CD_Voice-Services" --- CN_PROD/alerting/cd_voice-services_prod.tf | 38 +++ CN_PROD/dashboard/cd_voice-services_prod.tf | 294 +++++++++++++++++++ CN_PROD/management_zone/cd_voice-services.tf | 173 +++++++++++ 3 files changed, 505 insertions(+) create mode 100644 CN_PROD/alerting/cd_voice-services_prod.tf create mode 100644 CN_PROD/dashboard/cd_voice-services_prod.tf create mode 100644 CN_PROD/management_zone/cd_voice-services.tf diff --git a/CN_PROD/alerting/cd_voice-services_prod.tf b/CN_PROD/alerting/cd_voice-services_prod.tf new file mode 100644 index 00000000..7c8a5324 --- /dev/null +++ b/CN_PROD/alerting/cd_voice-services_prod.tf @@ -0,0 +1,38 @@ +# DEFINE dynatrace_alerting.CD_Voice-Services_PROD.id = vu9U3hXa3q0AAAABABhidWlsdGluOmFsZXJ0aW5nLnByb2ZpbGUABnRlbmFudAAGdGVuYW50ACQyYmM2NTFhOC03MzBkLTQ0NjktYjBhNi1lYTQxMmIzZmMzM2O-71TeFdrerQ +data "dynatrace_management_zone" "CD_Voice-Services_PROD"{ name="CD_Voice-Services" } +resource "dynatrace_alerting" "CD_Voice-Services_PROD" { + name = "CD_Voice-Services PROD" + management_zone = data.dynatrace_management_zone.CD_Voice-Services_PROD.id + rules { + rule { + delay_in_minutes = 0 + include_mode = "INCLUDE_ALL" + severity_level = "AVAILABILITY" + tags = [ "Component:Voice Services", "Environment:PROD" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ALL" + severity_level = "CUSTOM_ALERT" + tags = [ "Component:Voice Services", "Environment:PROD" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ALL" + severity_level = "ERRORS" + tags = [ "Component:Voice Services", "Environment:PROD" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ALL" + severity_level = "PERFORMANCE" + tags = [ "Component:Voice Services", "Environment:PROD" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ALL" + severity_level = "RESOURCE_CONTENTION" + tags = [ "Component:Voice Services", "Environment:PROD" ] + } + } +} \ No newline at end of file diff --git a/CN_PROD/dashboard/cd_voice-services_prod.tf b/CN_PROD/dashboard/cd_voice-services_prod.tf new file mode 100644 index 00000000..d5d58c08 --- /dev/null +++ b/CN_PROD/dashboard/cd_voice-services_prod.tf @@ -0,0 +1,294 @@ +# DEFINE dynatrace_dashboard.CD_Voice-Services_PROD.id = a1443671-8e07-4ea6-a06a-1e6824efaa32 +data "dynatrace_management_zone" "CD_Voice-Services_PROD"{ name="CD_Voice-Services" } +resource "dynatrace_dashboard" "CD_Voice-Services_PROD" { + dashboard_metadata { + name = "CD_Voice-Services PROD" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "Voice Services" ] + 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_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 = [ "Component:Voice Services", "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_Voice-Services" + id = data.dynatrace_management_zone.CD_Voice-Services_PROD.id + } + } + } + tile { + name = "Overall Health" + configured = true + tile_type = "HEADER" + bounds { + height = 38 + left = 38 + top = 0 + width = 1064 + } + } + 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_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 = [ "Component:Voice Services", "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_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 = [ "Component:Voice Services", "Environment:PROD" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "SERVICES" + bounds { + height = 152 + left = 342 + top = 38 + width = 190 + } + 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 = [ "Component:Voice Services", "Environment:PROD" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "HOSTS" + bounds { + height = 152 + left = 38 + top = 38 + width = 190 + } + 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 = [ "Component:Voice Services", "Environment:PROD" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/CN_PROD/management_zone/cd_voice-services.tf b/CN_PROD/management_zone/cd_voice-services.tf new file mode 100644 index 00000000..763fb30f --- /dev/null +++ b/CN_PROD/management_zone/cd_voice-services.tf @@ -0,0 +1,173 @@ +# DEFINE dynatrace_management_zone.CD_Voice-Services.id = -7385937632779044043 +resource "dynatrace_management_zone" "CD_Voice-Services" { + name = "CD_Voice-Services" + rules { + type = "SERVICE" + enabled = true + propagation_types = [ "SERVICE_TO_HOST_LIKE", "SERVICE_TO_PROCESS_GROUP_LIKE" ] + conditions { + key { + type = "STATIC" + attribute = "SERVICE_NAME" + } + string { + case_sensitive = true + negate = true + operator = "CONTAINS" + value = "HealthResource" + } + } + conditions { + key { + type = "STATIC" + attribute = "SERVICE_NAME" + } + string { + case_sensitive = true + negate = true + operator = "CONTAINS" + value = "PingResource" + } + } + conditions { + key { + type = "STATIC" + attribute = "SERVICE_NAME" + } + string { + case_sensitive = true + negate = true + operator = "CONTAINS" + value = "PrometheusResource" + } + } + conditions { + key { + type = "STATIC" + attribute = "SERVICE_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = "Component" + value = "Voice Services" + } + } + } + } + rules { + type = "SERVICE" + enabled = true + conditions { + key { + type = "STATIC" + attribute = "SERVICE_NAME" + } + string { + case_sensitive = true + negate = true + operator = "CONTAINS" + value = "HealthResource" + } + } + conditions { + key { + type = "STATIC" + attribute = "SERVICE_NAME" + } + string { + case_sensitive = true + negate = true + operator = "CONTAINS" + value = "PrometheusResource" + } + } + conditions { + key { + type = "STATIC" + attribute = "SERVICE_NAME" + } + string { + case_sensitive = true + negate = true + operator = "EQUALS" + value = "PingResource" + } + } + conditions { + key { + type = "STATIC" + attribute = "SERVICE_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = " Component" + value = "Voice Services" + } + } + } + } + rules { + type = "HOST" + enabled = true + conditions { + key { + type = "STATIC" + attribute = "HOST_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = "Component" + value = "Voice Services" + } + } + } + } + rules { + type = "HOST" + enabled = true + conditions { + key { + type = "STATIC" + attribute = "HOST_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = "compass-id" + value = "B2V-Voice" + } + } + } + } + rules { + type = "PROCESS_GROUP" + enabled = true + propagation_types = [ "PROCESS_GROUP_TO_HOST", "PROCESS_GROUP_TO_SERVICE" ] + conditions { + key { + type = "STATIC" + attribute = "PROCESS_GROUP_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = "compass-id" + value = "B2V-Voice" + } + } + } + } +} From 2d29c6acc8d74ed41c00631e649d785298b4d76e Mon Sep 17 00:00:00 2001 From: Patryk Gudalewicz Date: Wed, 1 Mar 2023 18:58:31 +0100 Subject: [PATCH 3/6] "Migrating from Monaco to Terraform for management zone: CD_Voice-Services" --- .../dashboard/cd_voice-services_int.tf | 357 +++++++++++++++++ .../dashboard/cd_voice-services_test.tf | 360 ++++++++++++++++++ .../management_zone/cd_voice-services.tf | 155 ++++++++ 3 files changed, 872 insertions(+) create mode 100644 EMEA_PREPROD/dashboard/cd_voice-services_int.tf create mode 100644 EMEA_PREPROD/dashboard/cd_voice-services_test.tf create mode 100644 EMEA_PREPROD/management_zone/cd_voice-services.tf diff --git a/EMEA_PREPROD/dashboard/cd_voice-services_int.tf b/EMEA_PREPROD/dashboard/cd_voice-services_int.tf new file mode 100644 index 00000000..d1823f82 --- /dev/null +++ b/EMEA_PREPROD/dashboard/cd_voice-services_int.tf @@ -0,0 +1,357 @@ +# DEFINE dynatrace_dashboard.CD_Voice-Services_INT.id = 4925ec57-29c7-4bfd-9287-aea971cca934 +data "dynatrace_management_zone" "CD_Voice-Services_INT"{ name="CD_Voice-Services" } +resource "dynatrace_dashboard" "CD_Voice-Services_INT" { + dashboard_metadata { + name = "CD_Voice-Services INT" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "CD_Voice-Services" ] + 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_Voice-Services" + id = data.dynatrace_management_zone.CD_Voice-Services_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_Voice-Services" + id = data.dynatrace_management_zone.CD_Voice-Services_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_Voice-Services" + id = data.dynatrace_management_zone.CD_Voice-Services_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_Voice-Services" + id = data.dynatrace_management_zone.CD_Voice-Services_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_Voice-Services" + id = data.dynatrace_management_zone.CD_Voice-Services_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_Voice-Services" + id = data.dynatrace_management_zone.CD_Voice-Services_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_Voice-Services" + id = data.dynatrace_management_zone.CD_Voice-Services_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_voice-services_test.tf b/EMEA_PREPROD/dashboard/cd_voice-services_test.tf new file mode 100644 index 00000000..694c1166 --- /dev/null +++ b/EMEA_PREPROD/dashboard/cd_voice-services_test.tf @@ -0,0 +1,360 @@ +# DEFINE dynatrace_dashboard.CD_Voice-Services_TEST.id = 875b143d-f525-4662-9156-e836dd842966 +data "dynatrace_management_zone" "CD_Voice-Services_TEST"{ name="CD_Voice-Services" } +resource "dynatrace_dashboard" "CD_Voice-Services_TEST" { + dashboard_metadata { + name = "CD_Voice-Services TEST" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "CD_Voice-Services" ] + unknowns = jsonencode({ + "popularity": 1 + }) + 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_Voice-Services" + id = data.dynatrace_management_zone.CD_Voice-Services_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_Voice-Services" + id = data.dynatrace_management_zone.CD_Voice-Services_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_Voice-Services" + id = data.dynatrace_management_zone.CD_Voice-Services_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_Voice-Services" + id = data.dynatrace_management_zone.CD_Voice-Services_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_Voice-Services" + id = data.dynatrace_management_zone.CD_Voice-Services_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_Voice-Services" + id = data.dynatrace_management_zone.CD_Voice-Services_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_Voice-Services" + id = data.dynatrace_management_zone.CD_Voice-Services_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_voice-services.tf b/EMEA_PREPROD/management_zone/cd_voice-services.tf new file mode 100644 index 00000000..8c7b9340 --- /dev/null +++ b/EMEA_PREPROD/management_zone/cd_voice-services.tf @@ -0,0 +1,155 @@ +# DEFINE dynatrace_management_zone.CD_Voice-Services.id = -492699769774729136 +resource "dynatrace_management_zone" "CD_Voice-Services" { + name = "CD_Voice-Services" + entity_selector_based_rule { + # enabled = false + selector = "type(HOST),tag('ms-id:B2V-Voice','ms-id:crsa','ms-id:CRS','ms-id:epl','ms-id:epm')" + } + entity_selector_based_rule { + enabled = true + selector =<<-EOT + type(HOST),tag("ms-id:B2V-Voice","ms-id:crsa","ms-id:CRS","ms-id:epl","ms-id:epm") + EOT + } + entity_selector_based_rule { + # enabled = false + selector = "type(SERVICE),databaseName.exists(),toRelationship.calls(type(SERVICE),tag('ms-id:B2V-Voice','ms-id:crsa','ms-id:CRS','ms-id:epl','ms-id:epm'))" + } + entity_selector_based_rule { + # enabled = false + selector = "type(PROCESS_GROUP_INSTANCE),tag('msid:B2V-Voice','msid:crsa','msid:CRS','msid:epl','msid:epm')" + } + entity_selector_based_rule { + # enabled = false + selector = "type(Service),tag('msid:B2V-Voice','msid:crsa','msid:CRS','msid:epl','msid:epm')" + } + entity_selector_based_rule { + # enabled = false + selector = "type(SERVICE),databaseName.exists(),toRelationship.calls(type(SERVICE),tag('msid:B2V-Voice','msid:crsa','msid:CRS','msid:epl','msid:epm'))" + } + entity_selector_based_rule { + enabled = true + selector =<<-EOT + type(PROCESS_GROUP_INSTANCE),tag("ms-id:B2V-Voice","ms-id:crsa","ms-id:CRS","ms-id:epl","ms-id:epm") + EOT + } + entity_selector_based_rule { + # enabled = false + selector = "type(HOST),tag('msid:B2V-Voice','msid:crsa','msid:CRS','msid:epl','msid:epm')" + } + entity_selector_based_rule { + # enabled = false + selector = "type(PROCESS_GROUP_INSTANCE),tag('ms-id:B2V-Voice','ms-id:crsa','ms-id:CRS','ms-id:epl','ms-id:epm')" + } + entity_selector_based_rule { + enabled = true + selector =<<-EOT + type(SERVICE),databaseName.exists(),toRelationship.calls(type(SERVICE),tag("ms-id:B2V-Voice","ms-id:crsa","ms-id:CRS","ms-id:epl","ms-id:epm")) + EOT + } + entity_selector_based_rule { + # enabled = false + selector = "type(Service),tag('ms-id:B2V-Voice','ms-id:crsa','ms-id:CRS','ms-id:epl','ms-id:epm')" + } + entity_selector_based_rule { + enabled = true + selector =<<-EOT + type(Service),tag("ms-id:B2V-Voice","ms-id:crsa","ms-id:CRS","ms-id:epl","ms-id:epm") + EOT + } + rules { + type = "SERVICE" + # enabled = false + propagation_types = [ "SERVICE_TO_HOST_LIKE", "SERVICE_TO_PROCESS_GROUP_LIKE" ] + conditions { + key { + type = "STATIC" + attribute = "SERVICE_NAME" + } + string { + case_sensitive = true + negate = true + operator = "CONTAINS" + value = "HealthResource" + } + } + conditions { + key { + type = "STATIC" + attribute = "SERVICE_NAME" + } + string { + case_sensitive = true + negate = true + operator = "CONTAINS" + value = "PingResource" + } + } + conditions { + key { + type = "STATIC" + attribute = "SERVICE_NAME" + } + string { + case_sensitive = true + negate = true + operator = "CONTAINS" + value = "PrometheusResource" + } + } + conditions { + key { + type = "STATIC" + attribute = "SERVICE_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = "Component" + value = "Voice Services" + } + } + } + } + rules { + type = "HOST" + # enabled = false + conditions { + key { + type = "STATIC" + attribute = "HOST_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = "Component" + value = "Voice Services" + } + } + } + } + rules { + type = "PROCESS_GROUP" + # enabled = false + propagation_types = [ "PROCESS_GROUP_TO_HOST" ] + conditions { + key { + type = "STATIC" + attribute = "PROCESS_GROUP_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = "Component" + value = "Voice Services" + } + } + } + } +} From 3a1fa7f808e93a1e28c6aea563d4b7a86366d042 Mon Sep 17 00:00:00 2001 From: Patryk Gudalewicz Date: Wed, 1 Mar 2023 19:07:30 +0100 Subject: [PATCH 4/6] "Migrating from Monaco to Terraform for management zone: CD_Voice-Services" --- EMEA_PROD/dashboard/cd_voice-services_prod.tf | 324 ++++++++++++++++++ .../management_zone/cd_voice-services.tf | 111 ++++++ 2 files changed, 435 insertions(+) create mode 100644 EMEA_PROD/dashboard/cd_voice-services_prod.tf create mode 100644 EMEA_PROD/management_zone/cd_voice-services.tf diff --git a/EMEA_PROD/dashboard/cd_voice-services_prod.tf b/EMEA_PROD/dashboard/cd_voice-services_prod.tf new file mode 100644 index 00000000..81b953c4 --- /dev/null +++ b/EMEA_PROD/dashboard/cd_voice-services_prod.tf @@ -0,0 +1,324 @@ +# DEFINE dynatrace_dashboard.CD_Voice-Services_PROD.id = 9a0cd164-134c-43ec-b7eb-6c8da8faab22 +data "dynatrace_management_zone" "CD_Voice-Services_PROD"{ name="CD_Voice-Services" } +resource "dynatrace_dashboard" "CD_Voice-Services_PROD" { + dashboard_metadata { + name = "CD_Voice-Services PROD" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "Voice Services" ] + unknowns = jsonencode({ + "popularity": 1 + }) + 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_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 = [ "Component:Voice Services", "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_Voice-Services" + id = data.dynatrace_management_zone.CD_Voice-Services_PROD.id + } + } + } + tile { + name = "Overall Health" + configured = true + tile_type = "HEADER" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 0 + width = 1064 + } + } + 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_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 = [ "Component:Voice Services", "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_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 = [ "Component:Voice Services", "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_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 = [ "Component:Voice Services", "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_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 = [ "Component:Voice Services", "Environment:PROD" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/EMEA_PROD/management_zone/cd_voice-services.tf b/EMEA_PROD/management_zone/cd_voice-services.tf new file mode 100644 index 00000000..3f301e9f --- /dev/null +++ b/EMEA_PROD/management_zone/cd_voice-services.tf @@ -0,0 +1,111 @@ +# DEFINE dynatrace_management_zone.CD_Voice-Services.id = -60533151275910715 +resource "dynatrace_management_zone" "CD_Voice-Services" { + name = "CD_Voice-Services" + entity_selector_based_rule { + enabled = true + selector = "type(HOST),tag(\"compass-id:B2V-Voice\")" + } + entity_selector_based_rule { + enabled = true + selector = "type(Service),tag(\"compass-id:B2V-Voice\")" + } + entity_selector_based_rule { + enabled = true + selector = "type(PROCESS_GROUP_INSTANCE),tag(\"compass-id:B2V-Voice\")" + } + rules { + type = "SERVICE" + enabled = true + propagation_types = [ "SERVICE_TO_HOST_LIKE", "SERVICE_TO_PROCESS_GROUP_LIKE" ] + conditions { + key { + type = "STATIC" + attribute = "SERVICE_NAME" + } + string { + case_sensitive = true + negate = true + operator = "CONTAINS" + value = "HealthResource" + } + } + conditions { + key { + type = "STATIC" + attribute = "SERVICE_NAME" + } + string { + case_sensitive = true + negate = true + operator = "CONTAINS" + value = "PingResource" + } + } + conditions { + key { + type = "STATIC" + attribute = "SERVICE_NAME" + } + string { + case_sensitive = true + negate = true + operator = "CONTAINS" + value = "PrometheusResource" + } + } + conditions { + key { + type = "STATIC" + attribute = "SERVICE_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = "Component" + value = "Voice Services" + } + } + } + } + rules { + type = "HOST" + enabled = true + conditions { + key { + type = "STATIC" + attribute = "HOST_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = "Component" + value = "Voice Services" + } + } + } + } + rules { + type = "PROCESS_GROUP" + enabled = true + propagation_types = [ "PROCESS_GROUP_TO_HOST" ] + conditions { + key { + type = "STATIC" + attribute = "PROCESS_GROUP_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = "Component" + value = "Voice Services" + } + } + } + } +} From bc7c6fdbe4e44aabb53d4af7610c920314e8efde Mon Sep 17 00:00:00 2001 From: Patryk Gudalewicz Date: Wed, 1 Mar 2023 19:10:45 +0100 Subject: [PATCH 5/6] "Migrating from Monaco to Terraform for management zone: CD_Voice-Services" --- NA_PREPROD/dashboard/cd_voice-services_int.tf | 321 ++++++++++++++++++ .../dashboard/cd_voice-services_test.tf | 321 ++++++++++++++++++ .../management_zone/cd_voice-services.tf | 99 ++++++ 3 files changed, 741 insertions(+) create mode 100644 NA_PREPROD/dashboard/cd_voice-services_int.tf create mode 100644 NA_PREPROD/dashboard/cd_voice-services_test.tf create mode 100644 NA_PREPROD/management_zone/cd_voice-services.tf diff --git a/NA_PREPROD/dashboard/cd_voice-services_int.tf b/NA_PREPROD/dashboard/cd_voice-services_int.tf new file mode 100644 index 00000000..fd605c88 --- /dev/null +++ b/NA_PREPROD/dashboard/cd_voice-services_int.tf @@ -0,0 +1,321 @@ +# DEFINE dynatrace_dashboard.CD_Voice-Services_INT.id = cb5f2123-3342-4d6d-8b87-8f332d7cbe9b +data "dynatrace_management_zone" "CD_Voice-Services_INT"{ name="CD_Voice-Services" } +resource "dynatrace_dashboard" "CD_Voice-Services_INT" { + dashboard_metadata { + name = "CD_Voice-Services INT" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "Voice Services" ] + 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_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 = [ "Component:Voice Services", "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_Voice-Services" + id = data.dynatrace_management_zone.CD_Voice-Services_INT.id + } + } + } + tile { + name = "Overall Health" + configured = true + tile_type = "HEADER" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 0 + width = 1064 + } + } + 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_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 = [ "Component:Voice Services", "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_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 = [ "Component:Voice Services", "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_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 = [ "Component:Voice Services", "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_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 = [ "Component:Voice Services", "Environment:INT" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/NA_PREPROD/dashboard/cd_voice-services_test.tf b/NA_PREPROD/dashboard/cd_voice-services_test.tf new file mode 100644 index 00000000..c25c33e9 --- /dev/null +++ b/NA_PREPROD/dashboard/cd_voice-services_test.tf @@ -0,0 +1,321 @@ +# DEFINE dynatrace_dashboard.CD_Voice-Services_TEST.id = ed4ac05b-c075-48c1-96d0-b21903c8b5eb +data "dynatrace_management_zone" "CD_Voice-Services_TEST"{ name="CD_Voice-Services" } +resource "dynatrace_dashboard" "CD_Voice-Services_TEST" { + dashboard_metadata { + name = "CD_Voice-Services TEST" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "Voice Services" ] + 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_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 = [ "Component:Voice Services", "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_Voice-Services" + id = data.dynatrace_management_zone.CD_Voice-Services_TEST.id + } + } + } + tile { + name = "Overall Health" + configured = true + tile_type = "HEADER" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 0 + width = 1064 + } + } + 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_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 = [ "Component:Voice Services", "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_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 = [ "Component:Voice Services", "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_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 = [ "Component:Voice Services", "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_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 = [ "Component:Voice Services", "Environment:TEST" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/NA_PREPROD/management_zone/cd_voice-services.tf b/NA_PREPROD/management_zone/cd_voice-services.tf new file mode 100644 index 00000000..73fd2f8d --- /dev/null +++ b/NA_PREPROD/management_zone/cd_voice-services.tf @@ -0,0 +1,99 @@ +# DEFINE dynatrace_management_zone.CD_Voice-Services.id = 7488220621321245822 +resource "dynatrace_management_zone" "CD_Voice-Services" { + name = "CD_Voice-Services" + rules { + type = "SERVICE" + enabled = true + propagation_types = [ "SERVICE_TO_HOST_LIKE", "SERVICE_TO_PROCESS_GROUP_LIKE" ] + conditions { + key { + type = "STATIC" + attribute = "SERVICE_NAME" + } + string { + case_sensitive = true + negate = true + operator = "CONTAINS" + value = "HealthResource" + } + } + conditions { + key { + type = "STATIC" + attribute = "SERVICE_NAME" + } + string { + case_sensitive = true + negate = true + operator = "CONTAINS" + value = "PingResource" + } + } + conditions { + key { + type = "STATIC" + attribute = "SERVICE_NAME" + } + string { + case_sensitive = true + negate = true + operator = "CONTAINS" + value = "PrometheusResource" + } + } + conditions { + key { + type = "STATIC" + attribute = "SERVICE_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = "Component" + value = "Voice Services" + } + } + } + } + rules { + type = "HOST" + enabled = true + conditions { + key { + type = "STATIC" + attribute = "HOST_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = "Component" + value = "Voice Services" + } + } + } + } + rules { + type = "PROCESS_GROUP" + enabled = true + propagation_types = [ "PROCESS_GROUP_TO_HOST" ] + conditions { + key { + type = "STATIC" + attribute = "PROCESS_GROUP_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = "Component" + value = "Voice Services" + } + } + } + } +} From feec8a2e69022497a31e876cf4ca72d8966d98e9 Mon Sep 17 00:00:00 2001 From: Patryk Gudalewicz Date: Wed, 1 Mar 2023 19:13:48 +0100 Subject: [PATCH 6/6] "Migrating from Monaco to Terraform for management zone: CD_Voice-Services" --- NA_PROD/dashboard/cd_voice-services_prod.tf | 321 +++++++++++++++++++ NA_PROD/management_zone/cd_voice-services.tf | 99 ++++++ 2 files changed, 420 insertions(+) create mode 100644 NA_PROD/dashboard/cd_voice-services_prod.tf create mode 100644 NA_PROD/management_zone/cd_voice-services.tf diff --git a/NA_PROD/dashboard/cd_voice-services_prod.tf b/NA_PROD/dashboard/cd_voice-services_prod.tf new file mode 100644 index 00000000..397cbb01 --- /dev/null +++ b/NA_PROD/dashboard/cd_voice-services_prod.tf @@ -0,0 +1,321 @@ +# DEFINE dynatrace_dashboard.CD_Voice-Services_PROD.id = a87301b2-3743-45bf-9b8d-177ebe45f664 +data "dynatrace_management_zone" "CD_Voice-Services_PROD"{ name="CD_Voice-Services" } +resource "dynatrace_dashboard" "CD_Voice-Services_PROD" { + dashboard_metadata { + name = "CD_Voice-Services PROD" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "Voice Services" ] + 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_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 = [ "Component:Voice Services", "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_Voice-Services" + id = data.dynatrace_management_zone.CD_Voice-Services_PROD.id + } + } + } + tile { + name = "Overall Health" + configured = true + tile_type = "HEADER" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 0 + width = 1064 + } + } + 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_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 = [ "Component:Voice Services", "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_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 = [ "Component:Voice Services", "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_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 = [ "Component:Voice Services", "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_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 = [ "Component:Voice Services", "Environment:PROD" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/NA_PROD/management_zone/cd_voice-services.tf b/NA_PROD/management_zone/cd_voice-services.tf new file mode 100644 index 00000000..aa366473 --- /dev/null +++ b/NA_PROD/management_zone/cd_voice-services.tf @@ -0,0 +1,99 @@ +# DEFINE dynatrace_management_zone.CD_Voice-Services.id = 3543429273805222148 +resource "dynatrace_management_zone" "CD_Voice-Services" { + name = "CD_Voice-Services" + rules { + type = "SERVICE" + enabled = true + propagation_types = [ "SERVICE_TO_HOST_LIKE", "SERVICE_TO_PROCESS_GROUP_LIKE" ] + conditions { + key { + type = "STATIC" + attribute = "SERVICE_NAME" + } + string { + case_sensitive = true + negate = true + operator = "CONTAINS" + value = "HealthResource" + } + } + conditions { + key { + type = "STATIC" + attribute = "SERVICE_NAME" + } + string { + case_sensitive = true + negate = true + operator = "CONTAINS" + value = "PingResource" + } + } + conditions { + key { + type = "STATIC" + attribute = "SERVICE_NAME" + } + string { + case_sensitive = true + negate = true + operator = "CONTAINS" + value = "PrometheusResource" + } + } + conditions { + key { + type = "STATIC" + attribute = "SERVICE_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = "Component" + value = "Voice Services" + } + } + } + } + rules { + type = "HOST" + enabled = true + conditions { + key { + type = "STATIC" + attribute = "HOST_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = "Component" + value = "Voice Services" + } + } + } + } + rules { + type = "PROCESS_GROUP" + enabled = true + propagation_types = [ "PROCESS_GROUP_TO_HOST" ] + conditions { + key { + type = "STATIC" + attribute = "PROCESS_GROUP_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = "Component" + value = "Voice Services" + } + } + } + } +}