From d00b243df478be1ea7c4ceba20ac45df6d4ff7a3 Mon Sep 17 00:00:00 2001 From: Patryk Gudalewicz Date: Wed, 1 Mar 2023 18:46:22 +0100 Subject: [PATCH 1/6] "Migrating from Monaco to Terraform for management zone: CD_digital-key-composite-service" --- .../cd_digital-key-composite-service_int.tf | 38 +++ .../cd_digital-key-composite-service_int.tf | 294 ++++++++++++++++++ .../cd_digital-key-composite-service_test.tf | 294 ++++++++++++++++++ .../cd_digital-key-composite-service.tf | 95 ++++++ 4 files changed, 721 insertions(+) create mode 100644 CN_PREPROD/alerting/cd_digital-key-composite-service_int.tf create mode 100644 CN_PREPROD/dashboard/cd_digital-key-composite-service_int.tf create mode 100644 CN_PREPROD/dashboard/cd_digital-key-composite-service_test.tf create mode 100644 CN_PREPROD/management_zone/cd_digital-key-composite-service.tf diff --git a/CN_PREPROD/alerting/cd_digital-key-composite-service_int.tf b/CN_PREPROD/alerting/cd_digital-key-composite-service_int.tf new file mode 100644 index 00000000..7606bccd --- /dev/null +++ b/CN_PREPROD/alerting/cd_digital-key-composite-service_int.tf @@ -0,0 +1,38 @@ +# DEFINE dynatrace_alerting.CD_digital-key-composite-service_INT.id = vu9U3hXa3q0AAAABABhidWlsdGluOmFsZXJ0aW5nLnByb2ZpbGUABnRlbmFudAAGdGVuYW50ACQ4MGY5YTM5OC00NWY3LTQ0ZTktOTA2ZS1hODE3Njg0OGM4Mma-71TeFdrerQ +data "dynatrace_management_zone" "CD_digital-key-composite-service_INT"{ name="CD_digital-key-composite-service" } +resource "dynatrace_alerting" "CD_digital-key-composite-service_INT" { + name = "CD_digital-key-composite-service INT" + management_zone = data.dynatrace_management_zone.CD_digital-key-composite-service_INT.id + rules { + rule { + delay_in_minutes = 0 + include_mode = "INCLUDE_ALL" + severity_level = "AVAILABILITY" + tags = [ "Environment:INT", "Component:digital-key-composite-service" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ALL" + severity_level = "CUSTOM_ALERT" + tags = [ "Environment:INT", "Component:digital-key-composite-service" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ALL" + severity_level = "ERRORS" + tags = [ "Environment:INT", "Component:digital-key-composite-service" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ALL" + severity_level = "PERFORMANCE" + tags = [ "Environment:INT", "Component:digital-key-composite-service" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ALL" + severity_level = "RESOURCE_CONTENTION" + tags = [ "Environment:INT", "Component:digital-key-composite-service" ] + } + } +} \ No newline at end of file diff --git a/CN_PREPROD/dashboard/cd_digital-key-composite-service_int.tf b/CN_PREPROD/dashboard/cd_digital-key-composite-service_int.tf new file mode 100644 index 00000000..58273faf --- /dev/null +++ b/CN_PREPROD/dashboard/cd_digital-key-composite-service_int.tf @@ -0,0 +1,294 @@ +# DEFINE dynatrace_dashboard.CD_digital-key-composite-service_INT.id = 38efa7ec-2101-450b-9a59-df5b407ec92f +data "dynatrace_management_zone" "CD_digital-key-composite-service_INT"{ name="CD_digital-key-composite-service" } +resource "dynatrace_dashboard" "CD_digital-key-composite-service_INT" { + dashboard_metadata { + name = "CD_digital-key-composite-service INT" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "digital-key-composite-service" ] + filter { + timeframe = "-24h to now" + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + bounds { + height = 304 + left = 38 + top = 228 + width = 1064 + } + filter_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", "Component:digital-key-composite-service" ] + } + } + } + } + } + tile { + name = "Problems" + configured = true + tile_type = "OPEN_PROBLEMS" + bounds { + height = 152 + left = 950 + top = 38 + width = 152 + } + filter { + management_zone { + name = "CD_digital-key-composite-service" + id = data.dynatrace_management_zone.CD_digital-key-composite-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 = [ "Environment:INT", "Component:digital-key-composite-service" ] + } + } + } + } + } + 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 = [ "Environment:INT", "Component:digital-key-composite-service" ] + } + } + } + } + } + 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 = [ "Environment:INT", "Component:digital-key-composite-service" ] + } + } + } + } + } + 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 = [ "Environment:INT", "Component:digital-key-composite-service" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/CN_PREPROD/dashboard/cd_digital-key-composite-service_test.tf b/CN_PREPROD/dashboard/cd_digital-key-composite-service_test.tf new file mode 100644 index 00000000..171fe68b --- /dev/null +++ b/CN_PREPROD/dashboard/cd_digital-key-composite-service_test.tf @@ -0,0 +1,294 @@ +# DEFINE dynatrace_dashboard.CD_digital-key-composite-service_TEST.id = a59051ae-591d-4ea4-baf4-476a2ece7820 +data "dynatrace_management_zone" "CD_digital-key-composite-service_TEST"{ name="CD_digital-key-composite-service" } +resource "dynatrace_dashboard" "CD_digital-key-composite-service_TEST" { + dashboard_metadata { + name = "CD_digital-key-composite-service TEST" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "digital-key-composite-service" ] + filter { + timeframe = "-24h to now" + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + bounds { + height = 304 + left = 38 + top = 228 + width = 1064 + } + filter_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:digital-key-composite-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_digital-key-composite-service" + id = data.dynatrace_management_zone.CD_digital-key-composite-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:digital-key-composite-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:digital-key-composite-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:digital-key-composite-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:digital-key-composite-service", "Environment:TEST" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/CN_PREPROD/management_zone/cd_digital-key-composite-service.tf b/CN_PREPROD/management_zone/cd_digital-key-composite-service.tf new file mode 100644 index 00000000..286f5c1a --- /dev/null +++ b/CN_PREPROD/management_zone/cd_digital-key-composite-service.tf @@ -0,0 +1,95 @@ +# DEFINE dynatrace_management_zone.CD_digital-key-composite-service.id = 5614613910081667941 +resource "dynatrace_management_zone" "CD_digital-key-composite-service" { + name = "CD_digital-key-composite-service" + rules { + type = "CLOUD_APPLICATION" + enabled = true + conditions { + key { + type = "STATIC" + attribute = "CLOUD_APPLICATION_NAME" + } + string { + case_sensitive = true + # negate = false + operator = "CONTAINS" + value = "digital-key-composite-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 = "digital-key-composite-service" + } + } + } + rules { + type = "HOST" + enabled = true + conditions { + key { + type = "STATIC" + attribute = "HOST_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = "Component" + value = "digital-key-composite-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 = "digital-key-composite-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 = "digital-key-composite-service" + } + } + } + } +} From b7518823020fb5a1ec30282557de41a4990451d4 Mon Sep 17 00:00:00 2001 From: Patryk Gudalewicz Date: Wed, 1 Mar 2023 18:51:55 +0100 Subject: [PATCH 2/6] "Migrating from Monaco to Terraform for management zone: CD_digital-key-composite-service" --- .../cd_digital-key-composite-service_e2e.tf | 38 +++ .../cd_digital-key-composite-service_prod.tf | 38 +++ .../cd_digital-key-composite-service_prod.tf | 294 ++++++++++++++++++ .../cd_digital-key-composite-service.tf | 95 ++++++ 4 files changed, 465 insertions(+) create mode 100644 CN_PROD/alerting/cd_digital-key-composite-service_e2e.tf create mode 100644 CN_PROD/alerting/cd_digital-key-composite-service_prod.tf create mode 100644 CN_PROD/dashboard/cd_digital-key-composite-service_prod.tf create mode 100644 CN_PROD/management_zone/cd_digital-key-composite-service.tf diff --git a/CN_PROD/alerting/cd_digital-key-composite-service_e2e.tf b/CN_PROD/alerting/cd_digital-key-composite-service_e2e.tf new file mode 100644 index 00000000..d58c8048 --- /dev/null +++ b/CN_PROD/alerting/cd_digital-key-composite-service_e2e.tf @@ -0,0 +1,38 @@ +# DEFINE dynatrace_alerting.CD_digital-key-composite-service_E2E.id = vu9U3hXa3q0AAAABABhidWlsdGluOmFsZXJ0aW5nLnByb2ZpbGUABnRlbmFudAAGdGVuYW50ACQxMGM2NmQ4YS1jNGNhLTRiYzctOTNiMS1hODk2YjRkZmFkMDW-71TeFdrerQ +data "dynatrace_management_zone" "CD_digital-key-composite-service_E2E"{ name="CD_digital-key-composite-service" } +resource "dynatrace_alerting" "CD_digital-key-composite-service_E2E" { + name = "CD_digital-key-composite-service E2E" + management_zone = data.dynatrace_management_zone.CD_digital-key-composite-service_E2E.id + rules { + rule { + delay_in_minutes = 0 + include_mode = "INCLUDE_ALL" + severity_level = "AVAILABILITY" + tags = [ "Environment:E2E", "Component:digital-key-composite-service" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ALL" + severity_level = "CUSTOM_ALERT" + tags = [ "Environment:E2E", "Component:digital-key-composite-service" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ALL" + severity_level = "ERRORS" + tags = [ "Environment:E2E", "Component:digital-key-composite-service" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ALL" + severity_level = "PERFORMANCE" + tags = [ "Environment:E2E", "Component:digital-key-composite-service" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ALL" + severity_level = "RESOURCE_CONTENTION" + tags = [ "Environment:E2E", "Component:digital-key-composite-service" ] + } + } +} \ No newline at end of file diff --git a/CN_PROD/alerting/cd_digital-key-composite-service_prod.tf b/CN_PROD/alerting/cd_digital-key-composite-service_prod.tf new file mode 100644 index 00000000..8bb998e7 --- /dev/null +++ b/CN_PROD/alerting/cd_digital-key-composite-service_prod.tf @@ -0,0 +1,38 @@ +# DEFINE dynatrace_alerting.CD_digital-key-composite-service_PROD.id = vu9U3hXa3q0AAAABABhidWlsdGluOmFsZXJ0aW5nLnByb2ZpbGUABnRlbmFudAAGdGVuYW50ACQ1MDg5OGFlNy0xNzgzLTQ2ZGEtODE4NC02NmIyMDIyMGMxMji-71TeFdrerQ +data "dynatrace_management_zone" "CD_digital-key-composite-service_PROD"{ name="CD_digital-key-composite-service" } +resource "dynatrace_alerting" "CD_digital-key-composite-service_PROD" { + name = "CD_digital-key-composite-service PROD" + management_zone = data.dynatrace_management_zone.CD_digital-key-composite-service_PROD.id + rules { + rule { + delay_in_minutes = 0 + include_mode = "INCLUDE_ALL" + severity_level = "AVAILABILITY" + tags = [ "Environment:PROD", "Component:digital-key-composite-service" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ALL" + severity_level = "CUSTOM_ALERT" + tags = [ "Environment:PROD", "Component:digital-key-composite-service" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ALL" + severity_level = "ERRORS" + tags = [ "Environment:PROD", "Component:digital-key-composite-service" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ALL" + severity_level = "PERFORMANCE" + tags = [ "Environment:PROD", "Component:digital-key-composite-service" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ALL" + severity_level = "RESOURCE_CONTENTION" + tags = [ "Environment:PROD", "Component:digital-key-composite-service" ] + } + } +} \ No newline at end of file diff --git a/CN_PROD/dashboard/cd_digital-key-composite-service_prod.tf b/CN_PROD/dashboard/cd_digital-key-composite-service_prod.tf new file mode 100644 index 00000000..e03f5a87 --- /dev/null +++ b/CN_PROD/dashboard/cd_digital-key-composite-service_prod.tf @@ -0,0 +1,294 @@ +# DEFINE dynatrace_dashboard.CD_digital-key-composite-service_PROD.id = 0fedf9c7-9e07-46fb-ab38-4339f24dfcf3 +data "dynatrace_management_zone" "CD_digital-key-composite-service_PROD"{ name="CD_digital-key-composite-service" } +resource "dynatrace_dashboard" "CD_digital-key-composite-service_PROD" { + dashboard_metadata { + name = "CD_digital-key-composite-service PROD" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "digital-key-composite-service" ] + filter { + timeframe = "-24h to now" + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + bounds { + height = 304 + left = 38 + top = 228 + width = 1064 + } + filter_config { + type = "MIXED" + custom_name = "Failure rate (HTTP 4xx/5xx errors)" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#ff0000" + key = "nullbuiltin:service.errors.fivexx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956393463 + } + config { + custom_color = "#fff29a" + key = "nullbuiltin:service.errors.fourxx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956441725 + } + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fourxx.rate" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fivexx.rate" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:PROD", "Component:digital-key-composite-service" ] + } + } + } + } + } + tile { + name = "Problems" + configured = true + tile_type = "OPEN_PROBLEMS" + bounds { + height = 152 + left = 950 + top = 38 + width = 152 + } + filter { + management_zone { + name = "CD_digital-key-composite-service" + id = data.dynatrace_management_zone.CD_digital-key-composite-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 = [ "Environment:PROD", "Component:digital-key-composite-service" ] + } + } + } + } + } + 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 = [ "Environment:PROD", "Component:digital-key-composite-service" ] + } + } + } + } + } + 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 = [ "Environment:PROD", "Component:digital-key-composite-service" ] + } + } + } + } + } + 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 = [ "Environment:PROD", "Component:digital-key-composite-service" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/CN_PROD/management_zone/cd_digital-key-composite-service.tf b/CN_PROD/management_zone/cd_digital-key-composite-service.tf new file mode 100644 index 00000000..0ec9841e --- /dev/null +++ b/CN_PROD/management_zone/cd_digital-key-composite-service.tf @@ -0,0 +1,95 @@ +# DEFINE dynatrace_management_zone.CD_digital-key-composite-service.id = -3714943389097009239 +resource "dynatrace_management_zone" "CD_digital-key-composite-service" { + name = "CD_digital-key-composite-service" + rules { + type = "CLOUD_APPLICATION" + enabled = true + conditions { + key { + type = "STATIC" + attribute = "CLOUD_APPLICATION_NAME" + } + string { + case_sensitive = true + # negate = false + operator = "CONTAINS" + value = "digital-key-composite-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 = "digital-key-composite-service" + } + } + } + rules { + type = "HOST" + enabled = true + conditions { + key { + type = "STATIC" + attribute = "HOST_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = "Component" + value = "digital-key-composite-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 = "digital-key-composite-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 = "digital-key-composite-service" + } + } + } + } +} From f7c3fdc135df336f521d0180a6801e7049fc4186 Mon Sep 17 00:00:00 2001 From: Patryk Gudalewicz Date: Wed, 1 Mar 2023 18:56:44 +0100 Subject: [PATCH 3/6] "Migrating from Monaco to Terraform for management zone: CD_digital-key-composite-service" --- .../cd_digital-key-composite-service_int.tf | 357 ++++++++++++++++++ .../cd_digital-key-composite-service_test.tf | 357 ++++++++++++++++++ .../cd_digital-key-composite-service.tf | 143 +++++++ 3 files changed, 857 insertions(+) create mode 100644 EMEA_PREPROD/dashboard/cd_digital-key-composite-service_int.tf create mode 100644 EMEA_PREPROD/dashboard/cd_digital-key-composite-service_test.tf create mode 100644 EMEA_PREPROD/management_zone/cd_digital-key-composite-service.tf diff --git a/EMEA_PREPROD/dashboard/cd_digital-key-composite-service_int.tf b/EMEA_PREPROD/dashboard/cd_digital-key-composite-service_int.tf new file mode 100644 index 00000000..719b968e --- /dev/null +++ b/EMEA_PREPROD/dashboard/cd_digital-key-composite-service_int.tf @@ -0,0 +1,357 @@ +# DEFINE dynatrace_dashboard.CD_digital-key-composite-service_INT.id = ad6d6eee-f356-490d-87e9-af5637629bd5 +data "dynatrace_management_zone" "CD_digital-key-composite-service_INT"{ name="CD_digital-key-composite-service" } +resource "dynatrace_dashboard" "CD_digital-key-composite-service_INT" { + dashboard_metadata { + name = "CD_digital-key-composite-service INT" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "CD_digital-key-composite-service" ] + filter { + timeframe = "-24h to now" + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 304 + left = 38 + top = 228 + width = 1064 + } + filter { + management_zone { + name = "CD_digital-key-composite-service" + id = data.dynatrace_management_zone.CD_digital-key-composite-service_INT.id + } + } + filter_config { + type = "MIXED" + custom_name = "Failure rate (HTTP 4xx/5xx errors)" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#ff0000" + key = "nullbuiltin:service.errors.fivexx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956393463 + } + config { + custom_color = "#fff29a" + key = "nullbuiltin:service.errors.fourxx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956441725 + } + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fourxx.rate" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fivexx.rate" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:INT" ] + } + } + } + } + } + tile { + name = "Problems" + configured = true + tile_type = "OPEN_PROBLEMS" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 950 + top = 38 + width = 152 + } + filter { + management_zone { + name = "CD_digital-key-composite-service" + id = data.dynatrace_management_zone.CD_digital-key-composite-service_INT.id + } + } + } + tile { + name = "Overall Health" + configured = true + tile_type = "HEADER" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 0 + width = 1064 + } + filter { + management_zone { + name = "CD_digital-key-composite-service" + id = data.dynatrace_management_zone.CD_digital-key-composite-service_INT.id + } + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 532 + width = 1064 + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 304 + left = 38 + top = 570 + width = 1064 + } + filter { + management_zone { + name = "CD_digital-key-composite-service" + id = data.dynatrace_management_zone.CD_digital-key-composite-service_INT.id + } + } + filter_config { + type = "MIXED" + custom_name = "Response time, Request Count and Number of Errors" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#008cdb" + key = "nullbuiltin:service.requestCount.total|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275720776 + } + config { + custom_color = "#b4e5f9" + key = "nullbuiltin:service.response.time|AVG|TOTAL|LINE|SERVICE" + last_modified = 1595275686773 + } + config { + custom_color = "#ef651f" + key = "nullbuiltin:service.errors.total.count|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275955999 + } + } + series { + type = "LINE" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.response.time" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.requestCount.total" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.total.count" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:INT" ] + } + } + } + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 190 + width = 1064 + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "DATABASES_OVERVIEW" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 646 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_digital-key-composite-service" + id = data.dynatrace_management_zone.CD_digital-key-composite-service_INT.id + } + } + filter_config { + type = "DATABASE" + custom_name = "Databases" + default_name = "Databases" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "DATABASE" + match { + key = "AUTO_TAGS" + values = [ "Environment:INT" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "SERVICES" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 342 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_digital-key-composite-service" + id = data.dynatrace_management_zone.CD_digital-key-composite-service_INT.id + } + } + filter_config { + type = "SERVICE" + custom_name = "Services" + default_name = "Services" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:INT" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "HOSTS" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 38 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_digital-key-composite-service" + id = data.dynatrace_management_zone.CD_digital-key-composite-service_INT.id + } + } + filter_config { + type = "HOST" + custom_name = "Hosts" + default_name = "Hosts" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "HOST" + match { + key = "AUTO_TAGS" + values = [ "Environment:INT" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/EMEA_PREPROD/dashboard/cd_digital-key-composite-service_test.tf b/EMEA_PREPROD/dashboard/cd_digital-key-composite-service_test.tf new file mode 100644 index 00000000..c0b4fa25 --- /dev/null +++ b/EMEA_PREPROD/dashboard/cd_digital-key-composite-service_test.tf @@ -0,0 +1,357 @@ +# DEFINE dynatrace_dashboard.CD_digital-key-composite-service_TEST.id = 0533841d-322c-4a5b-a07b-6171ab7561af +data "dynatrace_management_zone" "CD_digital-key-composite-service_TEST"{ name="CD_digital-key-composite-service" } +resource "dynatrace_dashboard" "CD_digital-key-composite-service_TEST" { + dashboard_metadata { + name = "CD_digital-key-composite-service TEST" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "CD_digital-key-composite-service" ] + filter { + timeframe = "-24h to now" + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 304 + left = 38 + top = 228 + width = 1064 + } + filter { + management_zone { + name = "CD_digital-key-composite-service" + id = data.dynatrace_management_zone.CD_digital-key-composite-service_TEST.id + } + } + filter_config { + type = "MIXED" + custom_name = "Failure rate (HTTP 4xx/5xx errors)" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#ff0000" + key = "nullbuiltin:service.errors.fivexx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956393463 + } + config { + custom_color = "#fff29a" + key = "nullbuiltin:service.errors.fourxx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956441725 + } + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fourxx.rate" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fivexx.rate" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:TEST" ] + } + } + } + } + } + tile { + name = "Problems" + configured = true + tile_type = "OPEN_PROBLEMS" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 950 + top = 38 + width = 152 + } + filter { + management_zone { + name = "CD_digital-key-composite-service" + id = data.dynatrace_management_zone.CD_digital-key-composite-service_TEST.id + } + } + } + tile { + name = "Overall Health" + configured = true + tile_type = "HEADER" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 0 + width = 1064 + } + filter { + management_zone { + name = "CD_digital-key-composite-service" + id = data.dynatrace_management_zone.CD_digital-key-composite-service_TEST.id + } + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 532 + width = 1064 + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 304 + left = 38 + top = 570 + width = 1064 + } + filter { + management_zone { + name = "CD_digital-key-composite-service" + id = data.dynatrace_management_zone.CD_digital-key-composite-service_TEST.id + } + } + filter_config { + type = "MIXED" + custom_name = "Response time, Request Count and Number of Errors" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#008cdb" + key = "nullbuiltin:service.requestCount.total|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275720776 + } + config { + custom_color = "#b4e5f9" + key = "nullbuiltin:service.response.time|AVG|TOTAL|LINE|SERVICE" + last_modified = 1595275686773 + } + config { + custom_color = "#ef651f" + key = "nullbuiltin:service.errors.total.count|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275955999 + } + } + series { + type = "LINE" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.response.time" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.requestCount.total" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.total.count" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:TEST" ] + } + } + } + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 190 + width = 1064 + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "DATABASES_OVERVIEW" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 646 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_digital-key-composite-service" + id = data.dynatrace_management_zone.CD_digital-key-composite-service_TEST.id + } + } + filter_config { + type = "DATABASE" + custom_name = "Databases" + default_name = "Databases" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "DATABASE" + match { + key = "AUTO_TAGS" + values = [ "Environment:TEST" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "SERVICES" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 342 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_digital-key-composite-service" + id = data.dynatrace_management_zone.CD_digital-key-composite-service_TEST.id + } + } + filter_config { + type = "SERVICE" + custom_name = "Services" + default_name = "Services" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:TEST" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "HOSTS" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 38 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_digital-key-composite-service" + id = data.dynatrace_management_zone.CD_digital-key-composite-service_TEST.id + } + } + filter_config { + type = "HOST" + custom_name = "Hosts" + default_name = "Hosts" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "HOST" + match { + key = "AUTO_TAGS" + values = [ "Environment:TEST" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/EMEA_PREPROD/management_zone/cd_digital-key-composite-service.tf b/EMEA_PREPROD/management_zone/cd_digital-key-composite-service.tf new file mode 100644 index 00000000..d2c9bd2a --- /dev/null +++ b/EMEA_PREPROD/management_zone/cd_digital-key-composite-service.tf @@ -0,0 +1,143 @@ +# DEFINE dynatrace_management_zone.CD_digital-key-composite-service.id = 6999836123334365199 +resource "dynatrace_management_zone" "CD_digital-key-composite-service" { + name = "CD_digital-key-composite-service" + entity_selector_based_rule { + # enabled = false + selector = "type(PROCESS_GROUP_INSTANCE),tag('msid:mobile20-DKC')" + } + entity_selector_based_rule { + # enabled = false + selector = "type(SERVICE),databaseName.exists(),toRelationship.calls(type(SERVICE),tag('msid:mobile20-DKC'))" + } + entity_selector_based_rule { + # enabled = false + selector = "type(SERVICE),databaseName.exists(),toRelationship.calls(type(SERVICE),tag('ms-id:mobile20-DKC'))" + } + entity_selector_based_rule { + # enabled = false + selector = "type(HOST),tag('msid:mobile20-DKC')" + } + entity_selector_based_rule { + # enabled = false + selector = "type(Service),tag('msid:mobile20-DKC')" + } + entity_selector_based_rule { + # enabled = false + selector = "type(HOST),tag('ms-id:mobile20-DKC')" + } + entity_selector_based_rule { + # enabled = false + selector = "type(PROCESS_GROUP_INSTANCE),tag('ms-id:mobile20-DKC')" + } + entity_selector_based_rule { + enabled = true + selector = "type(Service),tag(\"ms-id:mobile20-DKC\")" + } + entity_selector_based_rule { + enabled = true + selector = "type(SERVICE),databaseName.exists(),toRelationship.calls(type(SERVICE),tag(\"ms-id:mobile20-DKC\"))" + } + entity_selector_based_rule { + enabled = true + selector = "type(HOST),tag(\"ms-id:mobile20-DKC\")" + } + entity_selector_based_rule { + # enabled = false + selector = "type(Service),tag('ms-id:mobile20-DKC')" + } + entity_selector_based_rule { + enabled = true + selector = "type(PROCESS_GROUP_INSTANCE),tag(\"ms-id:mobile20-DKC\")" + } + rules { + type = "CLOUD_APPLICATION" + # enabled = false + conditions { + key { + type = "STATIC" + attribute = "CLOUD_APPLICATION_NAME" + } + string { + case_sensitive = true + # negate = false + operator = "CONTAINS" + value = "digital-key-composite-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 = "digital-key-composite-service" + } + } + } + rules { + type = "HOST" + # enabled = false + conditions { + key { + type = "STATIC" + attribute = "HOST_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = "Component" + value = "digital-key-composite-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 = "digital-key-composite-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 = "digital-key-composite-service" + } + } + } + } +} From 1e172a74756ec612cbaff42211ea8b4a48848895 Mon Sep 17 00:00:00 2001 From: Patryk Gudalewicz Date: Wed, 1 Mar 2023 18:59:47 +0100 Subject: [PATCH 4/6] "Migrating from Monaco to Terraform for management zone: CD_digital-key-composite-service" --- .../cd_digital-key-composite-service_prod.tf | 38 +++ .../cd_digital-key-composite-service_e2e.tf | 321 ++++++++++++++++++ .../cd_digital-key-composite-service_prod.tf | 321 ++++++++++++++++++ .../cd_digital-key-composite-service.tf | 95 ++++++ 4 files changed, 775 insertions(+) create mode 100644 EMEA_PROD/alerting/cd_digital-key-composite-service_prod.tf create mode 100644 EMEA_PROD/dashboard/cd_digital-key-composite-service_e2e.tf create mode 100644 EMEA_PROD/dashboard/cd_digital-key-composite-service_prod.tf create mode 100644 EMEA_PROD/management_zone/cd_digital-key-composite-service.tf diff --git a/EMEA_PROD/alerting/cd_digital-key-composite-service_prod.tf b/EMEA_PROD/alerting/cd_digital-key-composite-service_prod.tf new file mode 100644 index 00000000..41b6667b --- /dev/null +++ b/EMEA_PROD/alerting/cd_digital-key-composite-service_prod.tf @@ -0,0 +1,38 @@ +# DEFINE dynatrace_alerting.CD_digital-key-composite-service_PROD.id = vu9U3hXa3q0AAAABABhidWlsdGluOmFsZXJ0aW5nLnByb2ZpbGUABnRlbmFudAAGdGVuYW50ACRjY2ZmN2U1OC00MTBmLTQ3YjMtOTc0YS0wYjk0ZDEzODNlOGG-71TeFdrerQ +data "dynatrace_management_zone" "CD_digital-key-composite-service_PROD"{ name="CD_digital-key-composite-service" } +resource "dynatrace_alerting" "CD_digital-key-composite-service_PROD" { + name = "CD_digital-key-composite-service PROD" + management_zone = data.dynatrace_management_zone.CD_digital-key-composite-service_PROD.id + rules { + rule { + delay_in_minutes = 0 + include_mode = "INCLUDE_ALL" + severity_level = "AVAILABILITY" + tags = [ "Environment:PROD", "Component:digital-key-composite-service" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ALL" + severity_level = "CUSTOM_ALERT" + tags = [ "Environment:PROD", "Component:digital-key-composite-service" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ALL" + severity_level = "ERRORS" + tags = [ "Environment:PROD", "Component:digital-key-composite-service" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ALL" + severity_level = "PERFORMANCE" + tags = [ "Environment:PROD", "Component:digital-key-composite-service" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ALL" + severity_level = "RESOURCE_CONTENTION" + tags = [ "Environment:PROD", "Component:digital-key-composite-service" ] + } + } +} \ No newline at end of file diff --git a/EMEA_PROD/dashboard/cd_digital-key-composite-service_e2e.tf b/EMEA_PROD/dashboard/cd_digital-key-composite-service_e2e.tf new file mode 100644 index 00000000..5006e162 --- /dev/null +++ b/EMEA_PROD/dashboard/cd_digital-key-composite-service_e2e.tf @@ -0,0 +1,321 @@ +# DEFINE dynatrace_dashboard.CD_digital-key-composite-service_E2E.id = 2f6e05b4-9235-4f58-b2af-c8244cc42446 +data "dynatrace_management_zone" "CD_digital-key-composite-service_E2E"{ name="CD_digital-key-composite-service" } +resource "dynatrace_dashboard" "CD_digital-key-composite-service_E2E" { + dashboard_metadata { + name = "CD_digital-key-composite-service E2E" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "digital-key-composite-service" ] + filter { + timeframe = "-24h to now" + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 304 + left = 38 + top = 228 + width = 1064 + } + filter_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:digital-key-composite-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_digital-key-composite-service" + id = data.dynatrace_management_zone.CD_digital-key-composite-service_E2E.id + } + } + } + tile { + name = "Overall Health" + configured = true + tile_type = "HEADER" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 0 + width = 1064 + } + } + 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:digital-key-composite-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:digital-key-composite-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:digital-key-composite-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:digital-key-composite-service" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/EMEA_PROD/dashboard/cd_digital-key-composite-service_prod.tf b/EMEA_PROD/dashboard/cd_digital-key-composite-service_prod.tf new file mode 100644 index 00000000..60012eb5 --- /dev/null +++ b/EMEA_PROD/dashboard/cd_digital-key-composite-service_prod.tf @@ -0,0 +1,321 @@ +# DEFINE dynatrace_dashboard.CD_digital-key-composite-service_PROD.id = b89dd61e-87e0-4821-b4d9-1e769e76a1b8 +data "dynatrace_management_zone" "CD_digital-key-composite-service_PROD"{ name="CD_digital-key-composite-service" } +resource "dynatrace_dashboard" "CD_digital-key-composite-service_PROD" { + dashboard_metadata { + name = "CD_digital-key-composite-service PROD" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "digital-key-composite-service" ] + filter { + timeframe = "-24h to now" + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 304 + left = 38 + top = 228 + width = 1064 + } + filter_config { + type = "MIXED" + custom_name = "Failure rate (HTTP 4xx/5xx errors)" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#ff0000" + key = "nullbuiltin:service.errors.fivexx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956393463 + } + config { + custom_color = "#fff29a" + key = "nullbuiltin:service.errors.fourxx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956441725 + } + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fourxx.rate" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fivexx.rate" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:PROD", "Component:digital-key-composite-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_digital-key-composite-service" + id = data.dynatrace_management_zone.CD_digital-key-composite-service_PROD.id + } + } + } + tile { + name = "Overall Health" + configured = true + tile_type = "HEADER" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 0 + width = 1064 + } + } + 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:PROD", "Component:digital-key-composite-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:PROD", "Component:digital-key-composite-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:PROD", "Component:digital-key-composite-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:PROD", "Component:digital-key-composite-service" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/EMEA_PROD/management_zone/cd_digital-key-composite-service.tf b/EMEA_PROD/management_zone/cd_digital-key-composite-service.tf new file mode 100644 index 00000000..14fdbe6f --- /dev/null +++ b/EMEA_PROD/management_zone/cd_digital-key-composite-service.tf @@ -0,0 +1,95 @@ +# DEFINE dynatrace_management_zone.CD_digital-key-composite-service.id = 2693367897048369138 +resource "dynatrace_management_zone" "CD_digital-key-composite-service" { + name = "CD_digital-key-composite-service" + rules { + type = "CLOUD_APPLICATION" + enabled = true + conditions { + key { + type = "STATIC" + attribute = "CLOUD_APPLICATION_NAME" + } + string { + case_sensitive = true + # negate = false + operator = "CONTAINS" + value = "digital-key-composite-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 = "digital-key-composite-service" + } + } + } + rules { + type = "HOST" + enabled = true + conditions { + key { + type = "STATIC" + attribute = "HOST_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = "Component" + value = "digital-key-composite-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 = "digital-key-composite-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 = "digital-key-composite-service" + } + } + } + } +} From f48a8e3d885ea4c1438927a8e82b059aa5f0095b Mon Sep 17 00:00:00 2001 From: Patryk Gudalewicz Date: Wed, 1 Mar 2023 19:08:46 +0100 Subject: [PATCH 5/6] "Migrating from Monaco to Terraform for management zone: CD_digital-key-composite-service" --- .../cd_digital-key-composite-service_int.tf | 321 ++++++++++++++++++ .../cd_digital-key-composite-service_test.tf | 321 ++++++++++++++++++ .../cd_digital-key-composite-service.tf | 95 ++++++ 3 files changed, 737 insertions(+) create mode 100644 NA_PREPROD/dashboard/cd_digital-key-composite-service_int.tf create mode 100644 NA_PREPROD/dashboard/cd_digital-key-composite-service_test.tf create mode 100644 NA_PREPROD/management_zone/cd_digital-key-composite-service.tf diff --git a/NA_PREPROD/dashboard/cd_digital-key-composite-service_int.tf b/NA_PREPROD/dashboard/cd_digital-key-composite-service_int.tf new file mode 100644 index 00000000..361c5b83 --- /dev/null +++ b/NA_PREPROD/dashboard/cd_digital-key-composite-service_int.tf @@ -0,0 +1,321 @@ +# DEFINE dynatrace_dashboard.CD_digital-key-composite-service_INT.id = 90dd7a23-782e-4969-8ddf-ae4caac6890a +data "dynatrace_management_zone" "CD_digital-key-composite-service_INT"{ name="CD_digital-key-composite-service" } +resource "dynatrace_dashboard" "CD_digital-key-composite-service_INT" { + dashboard_metadata { + name = "CD_digital-key-composite-service INT" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "digital-key-composite-service" ] + filter { + timeframe = "-24h to now" + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 304 + left = 38 + top = 228 + width = 1064 + } + filter_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", "Component:digital-key-composite-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_digital-key-composite-service" + id = data.dynatrace_management_zone.CD_digital-key-composite-service_INT.id + } + } + } + tile { + name = "Overall Health" + configured = true + tile_type = "HEADER" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 0 + width = 1064 + } + } + 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:INT", "Component:digital-key-composite-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:INT", "Component:digital-key-composite-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:INT", "Component:digital-key-composite-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:INT", "Component:digital-key-composite-service" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/NA_PREPROD/dashboard/cd_digital-key-composite-service_test.tf b/NA_PREPROD/dashboard/cd_digital-key-composite-service_test.tf new file mode 100644 index 00000000..41c53dd8 --- /dev/null +++ b/NA_PREPROD/dashboard/cd_digital-key-composite-service_test.tf @@ -0,0 +1,321 @@ +# DEFINE dynatrace_dashboard.CD_digital-key-composite-service_TEST.id = de6620ef-4226-46ce-b9c6-f773af6020a7 +data "dynatrace_management_zone" "CD_digital-key-composite-service_TEST"{ name="CD_digital-key-composite-service" } +resource "dynatrace_dashboard" "CD_digital-key-composite-service_TEST" { + dashboard_metadata { + name = "CD_digital-key-composite-service TEST" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "digital-key-composite-service" ] + filter { + timeframe = "-24h to now" + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 304 + left = 38 + top = 228 + width = 1064 + } + filter_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:digital-key-composite-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_digital-key-composite-service" + id = data.dynatrace_management_zone.CD_digital-key-composite-service_TEST.id + } + } + } + tile { + name = "Overall Health" + configured = true + tile_type = "HEADER" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 0 + width = 1064 + } + } + 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:digital-key-composite-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:digital-key-composite-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:digital-key-composite-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:digital-key-composite-service", "Environment:TEST" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/NA_PREPROD/management_zone/cd_digital-key-composite-service.tf b/NA_PREPROD/management_zone/cd_digital-key-composite-service.tf new file mode 100644 index 00000000..9efca0ab --- /dev/null +++ b/NA_PREPROD/management_zone/cd_digital-key-composite-service.tf @@ -0,0 +1,95 @@ +# DEFINE dynatrace_management_zone.CD_digital-key-composite-service.id = 1337416668047766083 +resource "dynatrace_management_zone" "CD_digital-key-composite-service" { + name = "CD_digital-key-composite-service" + rules { + type = "CLOUD_APPLICATION" + enabled = true + conditions { + key { + type = "STATIC" + attribute = "CLOUD_APPLICATION_NAME" + } + string { + case_sensitive = true + # negate = false + operator = "CONTAINS" + value = "digital-key-composite-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 = "digital-key-composite-service" + } + } + } + rules { + type = "HOST" + enabled = true + conditions { + key { + type = "STATIC" + attribute = "HOST_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = "Component" + value = "digital-key-composite-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 = "digital-key-composite-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 = "digital-key-composite-service" + } + } + } + } +} From 65904816ec6a4962a0f4bceba3c25ea886d143c0 Mon Sep 17 00:00:00 2001 From: Patryk Gudalewicz Date: Wed, 1 Mar 2023 19:11:53 +0100 Subject: [PATCH 6/6] "Migrating from Monaco to Terraform for management zone: CD_digital-key-composite-service" --- .../cd_digital-key-composite-service_prod.tf | 378 ++++++++++++++++++ .../cd_digital-key-composite-service.tf | 95 +++++ 2 files changed, 473 insertions(+) create mode 100644 NA_PROD/dashboard/cd_digital-key-composite-service_prod.tf create mode 100644 NA_PROD/management_zone/cd_digital-key-composite-service.tf diff --git a/NA_PROD/dashboard/cd_digital-key-composite-service_prod.tf b/NA_PROD/dashboard/cd_digital-key-composite-service_prod.tf new file mode 100644 index 00000000..b3108170 --- /dev/null +++ b/NA_PROD/dashboard/cd_digital-key-composite-service_prod.tf @@ -0,0 +1,378 @@ +# DEFINE dynatrace_dashboard.CD_digital-key-composite-service_PROD.id = b0f9b5c7-5d48-490d-946c-3916fe5091c7 +data "dynatrace_management_zone" "CD_digital-key-composite-service_PROD"{ name="CD_digital-key-composite-service" } +resource "dynatrace_dashboard" "CD_digital-key-composite-service_PROD" { + dashboard_metadata { + name = "CD_digital-key-composite-service PROD" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "digital-key-composite-service" ] + filter { + timeframe = "-24h to now" + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 304 + left = 38 + top = 228 + width = 1064 + } + filter_config { + type = "MIXED" + custom_name = "Failure rate (HTTP 4xx/5xx errors)" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#ff0000" + key = "nullbuiltin:service.errors.fivexx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956393463 + } + config { + custom_color = "#fff29a" + key = "nullbuiltin:service.errors.fourxx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956441725 + } + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fourxx.rate" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fivexx.rate" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:PROD", "Component:digital-key-composite-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_digital-key-composite-service" + id = data.dynatrace_management_zone.CD_digital-key-composite-service_PROD.id + } + } + } + tile { + name = "Overall Health" + configured = true + tile_type = "HEADER" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 0 + width = 1064 + } + } + 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:PROD", "Component:digital-key-composite-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:PROD", "Component:digital-key-composite-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:PROD", "Component:digital-key-composite-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:PROD", "Component:digital-key-composite-service" ] + } + } + } + } + } + tile { + name = "Service-level objective" + assigned_entities = [ "132a3673-d913-3683-960e-9c147b9fd89d" ] + configured = true + metric = "METRICS=true;LEGEND=truecustomTitle=Wirkkette \"Digital Key\" - Reliability of key requests;" + tile_type = "SLO" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 114 + top = 912 + width = 304 + } + filter { + timeframe = "-1h" + } + } + tile { + name = "Service-level objective" + assigned_entities = [ "132a3673-d913-3683-960e-9c147b9fd89d" ] + configured = true + metric = "METRICS=true;LEGEND=truecustomTitle=Wirkkette \"Digital Key\" - Reliability of key requests;" + tile_type = "SLO" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 418 + top = 912 + width = 304 + } + filter { + timeframe = "today" + } + } + tile { + name = "Service-level objective" + assigned_entities = [ "132a3673-d913-3683-960e-9c147b9fd89d" ] + configured = true + metric = "METRICS=true;LEGEND=truecustomTitle=Wirkkette \"Digital Key\" - Reliability of key requests;" + tile_type = "SLO" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 722 + top = 912 + width = 304 + } + filter { + timeframe = "-7d to now" + } + } +} \ No newline at end of file diff --git a/NA_PROD/management_zone/cd_digital-key-composite-service.tf b/NA_PROD/management_zone/cd_digital-key-composite-service.tf new file mode 100644 index 00000000..4eead989 --- /dev/null +++ b/NA_PROD/management_zone/cd_digital-key-composite-service.tf @@ -0,0 +1,95 @@ +# DEFINE dynatrace_management_zone.CD_digital-key-composite-service.id = 5778124133123805153 +resource "dynatrace_management_zone" "CD_digital-key-composite-service" { + name = "CD_digital-key-composite-service" + rules { + type = "CLOUD_APPLICATION" + enabled = true + conditions { + key { + type = "STATIC" + attribute = "CLOUD_APPLICATION_NAME" + } + string { + case_sensitive = true + # negate = false + operator = "CONTAINS" + value = "digital-key-composite-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 = "digital-key-composite-service" + } + } + } + rules { + type = "HOST" + enabled = true + conditions { + key { + type = "STATIC" + attribute = "HOST_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = "Component" + value = "digital-key-composite-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 = "digital-key-composite-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 = "digital-key-composite-service" + } + } + } + } +}