From 65bae28b2dc1efc1e5d785a1b8a54339356efc49 Mon Sep 17 00:00:00 2001 From: Patryk Gudalewicz Date: Wed, 1 Mar 2023 18:46:17 +0100 Subject: [PATCH 1/6] "Migrating from Monaco to Terraform for management zone: CD_dealer-comms-provider-service" --- .../cd_dealer-comms-provider-service_int.tf | 38 +++ .../cd_dealer-comms-provider-service_int.tf | 294 ++++++++++++++++++ .../cd_dealer-comms-provider-service_test.tf | 294 ++++++++++++++++++ .../cd_dealer-comms-provider-service.tf | 95 ++++++ 4 files changed, 721 insertions(+) create mode 100644 CN_PREPROD/alerting/cd_dealer-comms-provider-service_int.tf create mode 100644 CN_PREPROD/dashboard/cd_dealer-comms-provider-service_int.tf create mode 100644 CN_PREPROD/dashboard/cd_dealer-comms-provider-service_test.tf create mode 100644 CN_PREPROD/management_zone/cd_dealer-comms-provider-service.tf diff --git a/CN_PREPROD/alerting/cd_dealer-comms-provider-service_int.tf b/CN_PREPROD/alerting/cd_dealer-comms-provider-service_int.tf new file mode 100644 index 00000000..f8014760 --- /dev/null +++ b/CN_PREPROD/alerting/cd_dealer-comms-provider-service_int.tf @@ -0,0 +1,38 @@ +# DEFINE dynatrace_alerting.CD_dealer-comms-provider-service_INT.id = vu9U3hXa3q0AAAABABhidWlsdGluOmFsZXJ0aW5nLnByb2ZpbGUABnRlbmFudAAGdGVuYW50ACQ3NjUzZmEyZS0yZjc1LTQ3ZTAtOTNiOS01MWYyYTczZjc1MWS-71TeFdrerQ +data "dynatrace_management_zone" "CD_dealer-comms-provider-service_INT"{ name="CD_dealer-comms-provider-service" } +resource "dynatrace_alerting" "CD_dealer-comms-provider-service_INT" { + name = "CD_dealer-comms-provider-service INT" + management_zone = data.dynatrace_management_zone.CD_dealer-comms-provider-service_INT.id + rules { + rule { + delay_in_minutes = 0 + include_mode = "INCLUDE_ALL" + severity_level = "AVAILABILITY" + tags = [ "Component:dealer-comms-provider-service", "Environment:INT" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ALL" + severity_level = "CUSTOM_ALERT" + tags = [ "Component:dealer-comms-provider-service", "Environment:INT" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ALL" + severity_level = "ERRORS" + tags = [ "Component:dealer-comms-provider-service", "Environment:INT" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ALL" + severity_level = "PERFORMANCE" + tags = [ "Component:dealer-comms-provider-service", "Environment:INT" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ALL" + severity_level = "RESOURCE_CONTENTION" + tags = [ "Component:dealer-comms-provider-service", "Environment:INT" ] + } + } +} \ No newline at end of file diff --git a/CN_PREPROD/dashboard/cd_dealer-comms-provider-service_int.tf b/CN_PREPROD/dashboard/cd_dealer-comms-provider-service_int.tf new file mode 100644 index 00000000..1d50dfae --- /dev/null +++ b/CN_PREPROD/dashboard/cd_dealer-comms-provider-service_int.tf @@ -0,0 +1,294 @@ +# DEFINE dynatrace_dashboard.CD_dealer-comms-provider-service_INT.id = c9f4883f-f03b-4a72-a7eb-0c35a8f1da38 +data "dynatrace_management_zone" "CD_dealer-comms-provider-service_INT"{ name="CD_dealer-comms-provider-service" } +resource "dynatrace_dashboard" "CD_dealer-comms-provider-service_INT" { + dashboard_metadata { + name = "CD_dealer-comms-provider-service INT" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "dealer-comms-provider-service" ] + filter { + timeframe = "-24h to now" + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + bounds { + height = 304 + left = 38 + top = 228 + width = 1064 + } + filter_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:dealer-comms-provider-service", "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_dealer-comms-provider-service" + id = data.dynatrace_management_zone.CD_dealer-comms-provider-service_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:dealer-comms-provider-service", "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:dealer-comms-provider-service", "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:dealer-comms-provider-service", "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:dealer-comms-provider-service", "Environment:INT" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/CN_PREPROD/dashboard/cd_dealer-comms-provider-service_test.tf b/CN_PREPROD/dashboard/cd_dealer-comms-provider-service_test.tf new file mode 100644 index 00000000..92a49757 --- /dev/null +++ b/CN_PREPROD/dashboard/cd_dealer-comms-provider-service_test.tf @@ -0,0 +1,294 @@ +# DEFINE dynatrace_dashboard.CD_dealer-comms-provider-service_TEST.id = 404d99b9-62e4-4503-830f-10fec9fe0b70 +data "dynatrace_management_zone" "CD_dealer-comms-provider-service_TEST"{ name="CD_dealer-comms-provider-service" } +resource "dynatrace_dashboard" "CD_dealer-comms-provider-service_TEST" { + dashboard_metadata { + name = "CD_dealer-comms-provider-service TEST" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "dealer-comms-provider-service" ] + filter { + timeframe = "-24h to now" + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + bounds { + height = 304 + left = 38 + top = 228 + width = 1064 + } + filter_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:dealer-comms-provider-service", "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_dealer-comms-provider-service" + id = data.dynatrace_management_zone.CD_dealer-comms-provider-service_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:dealer-comms-provider-service", "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:dealer-comms-provider-service", "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:dealer-comms-provider-service", "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:dealer-comms-provider-service", "Environment:TEST" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/CN_PREPROD/management_zone/cd_dealer-comms-provider-service.tf b/CN_PREPROD/management_zone/cd_dealer-comms-provider-service.tf new file mode 100644 index 00000000..7bc4ae7f --- /dev/null +++ b/CN_PREPROD/management_zone/cd_dealer-comms-provider-service.tf @@ -0,0 +1,95 @@ +# DEFINE dynatrace_management_zone.CD_dealer-comms-provider-service.id = 9019849499618570179 +resource "dynatrace_management_zone" "CD_dealer-comms-provider-service" { + name = "CD_dealer-comms-provider-service" + rules { + type = "CLOUD_APPLICATION" + enabled = true + conditions { + key { + type = "STATIC" + attribute = "CLOUD_APPLICATION_NAME" + } + string { + case_sensitive = true + # negate = false + operator = "CONTAINS" + value = "dealer-comms-provider-service" + } + } + } + rules { + type = "CLOUD_APPLICATION_NAMESPACE" + enabled = true + conditions { + key { + type = "STATIC" + attribute = "CLOUD_APPLICATION_NAMESPACE_NAME" + } + string { + case_sensitive = true + # negate = false + operator = "CONTAINS" + value = "dealer-comms-provider-service" + } + } + } + rules { + type = "HOST" + enabled = true + conditions { + key { + type = "STATIC" + attribute = "HOST_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = "Component" + value = "dealer-comms-provider-service" + } + } + } + } + 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 = "dealer-comms-provider-service" + } + } + } + } + rules { + type = "SERVICE" + enabled = true + propagation_types = [ "SERVICE_TO_HOST_LIKE", "SERVICE_TO_PROCESS_GROUP_LIKE" ] + conditions { + key { + type = "STATIC" + attribute = "SERVICE_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = "Component" + value = "dealer-comms-provider-service" + } + } + } + } +} From 533f61a120f660445b325aec7e0949e3caa98c7f Mon Sep 17 00:00:00 2001 From: Patryk Gudalewicz Date: Wed, 1 Mar 2023 18:51:50 +0100 Subject: [PATCH 2/6] "Migrating from Monaco to Terraform for management zone: CD_dealer-comms-provider-service" --- .../cd_dealer-comms-provider-service_e2e.tf | 38 +++ .../cd_dealer-comms-provider-service_prod.tf | 38 +++ .../cd_dealer-comms-provider-service_prod.tf | 294 ++++++++++++++++++ .../cd_dealer-comms-provider-service.tf | 95 ++++++ 4 files changed, 465 insertions(+) create mode 100644 CN_PROD/alerting/cd_dealer-comms-provider-service_e2e.tf create mode 100644 CN_PROD/alerting/cd_dealer-comms-provider-service_prod.tf create mode 100644 CN_PROD/dashboard/cd_dealer-comms-provider-service_prod.tf create mode 100644 CN_PROD/management_zone/cd_dealer-comms-provider-service.tf diff --git a/CN_PROD/alerting/cd_dealer-comms-provider-service_e2e.tf b/CN_PROD/alerting/cd_dealer-comms-provider-service_e2e.tf new file mode 100644 index 00000000..5c840321 --- /dev/null +++ b/CN_PROD/alerting/cd_dealer-comms-provider-service_e2e.tf @@ -0,0 +1,38 @@ +# DEFINE dynatrace_alerting.CD_dealer-comms-provider-service_E2E.id = vu9U3hXa3q0AAAABABhidWlsdGluOmFsZXJ0aW5nLnByb2ZpbGUABnRlbmFudAAGdGVuYW50ACRhYzJjODBjMi1mMWNjLTRhNDctYTQ3Mi0yOGNmMmMzOGQwYTO-71TeFdrerQ +data "dynatrace_management_zone" "CD_dealer-comms-provider-service_E2E"{ name="CD_dealer-comms-provider-service" } +resource "dynatrace_alerting" "CD_dealer-comms-provider-service_E2E" { + name = "CD_dealer-comms-provider-service E2E" + management_zone = data.dynatrace_management_zone.CD_dealer-comms-provider-service_E2E.id + rules { + rule { + delay_in_minutes = 0 + include_mode = "INCLUDE_ALL" + severity_level = "AVAILABILITY" + tags = [ "Environment:E2E", "Component:dealer-comms-provider-service" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ALL" + severity_level = "CUSTOM_ALERT" + tags = [ "Environment:E2E", "Component:dealer-comms-provider-service" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ALL" + severity_level = "ERRORS" + tags = [ "Environment:E2E", "Component:dealer-comms-provider-service" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ALL" + severity_level = "PERFORMANCE" + tags = [ "Environment:E2E", "Component:dealer-comms-provider-service" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ALL" + severity_level = "RESOURCE_CONTENTION" + tags = [ "Environment:E2E", "Component:dealer-comms-provider-service" ] + } + } +} \ No newline at end of file diff --git a/CN_PROD/alerting/cd_dealer-comms-provider-service_prod.tf b/CN_PROD/alerting/cd_dealer-comms-provider-service_prod.tf new file mode 100644 index 00000000..c6bfa76e --- /dev/null +++ b/CN_PROD/alerting/cd_dealer-comms-provider-service_prod.tf @@ -0,0 +1,38 @@ +# DEFINE dynatrace_alerting.CD_dealer-comms-provider-service_PROD.id = vu9U3hXa3q0AAAABABhidWlsdGluOmFsZXJ0aW5nLnByb2ZpbGUABnRlbmFudAAGdGVuYW50ACRjODQwZTA1Yi1mMTdjLTRmNDQtOTFiOS1hZGY4ODE1YTk4ZDC-71TeFdrerQ +data "dynatrace_management_zone" "CD_dealer-comms-provider-service_PROD"{ name="CD_dealer-comms-provider-service" } +resource "dynatrace_alerting" "CD_dealer-comms-provider-service_PROD" { + name = "CD_dealer-comms-provider-service PROD" + management_zone = data.dynatrace_management_zone.CD_dealer-comms-provider-service_PROD.id + rules { + rule { + delay_in_minutes = 0 + include_mode = "INCLUDE_ALL" + severity_level = "AVAILABILITY" + tags = [ "Component:dealer-comms-provider-service", "Environment:PROD" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ALL" + severity_level = "CUSTOM_ALERT" + tags = [ "Component:dealer-comms-provider-service", "Environment:PROD" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ALL" + severity_level = "ERRORS" + tags = [ "Component:dealer-comms-provider-service", "Environment:PROD" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ALL" + severity_level = "PERFORMANCE" + tags = [ "Component:dealer-comms-provider-service", "Environment:PROD" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ALL" + severity_level = "RESOURCE_CONTENTION" + tags = [ "Component:dealer-comms-provider-service", "Environment:PROD" ] + } + } +} \ No newline at end of file diff --git a/CN_PROD/dashboard/cd_dealer-comms-provider-service_prod.tf b/CN_PROD/dashboard/cd_dealer-comms-provider-service_prod.tf new file mode 100644 index 00000000..bb1f9c5f --- /dev/null +++ b/CN_PROD/dashboard/cd_dealer-comms-provider-service_prod.tf @@ -0,0 +1,294 @@ +# DEFINE dynatrace_dashboard.CD_dealer-comms-provider-service_PROD.id = 1dbc3c8c-270b-484b-9f28-29a20f8e6c13 +data "dynatrace_management_zone" "CD_dealer-comms-provider-service_PROD"{ name="CD_dealer-comms-provider-service" } +resource "dynatrace_dashboard" "CD_dealer-comms-provider-service_PROD" { + dashboard_metadata { + name = "CD_dealer-comms-provider-service PROD" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "dealer-comms-provider-service" ] + filter { + timeframe = "-24h to now" + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + bounds { + height = 304 + left = 38 + top = 228 + width = 1064 + } + filter_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:dealer-comms-provider-service", "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_dealer-comms-provider-service" + id = data.dynatrace_management_zone.CD_dealer-comms-provider-service_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:dealer-comms-provider-service", "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:dealer-comms-provider-service", "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:dealer-comms-provider-service", "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:dealer-comms-provider-service", "Environment:PROD" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/CN_PROD/management_zone/cd_dealer-comms-provider-service.tf b/CN_PROD/management_zone/cd_dealer-comms-provider-service.tf new file mode 100644 index 00000000..f615e776 --- /dev/null +++ b/CN_PROD/management_zone/cd_dealer-comms-provider-service.tf @@ -0,0 +1,95 @@ +# DEFINE dynatrace_management_zone.CD_dealer-comms-provider-service.id = 7102973786394388003 +resource "dynatrace_management_zone" "CD_dealer-comms-provider-service" { + name = "CD_dealer-comms-provider-service" + rules { + type = "CLOUD_APPLICATION" + enabled = true + conditions { + key { + type = "STATIC" + attribute = "CLOUD_APPLICATION_NAME" + } + string { + case_sensitive = true + # negate = false + operator = "CONTAINS" + value = "dealer-comms-provider-service" + } + } + } + rules { + type = "CLOUD_APPLICATION_NAMESPACE" + enabled = true + conditions { + key { + type = "STATIC" + attribute = "CLOUD_APPLICATION_NAMESPACE_NAME" + } + string { + case_sensitive = true + # negate = false + operator = "CONTAINS" + value = "dealer-comms-provider-service" + } + } + } + rules { + type = "HOST" + enabled = true + conditions { + key { + type = "STATIC" + attribute = "HOST_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = "Component" + value = "dealer-comms-provider-service" + } + } + } + } + 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 = "dealer-comms-provider-service" + } + } + } + } + rules { + type = "SERVICE" + enabled = true + propagation_types = [ "SERVICE_TO_HOST_LIKE", "SERVICE_TO_PROCESS_GROUP_LIKE" ] + conditions { + key { + type = "STATIC" + attribute = "SERVICE_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = "Component" + value = "dealer-comms-provider-service" + } + } + } + } +} From bfcea942c097aba51e18a7322256a4978f440c26 Mon Sep 17 00:00:00 2001 From: Patryk Gudalewicz Date: Wed, 1 Mar 2023 18:56:41 +0100 Subject: [PATCH 3/6] "Migrating from Monaco to Terraform for management zone: CD_dealer-comms-provider-service" --- .../cd_dealer-comms-provider-service_int.tf | 357 ++++++++++++++++++ .../cd_dealer-comms-provider-service_test.tf | 357 ++++++++++++++++++ .../cd_dealer-comms-provider-service.tf | 143 +++++++ 3 files changed, 857 insertions(+) create mode 100644 EMEA_PREPROD/dashboard/cd_dealer-comms-provider-service_int.tf create mode 100644 EMEA_PREPROD/dashboard/cd_dealer-comms-provider-service_test.tf create mode 100644 EMEA_PREPROD/management_zone/cd_dealer-comms-provider-service.tf diff --git a/EMEA_PREPROD/dashboard/cd_dealer-comms-provider-service_int.tf b/EMEA_PREPROD/dashboard/cd_dealer-comms-provider-service_int.tf new file mode 100644 index 00000000..a35101f2 --- /dev/null +++ b/EMEA_PREPROD/dashboard/cd_dealer-comms-provider-service_int.tf @@ -0,0 +1,357 @@ +# DEFINE dynatrace_dashboard.CD_dealer-comms-provider-service_INT.id = 9b849ac6-d6f3-4657-a0db-305c11cd1298 +data "dynatrace_management_zone" "CD_dealer-comms-provider-service_INT"{ name="CD_dealer-comms-provider-service" } +resource "dynatrace_dashboard" "CD_dealer-comms-provider-service_INT" { + dashboard_metadata { + name = "CD_dealer-comms-provider-service INT" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "CD_dealer-comms-provider-service" ] + filter { + timeframe = "-24h to now" + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 304 + left = 38 + top = 228 + width = 1064 + } + filter { + management_zone { + name = "CD_dealer-comms-provider-service" + id = data.dynatrace_management_zone.CD_dealer-comms-provider-service_INT.id + } + } + filter_config { + type = "MIXED" + custom_name = "Failure rate (HTTP 4xx/5xx errors)" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#ff0000" + key = "nullbuiltin:service.errors.fivexx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956393463 + } + config { + custom_color = "#fff29a" + key = "nullbuiltin:service.errors.fourxx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956441725 + } + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fourxx.rate" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fivexx.rate" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:INT" ] + } + } + } + } + } + tile { + name = "Problems" + configured = true + tile_type = "OPEN_PROBLEMS" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 950 + top = 38 + width = 152 + } + filter { + management_zone { + name = "CD_dealer-comms-provider-service" + id = data.dynatrace_management_zone.CD_dealer-comms-provider-service_INT.id + } + } + } + tile { + name = "Overall Health" + configured = true + tile_type = "HEADER" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 0 + width = 1064 + } + filter { + management_zone { + name = "CD_dealer-comms-provider-service" + id = data.dynatrace_management_zone.CD_dealer-comms-provider-service_INT.id + } + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 532 + width = 1064 + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 304 + left = 38 + top = 570 + width = 1064 + } + filter { + management_zone { + name = "CD_dealer-comms-provider-service" + id = data.dynatrace_management_zone.CD_dealer-comms-provider-service_INT.id + } + } + filter_config { + type = "MIXED" + custom_name = "Response time, Request Count and Number of Errors" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#008cdb" + key = "nullbuiltin:service.requestCount.total|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275720776 + } + config { + custom_color = "#b4e5f9" + key = "nullbuiltin:service.response.time|AVG|TOTAL|LINE|SERVICE" + last_modified = 1595275686773 + } + config { + custom_color = "#ef651f" + key = "nullbuiltin:service.errors.total.count|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275955999 + } + } + series { + type = "LINE" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.response.time" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.requestCount.total" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.total.count" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:INT" ] + } + } + } + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 190 + width = 1064 + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "DATABASES_OVERVIEW" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 646 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_dealer-comms-provider-service" + id = data.dynatrace_management_zone.CD_dealer-comms-provider-service_INT.id + } + } + filter_config { + type = "DATABASE" + custom_name = "Databases" + default_name = "Databases" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "DATABASE" + match { + key = "AUTO_TAGS" + values = [ "Environment:INT" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "SERVICES" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 342 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_dealer-comms-provider-service" + id = data.dynatrace_management_zone.CD_dealer-comms-provider-service_INT.id + } + } + filter_config { + type = "SERVICE" + custom_name = "Services" + default_name = "Services" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:INT" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "HOSTS" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 38 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_dealer-comms-provider-service" + id = data.dynatrace_management_zone.CD_dealer-comms-provider-service_INT.id + } + } + filter_config { + type = "HOST" + custom_name = "Hosts" + default_name = "Hosts" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "HOST" + match { + key = "AUTO_TAGS" + values = [ "Environment:INT" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/EMEA_PREPROD/dashboard/cd_dealer-comms-provider-service_test.tf b/EMEA_PREPROD/dashboard/cd_dealer-comms-provider-service_test.tf new file mode 100644 index 00000000..60115513 --- /dev/null +++ b/EMEA_PREPROD/dashboard/cd_dealer-comms-provider-service_test.tf @@ -0,0 +1,357 @@ +# DEFINE dynatrace_dashboard.CD_dealer-comms-provider-service_TEST.id = b8e113d7-1199-4122-ab6d-78f6099ba87f +data "dynatrace_management_zone" "CD_dealer-comms-provider-service_TEST"{ name="CD_dealer-comms-provider-service" } +resource "dynatrace_dashboard" "CD_dealer-comms-provider-service_TEST" { + dashboard_metadata { + name = "CD_dealer-comms-provider-service TEST" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "CD_dealer-comms-provider-service" ] + filter { + timeframe = "-24h to now" + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 304 + left = 38 + top = 228 + width = 1064 + } + filter { + management_zone { + name = "CD_dealer-comms-provider-service" + id = data.dynatrace_management_zone.CD_dealer-comms-provider-service_TEST.id + } + } + filter_config { + type = "MIXED" + custom_name = "Failure rate (HTTP 4xx/5xx errors)" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#ff0000" + key = "nullbuiltin:service.errors.fivexx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956393463 + } + config { + custom_color = "#fff29a" + key = "nullbuiltin:service.errors.fourxx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956441725 + } + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fourxx.rate" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fivexx.rate" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:TEST" ] + } + } + } + } + } + tile { + name = "Problems" + configured = true + tile_type = "OPEN_PROBLEMS" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 950 + top = 38 + width = 152 + } + filter { + management_zone { + name = "CD_dealer-comms-provider-service" + id = data.dynatrace_management_zone.CD_dealer-comms-provider-service_TEST.id + } + } + } + tile { + name = "Overall Health" + configured = true + tile_type = "HEADER" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 0 + width = 1064 + } + filter { + management_zone { + name = "CD_dealer-comms-provider-service" + id = data.dynatrace_management_zone.CD_dealer-comms-provider-service_TEST.id + } + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 532 + width = 1064 + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 304 + left = 38 + top = 570 + width = 1064 + } + filter { + management_zone { + name = "CD_dealer-comms-provider-service" + id = data.dynatrace_management_zone.CD_dealer-comms-provider-service_TEST.id + } + } + filter_config { + type = "MIXED" + custom_name = "Response time, Request Count and Number of Errors" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#008cdb" + key = "nullbuiltin:service.requestCount.total|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275720776 + } + config { + custom_color = "#b4e5f9" + key = "nullbuiltin:service.response.time|AVG|TOTAL|LINE|SERVICE" + last_modified = 1595275686773 + } + config { + custom_color = "#ef651f" + key = "nullbuiltin:service.errors.total.count|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275955999 + } + } + series { + type = "LINE" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.response.time" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.requestCount.total" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.total.count" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:TEST" ] + } + } + } + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 190 + width = 1064 + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "DATABASES_OVERVIEW" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 646 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_dealer-comms-provider-service" + id = data.dynatrace_management_zone.CD_dealer-comms-provider-service_TEST.id + } + } + filter_config { + type = "DATABASE" + custom_name = "Databases" + default_name = "Databases" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "DATABASE" + match { + key = "AUTO_TAGS" + values = [ "Environment:TEST" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "SERVICES" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 342 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_dealer-comms-provider-service" + id = data.dynatrace_management_zone.CD_dealer-comms-provider-service_TEST.id + } + } + filter_config { + type = "SERVICE" + custom_name = "Services" + default_name = "Services" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:TEST" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "HOSTS" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 38 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_dealer-comms-provider-service" + id = data.dynatrace_management_zone.CD_dealer-comms-provider-service_TEST.id + } + } + filter_config { + type = "HOST" + custom_name = "Hosts" + default_name = "Hosts" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "HOST" + match { + key = "AUTO_TAGS" + values = [ "Environment:TEST" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/EMEA_PREPROD/management_zone/cd_dealer-comms-provider-service.tf b/EMEA_PREPROD/management_zone/cd_dealer-comms-provider-service.tf new file mode 100644 index 00000000..968703dd --- /dev/null +++ b/EMEA_PREPROD/management_zone/cd_dealer-comms-provider-service.tf @@ -0,0 +1,143 @@ +# DEFINE dynatrace_management_zone.CD_dealer-comms-provider-service.id = 7729131985260015885 +resource "dynatrace_management_zone" "CD_dealer-comms-provider-service" { + name = "CD_dealer-comms-provider-service" + entity_selector_based_rule { + # enabled = false + selector = "type(SERVICE),databaseName.exists(),toRelationship.calls(type(SERVICE),tag('ms-id:mobile20-DCPS'))" + } + entity_selector_based_rule { + enabled = true + selector = "type(PROCESS_GROUP_INSTANCE),tag(\"ms-id:mobile20-DCPS\")" + } + entity_selector_based_rule { + # enabled = false + selector = "type(PROCESS_GROUP_INSTANCE),tag('msid:mobile20-DCPS')" + } + entity_selector_based_rule { + # enabled = false + selector = "type(HOST),tag('msid:mobile20-DCPS')" + } + entity_selector_based_rule { + # enabled = false + selector = "type(Service),tag('ms-id:mobile20-DCPS')" + } + entity_selector_based_rule { + # enabled = false + selector = "type(PROCESS_GROUP_INSTANCE),tag('ms-id:mobile20-DCPS')" + } + entity_selector_based_rule { + enabled = true + selector = "type(SERVICE),databaseName.exists(),toRelationship.calls(type(SERVICE),tag(\"ms-id:mobile20-DCPS\"))" + } + entity_selector_based_rule { + # enabled = false + selector = "type(HOST),tag('ms-id:mobile20-DCPS')" + } + entity_selector_based_rule { + # enabled = false + selector = "type(Service),tag('msid:mobile20-DCPS')" + } + entity_selector_based_rule { + # enabled = false + selector = "type(SERVICE),databaseName.exists(),toRelationship.calls(type(SERVICE),tag('msid:mobile20-DCPS'))" + } + entity_selector_based_rule { + enabled = true + selector = "type(Service),tag(\"ms-id:mobile20-DCPS\")" + } + entity_selector_based_rule { + enabled = true + selector = "type(HOST),tag(\"ms-id:mobile20-DCPS\")" + } + rules { + type = "CLOUD_APPLICATION" + # enabled = false + conditions { + key { + type = "STATIC" + attribute = "CLOUD_APPLICATION_NAME" + } + string { + case_sensitive = true + # negate = false + operator = "CONTAINS" + value = "dealer-comms-provider-service" + } + } + } + rules { + type = "CLOUD_APPLICATION_NAMESPACE" + # enabled = false + conditions { + key { + type = "STATIC" + attribute = "CLOUD_APPLICATION_NAMESPACE_NAME" + } + string { + case_sensitive = true + # negate = false + operator = "CONTAINS" + value = "dealer-comms-provider-service" + } + } + } + rules { + type = "HOST" + # enabled = false + conditions { + key { + type = "STATIC" + attribute = "HOST_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = "Component" + value = "dealer-comms-provider-service" + } + } + } + } + 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 = "dealer-comms-provider-service" + } + } + } + } + rules { + type = "SERVICE" + # enabled = false + propagation_types = [ "SERVICE_TO_HOST_LIKE", "SERVICE_TO_PROCESS_GROUP_LIKE" ] + conditions { + key { + type = "STATIC" + attribute = "SERVICE_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = "Component" + value = "dealer-comms-provider-service" + } + } + } + } +} From 73c6fcee858af6127d7f7c5e66f364a89883323d Mon Sep 17 00:00:00 2001 From: Patryk Gudalewicz Date: Wed, 1 Mar 2023 18:59:43 +0100 Subject: [PATCH 4/6] "Migrating from Monaco to Terraform for management zone: CD_dealer-comms-provider-service" --- .../cd_dealer-comms-provider-service_e2e.tf | 321 ++++++ .../cd_dealer-comms-provider-service_prod.tf | 974 ++++++++++++++++++ .../cd_dealer-comms-provider-service.tf | 95 ++ 3 files changed, 1390 insertions(+) create mode 100644 EMEA_PROD/dashboard/cd_dealer-comms-provider-service_e2e.tf create mode 100644 EMEA_PROD/dashboard/cd_dealer-comms-provider-service_prod.tf create mode 100644 EMEA_PROD/management_zone/cd_dealer-comms-provider-service.tf diff --git a/EMEA_PROD/dashboard/cd_dealer-comms-provider-service_e2e.tf b/EMEA_PROD/dashboard/cd_dealer-comms-provider-service_e2e.tf new file mode 100644 index 00000000..b5ce350c --- /dev/null +++ b/EMEA_PROD/dashboard/cd_dealer-comms-provider-service_e2e.tf @@ -0,0 +1,321 @@ +# DEFINE dynatrace_dashboard.CD_dealer-comms-provider-service_E2E.id = a7651d22-6549-4bfd-941f-f1e93c6f0034 +data "dynatrace_management_zone" "CD_dealer-comms-provider-service_E2E"{ name="CD_dealer-comms-provider-service" } +resource "dynatrace_dashboard" "CD_dealer-comms-provider-service_E2E" { + dashboard_metadata { + name = "CD_dealer-comms-provider-service E2E" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "dealer-comms-provider-service" ] + filter { + timeframe = "-24h to now" + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 304 + left = 38 + top = 228 + width = 1064 + } + filter_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", "Component:dealer-comms-provider-service" ] + } + } + } + } + } + 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_dealer-comms-provider-service" + id = data.dynatrace_management_zone.CD_dealer-comms-provider-service_E2E.id + } + } + } + tile { + name = "Overall Health" + configured = true + tile_type = "HEADER" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 0 + width = 1064 + } + } + 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 = [ "Environment:E2E", "Component:dealer-comms-provider-service" ] + } + } + } + } + } + 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 = [ "Environment:E2E", "Component:dealer-comms-provider-service" ] + } + } + } + } + } + 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 = [ "Environment:E2E", "Component:dealer-comms-provider-service" ] + } + } + } + } + } + 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 = [ "Environment:E2E", "Component:dealer-comms-provider-service" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/EMEA_PROD/dashboard/cd_dealer-comms-provider-service_prod.tf b/EMEA_PROD/dashboard/cd_dealer-comms-provider-service_prod.tf new file mode 100644 index 00000000..a49a3212 --- /dev/null +++ b/EMEA_PROD/dashboard/cd_dealer-comms-provider-service_prod.tf @@ -0,0 +1,974 @@ +# DEFINE dynatrace_dashboard.CD_dealer-comms-provider-service_PROD.id = 23c458a1-f4f1-4363-96d2-9764d0faa837 +data "dynatrace_management_zone" "CD_dealer-comms-provider-service_PROD"{ name="CD_dealer-comms-provider-service" } +resource "dynatrace_dashboard" "CD_dealer-comms-provider-service_PROD" { + dashboard_metadata { + name = "CD_dealer-comms-provider-service PROD" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "dealer-comms-provider-service" ] + filter { + timeframe = "-24h to now" + } + } + tile { + name = "Problems" + configured = true + tile_type = "OPEN_PROBLEMS" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 456 + top = 76 + width = 152 + } + filter { + management_zone { + name = "CD_dealer-comms-provider-service" + id = data.dynatrace_management_zone.CD_dealer-comms-provider-service_PROD.id + } + } + } + tile { + name = "Overall Health" + configured = true + tile_type = "HEADER" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 0 + top = 0 + width = 608 + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "DATABASES_OVERVIEW" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 304 + top = 76 + width = 152 + } + 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:dealer-comms-provider-service", "Environment:PROD" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "SERVICES" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 152 + top = 76 + width = 152 + } + 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:dealer-comms-provider-service", "Environment:PROD" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "HOSTS" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 0 + top = 76 + width = 152 + } + 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:dealer-comms-provider-service", "Environment:PROD" ] + } + } + } + } + } + tile { + name = "DealerCommsProviderService.WebApi - PROD" + assigned_entities = [ "SERVICE_METHOD-243FA9E357C5334B", "SERVICE-8C3A7862B74A4401" ] + configured = true + tile_type = "SERVICE_VERSATILE" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 228 + left = 0 + top = 304 + width = 304 + } + } + tile { + name = "DealerCommsProviderService.WebApi - PROD" + assigned_entities = [ "SERVICE_METHOD-90CBEEC926F3F3FB", "SERVICE-8C3A7862B74A4401" ] + configured = true + tile_type = "SERVICE_VERSATILE" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 228 + left = 304 + top = 304 + width = 304 + } + } + tile { + name = "DealerCommsProviderService.WebApi - PROD" + assigned_entities = [ "SERVICE_METHOD-5686BB2B75A86287", "SERVICE-8C3A7862B74A4401" ] + configured = true + tile_type = "SERVICE_VERSATILE" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 228 + left = 608 + top = 304 + width = 304 + } + } + tile { + name = "Reliability - /recognize" + configured = true + custom_name = "Data explorer results" + tile_type = "DATA_EXPLORER" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false, + "metricExpressions": [ + "resolution=Inf\u0026(builtin:service.keyRequest.successes.server.rate:filter(and(or(in(\"dt.entity.service_method\",entitySelector(\"type(service_method),entityName(~\"/api/v2/setup/recognize~\")\"))))):splitBy():avg:auto:sort(value(avg,descending)):limit(20)):limit(100):names", + "resolution=null\u0026(builtin:service.keyRequest.successes.server.rate:filter(and(or(in(\"dt.entity.service_method\",entitySelector(\"type(service_method),entityName(~\"/api/v2/setup/recognize~\")\"))))):splitBy():avg:auto:sort(value(avg,descending)):limit(20))" + ], + "queries": [ + { + "enabled": true, + "filterBy": { + "criteria": [], + "filterOperator": "AND", + "nestedFilters": [ + { + "criteria": [ + { + "evaluator": "IN", + "value": "/api/v2/setup/recognize" + } + ], + "entityAttribute": "entityName", + "filter": "dt.entity.service_method", + "filterOperator": "OR", + "filterType": "NAME", + "nestedFilters": [] + } + ] + }, + "id": "A", + "metric": "builtin:service.keyRequest.successes.server.rate", + "rate": "NONE", + "spaceAggregation": "AVG", + "splitBy": [], + "timeAggregation": "DEFAULT" + } + ], + "visualConfig": { + "axes": { + "xAxis": { + "displayName": "", + "visible": true + }, + "yAxes": [ + { + "defaultAxis": true, + "displayName": "", + "max": "AUTO", + "min": "AUTO", + "position": "LEFT", + "queryIds": [ + "A", + "" + ], + "visible": true + } + ] + }, + "global": { + "hideLegend": false + }, + "rules": [ + { + "matcher": "A:", + "properties": { + "color": "DEFAULT", + "seriesType": "LINE" + }, + "seriesOverrides": [] + } + ], + "singleValueSettings": { + "showSparkLine": true + }, + "thresholds": [ + { + "axisTarget": "LEFT", + "rules": [ + { + "color": "#7dc540", + "value": 99 + }, + { + "color": "#f5d30f", + "value": 98 + }, + { + "color": "#dc172a", + "value": 0 + } + ], + "visible": true + } + ], + "type": "SINGLE_VALUE" + } + }) + bounds { + height = 114 + left = 0 + top = 532 + width = 304 + } + } + tile { + name = "Reliability - /config/thread" + configured = true + custom_name = "Data explorer results" + tile_type = "DATA_EXPLORER" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false, + "metricExpressions": [ + "resolution=Inf\u0026(builtin:service.keyRequest.successes.server.rate:filter(and(or(in(\"dt.entity.service_method\",entitySelector(\"type(service_method),entityName(~\"/api/v2/setup/config/thread/[UUID]~\")\"))))):splitBy():avg:auto:sort(value(avg,descending)):limit(20)):limit(100):names", + "resolution=null\u0026(builtin:service.keyRequest.successes.server.rate:filter(and(or(in(\"dt.entity.service_method\",entitySelector(\"type(service_method),entityName(~\"/api/v2/setup/config/thread/[UUID]~\")\"))))):splitBy():avg:auto:sort(value(avg,descending)):limit(20))" + ], + "queries": [ + { + "enabled": true, + "filterBy": { + "criteria": [], + "filterOperator": "AND", + "nestedFilters": [ + { + "criteria": [ + { + "evaluator": "IN", + "value": "/api/v2/setup/config/thread/[UUID]" + } + ], + "entityAttribute": "entityName", + "filter": "dt.entity.service_method", + "filterOperator": "OR", + "filterType": "NAME", + "nestedFilters": [] + } + ] + }, + "id": "A", + "metric": "builtin:service.keyRequest.successes.server.rate", + "rate": "NONE", + "spaceAggregation": "AVG", + "splitBy": [], + "timeAggregation": "DEFAULT" + } + ], + "visualConfig": { + "axes": { + "xAxis": { + "displayName": "", + "visible": true + }, + "yAxes": [ + { + "defaultAxis": true, + "displayName": "", + "max": "AUTO", + "min": "AUTO", + "position": "LEFT", + "queryIds": [ + "A", + "" + ], + "visible": true + } + ] + }, + "global": { + "hideLegend": false + }, + "rules": [ + { + "matcher": "A:", + "properties": { + "color": "DEFAULT", + "seriesType": "LINE" + }, + "seriesOverrides": [] + } + ], + "singleValueSettings": { + "showSparkLine": true + }, + "thresholds": [ + { + "axisTarget": "LEFT", + "rules": [ + { + "color": "#7dc540", + "value": 99 + }, + { + "color": "#f5d30f", + "value": 98 + }, + { + "color": "#dc172a", + "value": 0 + } + ], + "visible": true + } + ], + "type": "SINGLE_VALUE" + } + }) + bounds { + height = 114 + left = 304 + top = 532 + width = 304 + } + } + tile { + name = "Reliability - /inspection" + configured = true + custom_name = "Data explorer results" + tile_type = "DATA_EXPLORER" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false, + "metricExpressions": [ + "resolution=Inf\u0026(builtin:service.keyRequest.successes.server.rate:filter(and(or(in(\"dt.entity.service_method\",entitySelector(\"type(service_method),entityName(~\"/api/v2/thread/[UUID]/inspection~\")\"))))):splitBy():avg:auto:sort(value(avg,descending)):limit(20)):limit(100):names", + "resolution=null\u0026(builtin:service.keyRequest.successes.server.rate:filter(and(or(in(\"dt.entity.service_method\",entitySelector(\"type(service_method),entityName(~\"/api/v2/thread/[UUID]/inspection~\")\"))))):splitBy():avg:auto:sort(value(avg,descending)):limit(20))" + ], + "queries": [ + { + "enabled": true, + "filterBy": { + "criteria": [], + "filterOperator": "AND", + "nestedFilters": [ + { + "criteria": [ + { + "evaluator": "IN", + "value": "/api/v2/thread/[UUID]/inspection" + } + ], + "entityAttribute": "entityName", + "filter": "dt.entity.service_method", + "filterOperator": "OR", + "filterType": "NAME", + "nestedFilters": [] + } + ] + }, + "id": "A", + "metric": "builtin:service.keyRequest.successes.server.rate", + "rate": "NONE", + "spaceAggregation": "AVG", + "splitBy": [], + "timeAggregation": "DEFAULT" + } + ], + "visualConfig": { + "axes": { + "xAxis": { + "displayName": "", + "visible": true + }, + "yAxes": [ + { + "defaultAxis": true, + "displayName": "", + "max": "AUTO", + "min": "AUTO", + "position": "LEFT", + "queryIds": [ + "A", + "" + ], + "visible": true + } + ] + }, + "global": { + "hideLegend": false + }, + "rules": [ + { + "matcher": "A:", + "properties": { + "color": "DEFAULT", + "seriesType": "LINE" + }, + "seriesOverrides": [] + } + ], + "singleValueSettings": { + "showSparkLine": true + }, + "thresholds": [ + { + "axisTarget": "LEFT", + "rules": [ + { + "color": "#7dc540", + "value": 99 + }, + { + "color": "#f5d30f", + "value": 98 + }, + { + "color": "#dc172a", + "value": 0 + } + ], + "visible": true + } + ], + "type": "SINGLE_VALUE" + } + }) + bounds { + height = 114 + left = 608 + top = 532 + width = 304 + } + } + tile { + name = "Markdown" + configured = true + markdown = "#### [DealerCommsProviderService.WebApi](https://xxu26128.live.dynatrace.com/#newservices/serviceOverview;gtf=-2h;gf=-7384668182503674044;id=SERVICE-8C3A7862B74A4401)" + tile_type = "MARKDOWN" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 608 + top = 114 + width = 304 + } + } + tile { + name = "Markdown" + configured = true + markdown = "#### [Transaction Linking ](https://xxu26128.live.dynatrace.com/ui/diagnostictools/mda?gtf=-24h%20to%20now&gf=all&metric=REQUEST_COUNT&dimension=%7BRequestAttribute:GCID%7D&mergeServices=false&aggregation=COUNT&percentile=80&chart=LINE&servicefilter=0%1E15%116c28cf4e-cac4-4e51-99e9-d8bb4d5f320a%14281dae64-7cd3-41be-a57f-63d64925e299)" + tile_type = "MARKDOWN" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 608 + top = 152 + width = 304 + } + } + tile { + name = "Markdown" + configured = true + markdown = "#### [Global Wirkette KPI Dashboard](https://jyy23483.live.dynatrace.com/#dashboard;gtf=-7d%20to%20now;gf=all;id=bba1cc40-9790-425f-951a-3bb3f5dcc9e5)" + tile_type = "MARKDOWN" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 608 + top = 76 + width = 304 + } + } + tile { + name = "Links" + configured = true + tile_type = "HEADER" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 608 + top = 0 + width = 304 + } + } + tile { + name = "Markdown" + configured = true + markdown = "---" + tile_type = "MARKDOWN" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 0 + top = 38 + width = 912 + } + } + tile { + name = "Markdown" + configured = true + markdown = "---" + tile_type = "MARKDOWN" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 0 + top = 228 + width = 912 + } + } + tile { + name = "Latency - /recognize" + configured = true + custom_name = "Data explorer results" + tile_type = "DATA_EXPLORER" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false, + "metricExpressions": [ + "resolution=Inf\u0026(builtin:service.keyRequest.response.server:filter(and(or(in(\"dt.entity.service_method\",entitySelector(\"type(service_method),entityName(~\"/api/v2/setup/recognize~\")\"))))):splitBy():percentile(90.0):auto:sort(value(percentile(90.0),descending)):limit(20)):limit(100):names", + "resolution=null\u0026(builtin:service.keyRequest.response.server:filter(and(or(in(\"dt.entity.service_method\",entitySelector(\"type(service_method),entityName(~\"/api/v2/setup/recognize~\")\"))))):splitBy():percentile(90.0):auto:sort(value(percentile(90.0),descending)):limit(20))" + ], + "queries": [ + { + "enabled": true, + "filterBy": { + "criteria": [], + "filterOperator": "AND", + "nestedFilters": [ + { + "criteria": [ + { + "evaluator": "IN", + "value": "/api/v2/setup/recognize" + } + ], + "entityAttribute": "entityName", + "filter": "dt.entity.service_method", + "filterOperator": "OR", + "filterType": "NAME", + "nestedFilters": [] + } + ] + }, + "id": "A", + "metric": "builtin:service.keyRequest.response.server", + "rate": "NONE", + "spaceAggregation": "PERCENTILE_90", + "splitBy": [], + "timeAggregation": "DEFAULT" + } + ], + "visualConfig": { + "axes": { + "xAxis": { + "displayName": "", + "visible": true + }, + "yAxes": [ + { + "defaultAxis": true, + "displayName": "", + "max": "AUTO", + "min": "AUTO", + "position": "LEFT", + "queryIds": [ + "A", + "" + ], + "visible": true + } + ] + }, + "global": { + "hideLegend": false + }, + "rules": [ + { + "matcher": "A:", + "properties": { + "color": "DEFAULT", + "seriesType": "LINE" + }, + "seriesOverrides": [] + } + ], + "singleValueSettings": { + "showSparkLine": true + }, + "thresholds": [ + { + "axisTarget": "LEFT", + "rules": [ + { + "color": "#dc172a", + "value": 800000 + }, + { + "color": "#f5d30f", + "value": 700000 + }, + { + "color": "#7dc540", + "value": 0 + } + ], + "visible": true + } + ], + "type": "SINGLE_VALUE" + } + }) + bounds { + height = 114 + left = 0 + top = 646 + width = 304 + } + } + tile { + name = "Latency - /config/thread" + configured = true + custom_name = "Data explorer results" + tile_type = "DATA_EXPLORER" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false, + "metricExpressions": [ + "resolution=Inf\u0026(builtin:service.keyRequest.response.server:filter(and(or(in(\"dt.entity.service_method\",entitySelector(\"type(service_method),entityName(~\"/api/v2/setup/config/thread/[UUID]~\")\"))))):splitBy():percentile(90.0):auto:sort(value(percentile(90.0),descending)):limit(20)):limit(100):names", + "resolution=null\u0026(builtin:service.keyRequest.response.server:filter(and(or(in(\"dt.entity.service_method\",entitySelector(\"type(service_method),entityName(~\"/api/v2/setup/config/thread/[UUID]~\")\"))))):splitBy():percentile(90.0):auto:sort(value(percentile(90.0),descending)):limit(20))" + ], + "queries": [ + { + "enabled": true, + "filterBy": { + "criteria": [], + "filterOperator": "AND", + "nestedFilters": [ + { + "criteria": [ + { + "evaluator": "IN", + "value": "/api/v2/setup/config/thread/[UUID]" + } + ], + "entityAttribute": "entityName", + "filter": "dt.entity.service_method", + "filterOperator": "OR", + "filterType": "NAME", + "nestedFilters": [] + } + ] + }, + "id": "A", + "metric": "builtin:service.keyRequest.response.server", + "rate": "NONE", + "spaceAggregation": "PERCENTILE_90", + "splitBy": [], + "timeAggregation": "DEFAULT" + } + ], + "visualConfig": { + "axes": { + "xAxis": { + "displayName": "", + "visible": true + }, + "yAxes": [ + { + "defaultAxis": true, + "displayName": "", + "max": "AUTO", + "min": "AUTO", + "position": "LEFT", + "queryIds": [ + "A", + "" + ], + "visible": true + } + ] + }, + "global": { + "hideLegend": false + }, + "rules": [ + { + "matcher": "A:", + "properties": { + "color": "DEFAULT", + "seriesType": "LINE" + }, + "seriesOverrides": [] + } + ], + "singleValueSettings": { + "showSparkLine": true + }, + "thresholds": [ + { + "axisTarget": "LEFT", + "rules": [ + { + "color": "#dc172a", + "value": 800000 + }, + { + "color": "#f5d30f", + "value": 700000 + }, + { + "color": "#7dc540", + "value": 0 + } + ], + "visible": true + } + ], + "type": "SINGLE_VALUE" + } + }) + bounds { + height = 114 + left = 304 + top = 646 + width = 304 + } + } + tile { + name = "Latency - /inspection" + configured = true + custom_name = "Data explorer results" + tile_type = "DATA_EXPLORER" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false, + "metricExpressions": [ + "resolution=Inf\u0026(builtin:service.keyRequest.response.server:filter(and(or(in(\"dt.entity.service_method\",entitySelector(\"type(service_method),entityName(~\"/api/v2/thread/[UUID]/inspection~\")\"))))):splitBy():percentile(90.0):auto:sort(value(percentile(90.0),descending)):limit(20)):limit(100):names", + "resolution=null\u0026(builtin:service.keyRequest.response.server:filter(and(or(in(\"dt.entity.service_method\",entitySelector(\"type(service_method),entityName(~\"/api/v2/thread/[UUID]/inspection~\")\"))))):splitBy():percentile(90.0):auto:sort(value(percentile(90.0),descending)):limit(20))" + ], + "queries": [ + { + "enabled": true, + "filterBy": { + "criteria": [], + "filterOperator": "AND", + "nestedFilters": [ + { + "criteria": [ + { + "evaluator": "IN", + "value": "/api/v2/thread/[UUID]/inspection" + } + ], + "entityAttribute": "entityName", + "filter": "dt.entity.service_method", + "filterOperator": "OR", + "filterType": "NAME", + "nestedFilters": [] + } + ] + }, + "id": "A", + "metric": "builtin:service.keyRequest.response.server", + "rate": "NONE", + "spaceAggregation": "PERCENTILE_90", + "splitBy": [], + "timeAggregation": "DEFAULT" + } + ], + "visualConfig": { + "axes": { + "xAxis": { + "displayName": "", + "visible": true + }, + "yAxes": [ + { + "defaultAxis": true, + "displayName": "", + "max": "AUTO", + "min": "AUTO", + "position": "LEFT", + "queryIds": [ + "A", + "" + ], + "visible": true + } + ] + }, + "global": { + "hideLegend": false + }, + "rules": [ + { + "matcher": "A:", + "properties": { + "color": "DEFAULT", + "seriesType": "LINE" + }, + "seriesOverrides": [] + } + ], + "singleValueSettings": { + "showSparkLine": true + }, + "thresholds": [ + { + "axisTarget": "LEFT", + "rules": [ + { + "color": "#dc172a", + "value": 800000 + }, + { + "color": "#f5d30f", + "value": 700000 + }, + { + "color": "#7dc540", + "value": 0 + } + ], + "visible": true + } + ], + "type": "SINGLE_VALUE" + } + }) + bounds { + height = 114 + left = 608 + top = 646 + width = 304 + } + } + tile { + name = "Markdown" + configured = true + markdown = "#### [/recognize](https://xxu26128.live.dynatrace.com/#smgd;sci=SERVICE-8C3A7862B74A4401;servicefilter=0%1E10%11SERVICE_METHOD_GROUP-08E3D76999E877F8%109%11SERVICE_METHOD-243FA9E357C5334B%14%5C0api%5C0v2%5C0setup%5C0recognize;gtf=-2h;gf=-7384668182503674044;tab=RT;timeframe=custom1634916120000to1634916720000)" + tile_type = "MARKDOWN" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 0 + top = 266 + width = 304 + } + } + tile { + name = "Markdown" + configured = true + markdown = "#### [/config/thread](https://xxu26128.live.dynatrace.com/#smgd;sci=SERVICE-8C3A7862B74A4401;servicefilter=0%1E10%11SERVICE_METHOD_GROUP-08E3D76999E877F8%109%11SERVICE_METHOD-90CBEEC926F3F3FB%14%5C0api%5C0v2%5C0setup%5C0config%5C0thread%5C0%5BUUID%5D;gtf=-2h;gf=-7384668182503674044;tab=RT;timeframe=custom1634916120000to1634916720000)" + tile_type = "MARKDOWN" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 304 + top = 266 + width = 304 + } + } + tile { + name = "Markdown" + configured = true + markdown = "#### [/inspection](https://xxu26128.live.dynatrace.com/#smgd;sci=SERVICE-8C3A7862B74A4401;servicefilter=0%1E10%11SERVICE_METHOD_GROUP-08E3D76999E877F8%109%11SERVICE_METHOD-5686BB2B75A86287%14%5C0api%5C0v2%5C0thread%5C0%5BUUID%5D%5C0inspection;gtf=-2h;gf=-7384668182503674044;tab=RT;timeframe=custom1634916120000to1634916720000)" + tile_type = "MARKDOWN" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 608 + top = 266 + width = 304 + } + } +} \ No newline at end of file diff --git a/EMEA_PROD/management_zone/cd_dealer-comms-provider-service.tf b/EMEA_PROD/management_zone/cd_dealer-comms-provider-service.tf new file mode 100644 index 00000000..592645ec --- /dev/null +++ b/EMEA_PROD/management_zone/cd_dealer-comms-provider-service.tf @@ -0,0 +1,95 @@ +# DEFINE dynatrace_management_zone.CD_dealer-comms-provider-service.id = -7384668182503674044 +resource "dynatrace_management_zone" "CD_dealer-comms-provider-service" { + name = "CD_dealer-comms-provider-service" + rules { + type = "CLOUD_APPLICATION" + enabled = true + conditions { + key { + type = "STATIC" + attribute = "CLOUD_APPLICATION_NAME" + } + string { + case_sensitive = true + # negate = false + operator = "CONTAINS" + value = "dealer-comms-provider-service" + } + } + } + rules { + type = "CLOUD_APPLICATION_NAMESPACE" + enabled = true + conditions { + key { + type = "STATIC" + attribute = "CLOUD_APPLICATION_NAMESPACE_NAME" + } + string { + case_sensitive = true + # negate = false + operator = "CONTAINS" + value = "dealer-comms-provider-service" + } + } + } + rules { + type = "HOST" + enabled = true + conditions { + key { + type = "STATIC" + attribute = "HOST_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = "Component" + value = "dealer-comms-provider-service" + } + } + } + } + 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 = "dealer-comms-provider-service" + } + } + } + } + rules { + type = "SERVICE" + enabled = true + propagation_types = [ "SERVICE_TO_HOST_LIKE", "SERVICE_TO_PROCESS_GROUP_LIKE" ] + conditions { + key { + type = "STATIC" + attribute = "SERVICE_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = "Component" + value = "dealer-comms-provider-service" + } + } + } + } +} From 439156f36fc4b226d1e40f0cfc1dea1bf3aac5ca Mon Sep 17 00:00:00 2001 From: Patryk Gudalewicz Date: Wed, 1 Mar 2023 19:08:42 +0100 Subject: [PATCH 5/6] "Migrating from Monaco to Terraform for management zone: CD_dealer-comms-provider-service" --- .../cd_dealer-comms-provider-service_int.tf | 321 ++++++++++++++++++ .../cd_dealer-comms-provider-service_test.tf | 321 ++++++++++++++++++ .../cd_dealer-comms-provider-service.tf | 95 ++++++ 3 files changed, 737 insertions(+) create mode 100644 NA_PREPROD/dashboard/cd_dealer-comms-provider-service_int.tf create mode 100644 NA_PREPROD/dashboard/cd_dealer-comms-provider-service_test.tf create mode 100644 NA_PREPROD/management_zone/cd_dealer-comms-provider-service.tf diff --git a/NA_PREPROD/dashboard/cd_dealer-comms-provider-service_int.tf b/NA_PREPROD/dashboard/cd_dealer-comms-provider-service_int.tf new file mode 100644 index 00000000..2283f988 --- /dev/null +++ b/NA_PREPROD/dashboard/cd_dealer-comms-provider-service_int.tf @@ -0,0 +1,321 @@ +# DEFINE dynatrace_dashboard.CD_dealer-comms-provider-service_INT.id = e7d67366-9633-4fc8-a08d-bf463a531767 +data "dynatrace_management_zone" "CD_dealer-comms-provider-service_INT"{ name="CD_dealer-comms-provider-service" } +resource "dynatrace_dashboard" "CD_dealer-comms-provider-service_INT" { + dashboard_metadata { + name = "CD_dealer-comms-provider-service INT" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "dealer-comms-provider-service" ] + filter { + timeframe = "-24h to now" + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 304 + left = 38 + top = 228 + width = 1064 + } + filter_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:dealer-comms-provider-service", "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_dealer-comms-provider-service" + id = data.dynatrace_management_zone.CD_dealer-comms-provider-service_INT.id + } + } + } + tile { + name = "Overall Health" + configured = true + tile_type = "HEADER" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 0 + width = 1064 + } + } + 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:dealer-comms-provider-service", "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:dealer-comms-provider-service", "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:dealer-comms-provider-service", "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:dealer-comms-provider-service", "Environment:INT" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/NA_PREPROD/dashboard/cd_dealer-comms-provider-service_test.tf b/NA_PREPROD/dashboard/cd_dealer-comms-provider-service_test.tf new file mode 100644 index 00000000..56ae7043 --- /dev/null +++ b/NA_PREPROD/dashboard/cd_dealer-comms-provider-service_test.tf @@ -0,0 +1,321 @@ +# DEFINE dynatrace_dashboard.CD_dealer-comms-provider-service_TEST.id = a0d481e2-7ca4-48de-8271-8b27b9d8ad4f +data "dynatrace_management_zone" "CD_dealer-comms-provider-service_TEST"{ name="CD_dealer-comms-provider-service" } +resource "dynatrace_dashboard" "CD_dealer-comms-provider-service_TEST" { + dashboard_metadata { + name = "CD_dealer-comms-provider-service TEST" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "dealer-comms-provider-service" ] + filter { + timeframe = "-24h to now" + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 304 + left = 38 + top = 228 + width = 1064 + } + filter_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:dealer-comms-provider-service", "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_dealer-comms-provider-service" + id = data.dynatrace_management_zone.CD_dealer-comms-provider-service_TEST.id + } + } + } + tile { + name = "Overall Health" + configured = true + tile_type = "HEADER" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 0 + width = 1064 + } + } + 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:dealer-comms-provider-service", "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:dealer-comms-provider-service", "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:dealer-comms-provider-service", "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:dealer-comms-provider-service", "Environment:TEST" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/NA_PREPROD/management_zone/cd_dealer-comms-provider-service.tf b/NA_PREPROD/management_zone/cd_dealer-comms-provider-service.tf new file mode 100644 index 00000000..c104d0ec --- /dev/null +++ b/NA_PREPROD/management_zone/cd_dealer-comms-provider-service.tf @@ -0,0 +1,95 @@ +# DEFINE dynatrace_management_zone.CD_dealer-comms-provider-service.id = -3814326929866572288 +resource "dynatrace_management_zone" "CD_dealer-comms-provider-service" { + name = "CD_dealer-comms-provider-service" + rules { + type = "CLOUD_APPLICATION" + enabled = true + conditions { + key { + type = "STATIC" + attribute = "CLOUD_APPLICATION_NAME" + } + string { + case_sensitive = true + # negate = false + operator = "CONTAINS" + value = "dealer-comms-provider-service" + } + } + } + rules { + type = "CLOUD_APPLICATION_NAMESPACE" + enabled = true + conditions { + key { + type = "STATIC" + attribute = "CLOUD_APPLICATION_NAMESPACE_NAME" + } + string { + case_sensitive = true + # negate = false + operator = "CONTAINS" + value = "dealer-comms-provider-service" + } + } + } + rules { + type = "HOST" + enabled = true + conditions { + key { + type = "STATIC" + attribute = "HOST_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = "Component" + value = "dealer-comms-provider-service" + } + } + } + } + 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 = "dealer-comms-provider-service" + } + } + } + } + rules { + type = "SERVICE" + enabled = true + propagation_types = [ "SERVICE_TO_HOST_LIKE", "SERVICE_TO_PROCESS_GROUP_LIKE" ] + conditions { + key { + type = "STATIC" + attribute = "SERVICE_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = "Component" + value = "dealer-comms-provider-service" + } + } + } + } +} From 982bcf9dae2d8ed9f732433938986ca232498e34 Mon Sep 17 00:00:00 2001 From: Patryk Gudalewicz Date: Wed, 1 Mar 2023 19:11:50 +0100 Subject: [PATCH 6/6] "Migrating from Monaco to Terraform for management zone: CD_dealer-comms-provider-service" --- .../cd_dealer-comms-provider-service_prod.tf | 321 ++++++++++++++++++ .../cd_dealer-comms-provider-service.tf | 95 ++++++ 2 files changed, 416 insertions(+) create mode 100644 NA_PROD/dashboard/cd_dealer-comms-provider-service_prod.tf create mode 100644 NA_PROD/management_zone/cd_dealer-comms-provider-service.tf diff --git a/NA_PROD/dashboard/cd_dealer-comms-provider-service_prod.tf b/NA_PROD/dashboard/cd_dealer-comms-provider-service_prod.tf new file mode 100644 index 00000000..b2507250 --- /dev/null +++ b/NA_PROD/dashboard/cd_dealer-comms-provider-service_prod.tf @@ -0,0 +1,321 @@ +# DEFINE dynatrace_dashboard.CD_dealer-comms-provider-service_PROD.id = 9882e767-a202-4ed3-9bb6-6d971d9277b1 +data "dynatrace_management_zone" "CD_dealer-comms-provider-service_PROD"{ name="CD_dealer-comms-provider-service" } +resource "dynatrace_dashboard" "CD_dealer-comms-provider-service_PROD" { + dashboard_metadata { + name = "CD_dealer-comms-provider-service PROD" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "dealer-comms-provider-service" ] + filter { + timeframe = "-24h to now" + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 304 + left = 38 + top = 228 + width = 1064 + } + filter_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:dealer-comms-provider-service", "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_dealer-comms-provider-service" + id = data.dynatrace_management_zone.CD_dealer-comms-provider-service_PROD.id + } + } + } + tile { + name = "Overall Health" + configured = true + tile_type = "HEADER" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 0 + width = 1064 + } + } + 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:dealer-comms-provider-service", "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:dealer-comms-provider-service", "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:dealer-comms-provider-service", "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:dealer-comms-provider-service", "Environment:PROD" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/NA_PROD/management_zone/cd_dealer-comms-provider-service.tf b/NA_PROD/management_zone/cd_dealer-comms-provider-service.tf new file mode 100644 index 00000000..a6b3d3d8 --- /dev/null +++ b/NA_PROD/management_zone/cd_dealer-comms-provider-service.tf @@ -0,0 +1,95 @@ +# DEFINE dynatrace_management_zone.CD_dealer-comms-provider-service.id = 6482698883803106635 +resource "dynatrace_management_zone" "CD_dealer-comms-provider-service" { + name = "CD_dealer-comms-provider-service" + rules { + type = "CLOUD_APPLICATION" + enabled = true + conditions { + key { + type = "STATIC" + attribute = "CLOUD_APPLICATION_NAME" + } + string { + case_sensitive = true + # negate = false + operator = "CONTAINS" + value = "dealer-comms-provider-service" + } + } + } + rules { + type = "CLOUD_APPLICATION_NAMESPACE" + enabled = true + conditions { + key { + type = "STATIC" + attribute = "CLOUD_APPLICATION_NAMESPACE_NAME" + } + string { + case_sensitive = true + # negate = false + operator = "CONTAINS" + value = "dealer-comms-provider-service" + } + } + } + rules { + type = "HOST" + enabled = true + conditions { + key { + type = "STATIC" + attribute = "HOST_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = "Component" + value = "dealer-comms-provider-service" + } + } + } + } + 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 = "dealer-comms-provider-service" + } + } + } + } + rules { + type = "SERVICE" + enabled = true + propagation_types = [ "SERVICE_TO_HOST_LIKE", "SERVICE_TO_PROCESS_GROUP_LIKE" ] + conditions { + key { + type = "STATIC" + attribute = "SERVICE_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = "Component" + value = "dealer-comms-provider-service" + } + } + } + } +}