From 37a7c1d03e885bce9e0c4a6aa642982f41cbf7bf Mon Sep 17 00:00:00 2001 From: Patryk Gudalewicz Date: Wed, 1 Mar 2023 18:46:42 +0100 Subject: [PATCH 1/6] "Migrating from Monaco to Terraform for management zone: CD_InCarExperienceServices" --- .../cd_incarexperienceservices_int.tf | 38 ++ .../cd_incarexperienceservices_int.tf | 330 ++++++++++++++++++ .../cd_incarexperienceservices_test.tf | 330 ++++++++++++++++++ .../cd_incarexperienceservices.tf | 28 ++ 4 files changed, 726 insertions(+) create mode 100644 CN_PREPROD/alerting/cd_incarexperienceservices_int.tf create mode 100644 CN_PREPROD/dashboard/cd_incarexperienceservices_int.tf create mode 100644 CN_PREPROD/dashboard/cd_incarexperienceservices_test.tf create mode 100644 CN_PREPROD/management_zone/cd_incarexperienceservices.tf diff --git a/CN_PREPROD/alerting/cd_incarexperienceservices_int.tf b/CN_PREPROD/alerting/cd_incarexperienceservices_int.tf new file mode 100644 index 00000000..ca046564 --- /dev/null +++ b/CN_PREPROD/alerting/cd_incarexperienceservices_int.tf @@ -0,0 +1,38 @@ +# DEFINE dynatrace_alerting.CD_InCarExperienceServices_INT.id = vu9U3hXa3q0AAAABABhidWlsdGluOmFsZXJ0aW5nLnByb2ZpbGUABnRlbmFudAAGdGVuYW50ACRhNWVkOTA2OC0yYTZhLTM3OWQtYjZkYS1mOWQyODgzZDBjY2O-71TeFdrerQ +data "dynatrace_management_zone" "CD_InCarExperienceServices_INT"{ name="CD_InCarExperienceServices" } +resource "dynatrace_alerting" "CD_InCarExperienceServices_INT" { + name = "CD_InCarExperienceServices INT" + management_zone = data.dynatrace_management_zone.CD_InCarExperienceServices_INT.id + rules { + rule { + delay_in_minutes = 0 + include_mode = "INCLUDE_ALL" + severity_level = "AVAILABILITY" + tags = [ "Environment:INT" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ALL" + severity_level = "CUSTOM_ALERT" + tags = [ "Environment:INT" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ALL" + severity_level = "ERRORS" + tags = [ "Environment:INT" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ALL" + severity_level = "PERFORMANCE" + tags = [ "Environment:INT" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ALL" + severity_level = "RESOURCE_CONTENTION" + tags = [ "Environment:INT" ] + } + } +} \ No newline at end of file diff --git a/CN_PREPROD/dashboard/cd_incarexperienceservices_int.tf b/CN_PREPROD/dashboard/cd_incarexperienceservices_int.tf new file mode 100644 index 00000000..5bf83574 --- /dev/null +++ b/CN_PREPROD/dashboard/cd_incarexperienceservices_int.tf @@ -0,0 +1,330 @@ +# DEFINE dynatrace_dashboard.CD_InCarExperienceServices_INT.id = 384e157b-9638-4e88-a73b-46f7d28f098b +data "dynatrace_management_zone" "CD_InCarExperienceServices_INT"{ name="CD_InCarExperienceServices" } +resource "dynatrace_dashboard" "CD_InCarExperienceServices_INT" { + dashboard_metadata { + name = "CD_InCarExperienceServices INT" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "CD_InCarExperienceServices" ] + filter { + timeframe = "-24h to now" + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + bounds { + height = 304 + left = 38 + top = 228 + width = 1064 + } + filter { + management_zone { + name = "CD_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_INT.id + } + } + filter_config { + type = "MIXED" + custom_name = "Failure rate (HTTP 4xx/5xx errors)" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#ff0000" + key = "nullbuiltin:service.errors.fivexx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956393463 + } + config { + custom_color = "#fff29a" + key = "nullbuiltin:service.errors.fourxx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956441725 + } + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fourxx.rate" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fivexx.rate" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:INT" ] + } + } + } + } + } + tile { + name = "Problems" + configured = true + tile_type = "OPEN_PROBLEMS" + bounds { + height = 152 + left = 950 + top = 38 + width = 152 + } + filter { + management_zone { + name = "CD_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_INT.id + } + } + } + tile { + name = "Overall Health" + configured = true + tile_type = "HEADER" + bounds { + height = 38 + left = 38 + top = 0 + width = 1064 + } + filter { + management_zone { + name = "CD_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_INT.id + } + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + bounds { + height = 38 + left = 38 + top = 532 + width = 1064 + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + bounds { + height = 304 + left = 38 + top = 570 + width = 1064 + } + filter { + management_zone { + name = "CD_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_INT.id + } + } + filter_config { + type = "MIXED" + custom_name = "Response time, Request Count and Number of Errors" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#008cdb" + key = "nullbuiltin:service.requestCount.total|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275720776 + } + config { + custom_color = "#b4e5f9" + key = "nullbuiltin:service.response.time|AVG|TOTAL|LINE|SERVICE" + last_modified = 1595275686773 + } + config { + custom_color = "#ef651f" + key = "nullbuiltin:service.errors.total.count|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275955999 + } + } + series { + type = "LINE" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.response.time" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.requestCount.total" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.total.count" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:INT" ] + } + } + } + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + bounds { + height = 38 + left = 38 + top = 190 + width = 1064 + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "DATABASES_OVERVIEW" + bounds { + height = 152 + left = 646 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_INT.id + } + } + filter_config { + type = "DATABASE" + custom_name = "Databases" + default_name = "Databases" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "DATABASE" + match { + key = "AUTO_TAGS" + values = [ "Environment:INT" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "SERVICES" + bounds { + height = 152 + left = 342 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_INT.id + } + } + filter_config { + type = "SERVICE" + custom_name = "Services" + default_name = "Services" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:INT" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "HOSTS" + bounds { + height = 152 + left = 38 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_INT.id + } + } + filter_config { + type = "HOST" + custom_name = "Hosts" + default_name = "Hosts" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "HOST" + match { + key = "AUTO_TAGS" + values = [ "Environment:INT" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/CN_PREPROD/dashboard/cd_incarexperienceservices_test.tf b/CN_PREPROD/dashboard/cd_incarexperienceservices_test.tf new file mode 100644 index 00000000..df49c848 --- /dev/null +++ b/CN_PREPROD/dashboard/cd_incarexperienceservices_test.tf @@ -0,0 +1,330 @@ +# DEFINE dynatrace_dashboard.CD_InCarExperienceServices_TEST.id = 786532f7-2104-4963-80f6-5e8aee2804d1 +data "dynatrace_management_zone" "CD_InCarExperienceServices_TEST"{ name="CD_InCarExperienceServices" } +resource "dynatrace_dashboard" "CD_InCarExperienceServices_TEST" { + dashboard_metadata { + name = "CD_InCarExperienceServices TEST" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "CD_InCarExperienceServices" ] + filter { + timeframe = "-24h to now" + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + bounds { + height = 304 + left = 38 + top = 228 + width = 1064 + } + filter { + management_zone { + name = "CD_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_TEST.id + } + } + filter_config { + type = "MIXED" + custom_name = "Failure rate (HTTP 4xx/5xx errors)" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#ff0000" + key = "nullbuiltin:service.errors.fivexx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956393463 + } + config { + custom_color = "#fff29a" + key = "nullbuiltin:service.errors.fourxx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956441725 + } + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fourxx.rate" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fivexx.rate" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:TEST" ] + } + } + } + } + } + tile { + name = "Problems" + configured = true + tile_type = "OPEN_PROBLEMS" + bounds { + height = 152 + left = 950 + top = 38 + width = 152 + } + filter { + management_zone { + name = "CD_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_TEST.id + } + } + } + tile { + name = "Overall Health" + configured = true + tile_type = "HEADER" + bounds { + height = 38 + left = 38 + top = 0 + width = 1064 + } + filter { + management_zone { + name = "CD_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_TEST.id + } + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + bounds { + height = 38 + left = 38 + top = 532 + width = 1064 + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + bounds { + height = 304 + left = 38 + top = 570 + width = 1064 + } + filter { + management_zone { + name = "CD_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_TEST.id + } + } + filter_config { + type = "MIXED" + custom_name = "Response time, Request Count and Number of Errors" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#008cdb" + key = "nullbuiltin:service.requestCount.total|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275720776 + } + config { + custom_color = "#b4e5f9" + key = "nullbuiltin:service.response.time|AVG|TOTAL|LINE|SERVICE" + last_modified = 1595275686773 + } + config { + custom_color = "#ef651f" + key = "nullbuiltin:service.errors.total.count|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275955999 + } + } + series { + type = "LINE" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.response.time" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.requestCount.total" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.total.count" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:TEST" ] + } + } + } + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + bounds { + height = 38 + left = 38 + top = 190 + width = 1064 + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "DATABASES_OVERVIEW" + bounds { + height = 152 + left = 646 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_TEST.id + } + } + filter_config { + type = "DATABASE" + custom_name = "Databases" + default_name = "Databases" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "DATABASE" + match { + key = "AUTO_TAGS" + values = [ "Environment:TEST" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "SERVICES" + bounds { + height = 152 + left = 342 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_TEST.id + } + } + filter_config { + type = "SERVICE" + custom_name = "Services" + default_name = "Services" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:TEST" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "HOSTS" + bounds { + height = 152 + left = 38 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_TEST.id + } + } + filter_config { + type = "HOST" + custom_name = "Hosts" + default_name = "Hosts" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "HOST" + match { + key = "AUTO_TAGS" + values = [ "Environment:TEST" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/CN_PREPROD/management_zone/cd_incarexperienceservices.tf b/CN_PREPROD/management_zone/cd_incarexperienceservices.tf new file mode 100644 index 00000000..f9dbba32 --- /dev/null +++ b/CN_PREPROD/management_zone/cd_incarexperienceservices.tf @@ -0,0 +1,28 @@ +# DEFINE dynatrace_management_zone.CD_InCarExperienceServices.id = 510429449364557116 +resource "dynatrace_management_zone" "CD_InCarExperienceServices" { + name = "CD_InCarExperienceServices" + entity_selector_based_rule { + enabled = true + selector =<<-EOT + type(PROCESS_GROUP_INSTANCE),tag("compass-id:ambient-music","compass-id:festive-mode","compass-id:ices-festivalmode","compass-id:ices-login","compass-id:ices-festivalmode-adminui","compass-id:ices-contentdelivery","compass-id:ices-ambientmusic","compass-id:ices-mymodes-manifest","compass-id:ices-mymodes-cache","compass-id:ices-mymodes-admin","compass-id:ices-mymodes-user","compass-id:ices-mymodes-event","compass-id:ices-mymodes-adminui") + EOT + } + entity_selector_based_rule { + enabled = true + selector =<<-EOT + type(HOST),tag("compass-id:ambient-music","compass-id:festive-mode","compass-id:ices-festivalmode","compass-id:ices-login","compass-id:ices-festivalmode-adminui","compass-id:ices-contentdelivery","compass-id:ices-ambientmusic","compass-id:ices-mymodes-manifest","compass-id:ices-mymodes-cache","compass-id:ices-mymodes-admin","compass-id:ices-mymodes-user","compass-id:ices-mymodes-event","compass-id:ices-mymodes-adminui") + EOT + } + entity_selector_based_rule { + enabled = true + selector =<<-EOT + type(SERVICE),databaseName.exists(),toRelationship.calls(type(SERVICE),tag("compass-id:ambient-music","compass-id:festive-mode","compass-id:ices-festivalmode","compass-id:ices-login","compass-id:ices-festivalmode-adminui","compass-id:ices-contentdelivery","compass-id:ices-ambientmusic","compass-id:ices-mymodes-manifest","compass-id:ices-mymodes-cache","compass-id:ices-mymodes-admin","compass-id:ices-mymodes-user","compass-id:ices-mymodes-event","compass-id:ices-mymodes-adminui")) + EOT + } + entity_selector_based_rule { + enabled = true + selector =<<-EOT + type(Service),tag("compass-id:ambient-music","compass-id:festive-mode","compass-id:ices-festivalmode","compass-id:ices-login","compass-id:ices-festivalmode-adminui","compass-id:ices-contentdelivery","compass-id:ices-ambientmusic","compass-id:ices-mymodes-manifest","compass-id:ices-mymodes-cache","compass-id:ices-mymodes-admin","compass-id:ices-mymodes-user","compass-id:ices-mymodes-event","compass-id:ices-mymodes-adminui") + EOT + } +} From 08ff4c3f9cfa4ad69c9cb5dca9d982888b8461d2 Mon Sep 17 00:00:00 2001 From: Patryk Gudalewicz Date: Wed, 1 Mar 2023 18:52:14 +0100 Subject: [PATCH 2/6] "Migrating from Monaco to Terraform for management zone: CD_InCarExperienceServices" --- .../cd_incarexperienceservices_prod.tf | 38 ++ .../cd_incarexperienceservices_e2e.tf | 330 ++++++++++++++++++ .../cd_incarexperienceservices_prod.tf | 330 ++++++++++++++++++ .../cd_incarexperienceservices.tf | 28 ++ 4 files changed, 726 insertions(+) create mode 100644 CN_PROD/alerting/cd_incarexperienceservices_prod.tf create mode 100644 CN_PROD/dashboard/cd_incarexperienceservices_e2e.tf create mode 100644 CN_PROD/dashboard/cd_incarexperienceservices_prod.tf create mode 100644 CN_PROD/management_zone/cd_incarexperienceservices.tf diff --git a/CN_PROD/alerting/cd_incarexperienceservices_prod.tf b/CN_PROD/alerting/cd_incarexperienceservices_prod.tf new file mode 100644 index 00000000..7f6b9ccf --- /dev/null +++ b/CN_PROD/alerting/cd_incarexperienceservices_prod.tf @@ -0,0 +1,38 @@ +# DEFINE dynatrace_alerting.CD_InCarExperienceServices_PROD.id = vu9U3hXa3q0AAAABABhidWlsdGluOmFsZXJ0aW5nLnByb2ZpbGUABnRlbmFudAAGdGVuYW50ACRiMDMxNjFhNi0xMTgwLTM3YzMtOWY2MC1iNjI0MGRjMzM2YTS-71TeFdrerQ +data "dynatrace_management_zone" "CD_InCarExperienceServices_PROD"{ name="CD_InCarExperienceServices" } +resource "dynatrace_alerting" "CD_InCarExperienceServices_PROD" { + name = "CD_InCarExperienceServices PROD" + management_zone = data.dynatrace_management_zone.CD_InCarExperienceServices_PROD.id + rules { + rule { + delay_in_minutes = 0 + include_mode = "INCLUDE_ALL" + severity_level = "AVAILABILITY" + tags = [ "Environment:PROD" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ALL" + severity_level = "CUSTOM_ALERT" + tags = [ "Environment:PROD" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ALL" + severity_level = "ERRORS" + tags = [ "Environment:PROD" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ALL" + severity_level = "PERFORMANCE" + tags = [ "Environment:PROD" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ALL" + severity_level = "RESOURCE_CONTENTION" + tags = [ "Environment:PROD" ] + } + } +} \ No newline at end of file diff --git a/CN_PROD/dashboard/cd_incarexperienceservices_e2e.tf b/CN_PROD/dashboard/cd_incarexperienceservices_e2e.tf new file mode 100644 index 00000000..e48affaa --- /dev/null +++ b/CN_PROD/dashboard/cd_incarexperienceservices_e2e.tf @@ -0,0 +1,330 @@ +# DEFINE dynatrace_dashboard.CD_InCarExperienceServices_E2E.id = 88a9bdc9-4531-4d80-992f-a56a87df3717 +data "dynatrace_management_zone" "CD_InCarExperienceServices_E2E"{ name="CD_InCarExperienceServices" } +resource "dynatrace_dashboard" "CD_InCarExperienceServices_E2E" { + dashboard_metadata { + name = "CD_InCarExperienceServices E2E" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "CD_InCarExperienceServices" ] + filter { + timeframe = "-24h to now" + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + bounds { + height = 304 + left = 38 + top = 228 + width = 1064 + } + filter { + management_zone { + name = "CD_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_E2E.id + } + } + filter_config { + type = "MIXED" + custom_name = "Failure rate (HTTP 4xx/5xx errors)" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#ff0000" + key = "nullbuiltin:service.errors.fivexx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956393463 + } + config { + custom_color = "#fff29a" + key = "nullbuiltin:service.errors.fourxx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956441725 + } + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fourxx.rate" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fivexx.rate" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:E2E" ] + } + } + } + } + } + tile { + name = "Problems" + configured = true + tile_type = "OPEN_PROBLEMS" + bounds { + height = 152 + left = 950 + top = 38 + width = 152 + } + filter { + management_zone { + name = "CD_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_E2E.id + } + } + } + tile { + name = "Overall Health" + configured = true + tile_type = "HEADER" + bounds { + height = 38 + left = 38 + top = 0 + width = 1064 + } + filter { + management_zone { + name = "CD_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_E2E.id + } + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + bounds { + height = 38 + left = 38 + top = 532 + width = 1064 + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + bounds { + height = 304 + left = 38 + top = 570 + width = 1064 + } + filter { + management_zone { + name = "CD_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_E2E.id + } + } + filter_config { + type = "MIXED" + custom_name = "Response time, Request Count and Number of Errors" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#008cdb" + key = "nullbuiltin:service.requestCount.total|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275720776 + } + config { + custom_color = "#b4e5f9" + key = "nullbuiltin:service.response.time|AVG|TOTAL|LINE|SERVICE" + last_modified = 1595275686773 + } + config { + custom_color = "#ef651f" + key = "nullbuiltin:service.errors.total.count|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275955999 + } + } + series { + type = "LINE" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.response.time" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.requestCount.total" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.total.count" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:E2E" ] + } + } + } + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + bounds { + height = 38 + left = 38 + top = 190 + width = 1064 + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "DATABASES_OVERVIEW" + bounds { + height = 152 + left = 646 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_E2E.id + } + } + filter_config { + type = "DATABASE" + custom_name = "Databases" + default_name = "Databases" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "DATABASE" + match { + key = "AUTO_TAGS" + values = [ "Environment:E2E" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "SERVICES" + bounds { + height = 152 + left = 342 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_E2E.id + } + } + filter_config { + type = "SERVICE" + custom_name = "Services" + default_name = "Services" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:E2E" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "HOSTS" + bounds { + height = 152 + left = 38 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_E2E.id + } + } + filter_config { + type = "HOST" + custom_name = "Hosts" + default_name = "Hosts" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "HOST" + match { + key = "AUTO_TAGS" + values = [ "Environment:E2E" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/CN_PROD/dashboard/cd_incarexperienceservices_prod.tf b/CN_PROD/dashboard/cd_incarexperienceservices_prod.tf new file mode 100644 index 00000000..7373ab8e --- /dev/null +++ b/CN_PROD/dashboard/cd_incarexperienceservices_prod.tf @@ -0,0 +1,330 @@ +# DEFINE dynatrace_dashboard.CD_InCarExperienceServices_PROD.id = 47ded0c7-e884-466c-83b7-7d4740112c63 +data "dynatrace_management_zone" "CD_InCarExperienceServices_PROD"{ name="CD_InCarExperienceServices" } +resource "dynatrace_dashboard" "CD_InCarExperienceServices_PROD" { + dashboard_metadata { + name = "CD_InCarExperienceServices PROD" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "CD_InCarExperienceServices" ] + filter { + timeframe = "-24h to now" + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + bounds { + height = 304 + left = 38 + top = 228 + width = 1064 + } + filter { + management_zone { + name = "CD_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_PROD.id + } + } + filter_config { + type = "MIXED" + custom_name = "Failure rate (HTTP 4xx/5xx errors)" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#ff0000" + key = "nullbuiltin:service.errors.fivexx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956393463 + } + config { + custom_color = "#fff29a" + key = "nullbuiltin:service.errors.fourxx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956441725 + } + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fourxx.rate" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fivexx.rate" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:PROD" ] + } + } + } + } + } + tile { + name = "Problems" + configured = true + tile_type = "OPEN_PROBLEMS" + bounds { + height = 152 + left = 950 + top = 38 + width = 152 + } + filter { + management_zone { + name = "CD_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_PROD.id + } + } + } + tile { + name = "Overall Health" + configured = true + tile_type = "HEADER" + bounds { + height = 38 + left = 38 + top = 0 + width = 1064 + } + filter { + management_zone { + name = "CD_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_PROD.id + } + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + bounds { + height = 38 + left = 38 + top = 532 + width = 1064 + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + bounds { + height = 304 + left = 38 + top = 570 + width = 1064 + } + filter { + management_zone { + name = "CD_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_PROD.id + } + } + filter_config { + type = "MIXED" + custom_name = "Response time, Request Count and Number of Errors" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#008cdb" + key = "nullbuiltin:service.requestCount.total|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275720776 + } + config { + custom_color = "#b4e5f9" + key = "nullbuiltin:service.response.time|AVG|TOTAL|LINE|SERVICE" + last_modified = 1595275686773 + } + config { + custom_color = "#ef651f" + key = "nullbuiltin:service.errors.total.count|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275955999 + } + } + series { + type = "LINE" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.response.time" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.requestCount.total" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.total.count" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:PROD" ] + } + } + } + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + bounds { + height = 38 + left = 38 + top = 190 + width = 1064 + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "DATABASES_OVERVIEW" + bounds { + height = 152 + left = 646 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_PROD.id + } + } + filter_config { + type = "DATABASE" + custom_name = "Databases" + default_name = "Databases" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "DATABASE" + match { + key = "AUTO_TAGS" + values = [ "Environment:PROD" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "SERVICES" + bounds { + height = 152 + left = 342 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_PROD.id + } + } + filter_config { + type = "SERVICE" + custom_name = "Services" + default_name = "Services" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:PROD" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "HOSTS" + bounds { + height = 152 + left = 38 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_PROD.id + } + } + filter_config { + type = "HOST" + custom_name = "Hosts" + default_name = "Hosts" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "HOST" + match { + key = "AUTO_TAGS" + values = [ "Environment:PROD" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/CN_PROD/management_zone/cd_incarexperienceservices.tf b/CN_PROD/management_zone/cd_incarexperienceservices.tf new file mode 100644 index 00000000..15949f0a --- /dev/null +++ b/CN_PROD/management_zone/cd_incarexperienceservices.tf @@ -0,0 +1,28 @@ +# DEFINE dynatrace_management_zone.CD_InCarExperienceServices.id = 5775765708700509284 +resource "dynatrace_management_zone" "CD_InCarExperienceServices" { + name = "CD_InCarExperienceServices" + entity_selector_based_rule { + enabled = true + selector =<<-EOT + type(PROCESS_GROUP_INSTANCE),tag("compass-id:ambient-music","compass-id:festive-mode","compass-id:ices-festivalmode","compass-id:ices-login","compass-id:ices-festivalmode-adminui","compass-id:ices-contentdelivery","compass-id:ices-ambientmusic","compass-id:ices-mymodes-manifest","compass-id:ices-mymodes-cache","compass-id:ices-mymodes-admin","compass-id:ices-mymodes-user","compass-id:ices-mymodes-event","compass-id:ices-mymodes-adminui") + EOT + } + entity_selector_based_rule { + enabled = true + selector =<<-EOT + type(HOST),tag("compass-id:ambient-music","compass-id:festive-mode","compass-id:ices-festivalmode","compass-id:ices-login","compass-id:ices-festivalmode-adminui","compass-id:ices-contentdelivery","compass-id:ices-ambientmusic","compass-id:ices-mymodes-manifest","compass-id:ices-mymodes-cache","compass-id:ices-mymodes-admin","compass-id:ices-mymodes-user","compass-id:ices-mymodes-event","compass-id:ices-mymodes-adminui") + EOT + } + entity_selector_based_rule { + enabled = true + selector =<<-EOT + type(SERVICE),databaseName.exists(),toRelationship.calls(type(SERVICE),tag("compass-id:ambient-music","compass-id:festive-mode","compass-id:ices-festivalmode","compass-id:ices-login","compass-id:ices-festivalmode-adminui","compass-id:ices-contentdelivery","compass-id:ices-ambientmusic","compass-id:ices-mymodes-manifest","compass-id:ices-mymodes-cache","compass-id:ices-mymodes-admin","compass-id:ices-mymodes-user","compass-id:ices-mymodes-event","compass-id:ices-mymodes-adminui")) + EOT + } + entity_selector_based_rule { + enabled = true + selector =<<-EOT + type(Service),tag("compass-id:ambient-music","compass-id:festive-mode","compass-id:ices-festivalmode","compass-id:ices-login","compass-id:ices-festivalmode-adminui","compass-id:ices-contentdelivery","compass-id:ices-ambientmusic","compass-id:ices-mymodes-manifest","compass-id:ices-mymodes-cache","compass-id:ices-mymodes-admin","compass-id:ices-mymodes-user","compass-id:ices-mymodes-event","compass-id:ices-mymodes-adminui") + EOT + } +} From 4f7c39550d6f9ac2053225f61e7965b34c061d54 Mon Sep 17 00:00:00 2001 From: Patryk Gudalewicz Date: Wed, 1 Mar 2023 18:57:00 +0100 Subject: [PATCH 3/6] "Migrating from Monaco to Terraform for management zone: CD_InCarExperienceServices" --- .../cd_incarexperienceservices_int.tf | 38 ++ .../cd_incarexperienceservices_int.tf | 357 ++++++++++++++++++ .../cd_incarexperienceservices_test.tf | 357 ++++++++++++++++++ .../cd_incarexperienceservices.tf | 28 ++ 4 files changed, 780 insertions(+) create mode 100644 EMEA_PREPROD/alerting/cd_incarexperienceservices_int.tf create mode 100644 EMEA_PREPROD/dashboard/cd_incarexperienceservices_int.tf create mode 100644 EMEA_PREPROD/dashboard/cd_incarexperienceservices_test.tf create mode 100644 EMEA_PREPROD/management_zone/cd_incarexperienceservices.tf diff --git a/EMEA_PREPROD/alerting/cd_incarexperienceservices_int.tf b/EMEA_PREPROD/alerting/cd_incarexperienceservices_int.tf new file mode 100644 index 00000000..de5e1213 --- /dev/null +++ b/EMEA_PREPROD/alerting/cd_incarexperienceservices_int.tf @@ -0,0 +1,38 @@ +# DEFINE dynatrace_alerting.CD_InCarExperienceServices_INT.id = vu9U3hXa3q0AAAABABhidWlsdGluOmFsZXJ0aW5nLnByb2ZpbGUABnRlbmFudAAGdGVuYW50ACQwZGI0YmVhYS0xMWYyLTM3ZWItOGY1NS1mMjQ1ZWJmZTcyZDW-71TeFdrerQ +data "dynatrace_management_zone" "CD_InCarExperienceServices_INT"{ name="CD_InCarExperienceServices" } +resource "dynatrace_alerting" "CD_InCarExperienceServices_INT" { + name = "CD_InCarExperienceServices INT" + management_zone = data.dynatrace_management_zone.CD_InCarExperienceServices_INT.id + rules { + rule { + delay_in_minutes = 0 + include_mode = "INCLUDE_ALL" + severity_level = "AVAILABILITY" + tags = [ "Environment:INT" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ALL" + severity_level = "CUSTOM_ALERT" + tags = [ "Environment:INT" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ALL" + severity_level = "ERRORS" + tags = [ "Environment:INT" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ALL" + severity_level = "PERFORMANCE" + tags = [ "Environment:INT" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ALL" + severity_level = "RESOURCE_CONTENTION" + tags = [ "Environment:INT" ] + } + } +} \ No newline at end of file diff --git a/EMEA_PREPROD/dashboard/cd_incarexperienceservices_int.tf b/EMEA_PREPROD/dashboard/cd_incarexperienceservices_int.tf new file mode 100644 index 00000000..b01fea6f --- /dev/null +++ b/EMEA_PREPROD/dashboard/cd_incarexperienceservices_int.tf @@ -0,0 +1,357 @@ +# DEFINE dynatrace_dashboard.CD_InCarExperienceServices_INT.id = 2a9f2b51-64ad-4953-ab60-768178d68347 +data "dynatrace_management_zone" "CD_InCarExperienceServices_INT"{ name="CD_InCarExperienceServices" } +resource "dynatrace_dashboard" "CD_InCarExperienceServices_INT" { + dashboard_metadata { + name = "CD_InCarExperienceServices INT" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "CD_InCarExperienceServices" ] + 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_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_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_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_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_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_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_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_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_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_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_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_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_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_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_incarexperienceservices_test.tf b/EMEA_PREPROD/dashboard/cd_incarexperienceservices_test.tf new file mode 100644 index 00000000..7e0dbc10 --- /dev/null +++ b/EMEA_PREPROD/dashboard/cd_incarexperienceservices_test.tf @@ -0,0 +1,357 @@ +# DEFINE dynatrace_dashboard.CD_InCarExperienceServices_TEST.id = cf238073-fd22-45b3-8e54-20e51c5fcf54 +data "dynatrace_management_zone" "CD_InCarExperienceServices_TEST"{ name="CD_InCarExperienceServices" } +resource "dynatrace_dashboard" "CD_InCarExperienceServices_TEST" { + dashboard_metadata { + name = "CD_InCarExperienceServices TEST" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "CD_InCarExperienceServices" ] + 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_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_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_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_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_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_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_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_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_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_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_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_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_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_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_incarexperienceservices.tf b/EMEA_PREPROD/management_zone/cd_incarexperienceservices.tf new file mode 100644 index 00000000..665693ba --- /dev/null +++ b/EMEA_PREPROD/management_zone/cd_incarexperienceservices.tf @@ -0,0 +1,28 @@ +# DEFINE dynatrace_management_zone.CD_InCarExperienceServices.id = -2207082971099740102 +resource "dynatrace_management_zone" "CD_InCarExperienceServices" { + name = "CD_InCarExperienceServices" + entity_selector_based_rule { + enabled = true + selector =<<-EOT + type(SERVICE),databaseName.exists(),toRelationship.calls(type(SERVICE),tag("compass-id:ambient-music","compass-id:festive-mode","compass-id:ices-festivalmode","compass-id:ices-login","compass-id:ices-festivalmode-adminui","compass-id:ices-contentdelivery","compass-id:ices-ambientmusic","compass-id:ices-mymodes-manifest","compass-id:ices-mymodes-cache","compass-id:ices-mymodes-admin","compass-id:ices-mymodes-user","compass-id:ices-mymodes-event","compass-id:ices-mymodes-adminui")) + EOT + } + entity_selector_based_rule { + enabled = true + selector =<<-EOT + type(HOST),tag("compass-id:ambient-music","compass-id:festive-mode","compass-id:ices-festivalmode","compass-id:ices-login","compass-id:ices-festivalmode-adminui","compass-id:ices-contentdelivery","compass-id:ices-ambientmusic","compass-id:ices-mymodes-manifest","compass-id:ices-mymodes-cache","compass-id:ices-mymodes-admin","compass-id:ices-mymodes-user","compass-id:ices-mymodes-event","compass-id:ices-mymodes-adminui") + EOT + } + entity_selector_based_rule { + enabled = true + selector =<<-EOT + type(PROCESS_GROUP_INSTANCE),tag("compass-id:ambient-music","compass-id:festive-mode","compass-id:ices-festivalmode","compass-id:ices-login","compass-id:ices-festivalmode-adminui","compass-id:ices-contentdelivery","compass-id:ices-ambientmusic","compass-id:ices-mymodes-manifest","compass-id:ices-mymodes-cache","compass-id:ices-mymodes-admin","compass-id:ices-mymodes-user","compass-id:ices-mymodes-event","compass-id:ices-mymodes-adminui") + EOT + } + entity_selector_based_rule { + enabled = true + selector =<<-EOT + type(Service),tag("compass-id:ambient-music","compass-id:festive-mode","compass-id:ices-festivalmode","compass-id:ices-login","compass-id:ices-festivalmode-adminui","compass-id:ices-contentdelivery","compass-id:ices-ambientmusic","compass-id:ices-mymodes-manifest","compass-id:ices-mymodes-cache","compass-id:ices-mymodes-admin","compass-id:ices-mymodes-user","compass-id:ices-mymodes-event","compass-id:ices-mymodes-adminui") + EOT + } +} From e2d9852167d3ec6c35944daecc3c51b326b2503a Mon Sep 17 00:00:00 2001 From: Patryk Gudalewicz Date: Wed, 1 Mar 2023 19:05:48 +0100 Subject: [PATCH 4/6] "Migrating from Monaco to Terraform for management zone: CD_InCarExperienceServices" --- .../cd_incarexperienceservices_prod.tf | 38 ++ .../cd_incarexperienceservices_e2e.tf | 357 ++++++++++++++++++ .../cd_incarexperienceservices_prod.tf | 357 ++++++++++++++++++ .../cd_incarexperienceservices.tf | 28 ++ 4 files changed, 780 insertions(+) create mode 100644 EMEA_PROD/alerting/cd_incarexperienceservices_prod.tf create mode 100644 EMEA_PROD/dashboard/cd_incarexperienceservices_e2e.tf create mode 100644 EMEA_PROD/dashboard/cd_incarexperienceservices_prod.tf create mode 100644 EMEA_PROD/management_zone/cd_incarexperienceservices.tf diff --git a/EMEA_PROD/alerting/cd_incarexperienceservices_prod.tf b/EMEA_PROD/alerting/cd_incarexperienceservices_prod.tf new file mode 100644 index 00000000..32234b3b --- /dev/null +++ b/EMEA_PROD/alerting/cd_incarexperienceservices_prod.tf @@ -0,0 +1,38 @@ +# DEFINE dynatrace_alerting.CD_InCarExperienceServices_PROD.id = vu9U3hXa3q0AAAABABhidWlsdGluOmFsZXJ0aW5nLnByb2ZpbGUABnRlbmFudAAGdGVuYW50ACQxMDNhNWQwYi0yODY3LTNjMjItODNkOC0yODBlZjg0NTU4NTm-71TeFdrerQ +data "dynatrace_management_zone" "CD_InCarExperienceServices_PROD"{ name="CD_InCarExperienceServices" } +resource "dynatrace_alerting" "CD_InCarExperienceServices_PROD" { + name = "CD_InCarExperienceServices PROD" + management_zone = data.dynatrace_management_zone.CD_InCarExperienceServices_PROD.id + rules { + rule { + delay_in_minutes = 0 + include_mode = "INCLUDE_ALL" + severity_level = "AVAILABILITY" + tags = [ "Environment:PROD" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ALL" + severity_level = "CUSTOM_ALERT" + tags = [ "Environment:PROD" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ALL" + severity_level = "ERRORS" + tags = [ "Environment:PROD" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ALL" + severity_level = "PERFORMANCE" + tags = [ "Environment:PROD" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ALL" + severity_level = "RESOURCE_CONTENTION" + tags = [ "Environment:PROD" ] + } + } +} \ No newline at end of file diff --git a/EMEA_PROD/dashboard/cd_incarexperienceservices_e2e.tf b/EMEA_PROD/dashboard/cd_incarexperienceservices_e2e.tf new file mode 100644 index 00000000..88e1807c --- /dev/null +++ b/EMEA_PROD/dashboard/cd_incarexperienceservices_e2e.tf @@ -0,0 +1,357 @@ +# DEFINE dynatrace_dashboard.CD_InCarExperienceServices_E2E.id = 43099a2d-6598-47e8-8b33-20ddd3c4c52f +data "dynatrace_management_zone" "CD_InCarExperienceServices_E2E"{ name="CD_InCarExperienceServices" } +resource "dynatrace_dashboard" "CD_InCarExperienceServices_E2E" { + dashboard_metadata { + name = "CD_InCarExperienceServices E2E" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "CD_InCarExperienceServices" ] + 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_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_E2E.id + } + } + filter_config { + type = "MIXED" + custom_name = "Failure rate (HTTP 4xx/5xx errors)" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#ff0000" + key = "nullbuiltin:service.errors.fivexx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956393463 + } + config { + custom_color = "#fff29a" + key = "nullbuiltin:service.errors.fourxx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956441725 + } + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fourxx.rate" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fivexx.rate" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:E2E" ] + } + } + } + } + } + tile { + name = "Problems" + configured = true + tile_type = "OPEN_PROBLEMS" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 950 + top = 38 + width = 152 + } + filter { + management_zone { + name = "CD_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_E2E.id + } + } + } + tile { + name = "Overall Health" + configured = true + tile_type = "HEADER" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 0 + width = 1064 + } + filter { + management_zone { + name = "CD_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_E2E.id + } + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 532 + width = 1064 + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 304 + left = 38 + top = 570 + width = 1064 + } + filter { + management_zone { + name = "CD_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_E2E.id + } + } + filter_config { + type = "MIXED" + custom_name = "Response time, Request Count and Number of Errors" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#008cdb" + key = "nullbuiltin:service.requestCount.total|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275720776 + } + config { + custom_color = "#b4e5f9" + key = "nullbuiltin:service.response.time|AVG|TOTAL|LINE|SERVICE" + last_modified = 1595275686773 + } + config { + custom_color = "#ef651f" + key = "nullbuiltin:service.errors.total.count|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275955999 + } + } + series { + type = "LINE" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.response.time" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.requestCount.total" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.total.count" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:E2E" ] + } + } + } + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 190 + width = 1064 + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "DATABASES_OVERVIEW" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 646 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_E2E.id + } + } + filter_config { + type = "DATABASE" + custom_name = "Databases" + default_name = "Databases" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "DATABASE" + match { + key = "AUTO_TAGS" + values = [ "Environment:E2E" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "SERVICES" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 342 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_E2E.id + } + } + filter_config { + type = "SERVICE" + custom_name = "Services" + default_name = "Services" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:E2E" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "HOSTS" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 38 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_E2E.id + } + } + filter_config { + type = "HOST" + custom_name = "Hosts" + default_name = "Hosts" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "HOST" + match { + key = "AUTO_TAGS" + values = [ "Environment:E2E" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/EMEA_PROD/dashboard/cd_incarexperienceservices_prod.tf b/EMEA_PROD/dashboard/cd_incarexperienceservices_prod.tf new file mode 100644 index 00000000..42fa6a83 --- /dev/null +++ b/EMEA_PROD/dashboard/cd_incarexperienceservices_prod.tf @@ -0,0 +1,357 @@ +# DEFINE dynatrace_dashboard.CD_InCarExperienceServices_PROD.id = 77a05f83-784d-4f5b-bc6e-ceeb40af55ba +data "dynatrace_management_zone" "CD_InCarExperienceServices_PROD"{ name="CD_InCarExperienceServices" } +resource "dynatrace_dashboard" "CD_InCarExperienceServices_PROD" { + dashboard_metadata { + name = "CD_InCarExperienceServices PROD" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "CD_InCarExperienceServices" ] + 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_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_PROD.id + } + } + filter_config { + type = "MIXED" + custom_name = "Failure rate (HTTP 4xx/5xx errors)" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#ff0000" + key = "nullbuiltin:service.errors.fivexx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956393463 + } + config { + custom_color = "#fff29a" + key = "nullbuiltin:service.errors.fourxx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956441725 + } + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fourxx.rate" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fivexx.rate" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:PROD" ] + } + } + } + } + } + tile { + name = "Problems" + configured = true + tile_type = "OPEN_PROBLEMS" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 950 + top = 38 + width = 152 + } + filter { + management_zone { + name = "CD_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_PROD.id + } + } + } + tile { + name = "Overall Health" + configured = true + tile_type = "HEADER" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 0 + width = 1064 + } + filter { + management_zone { + name = "CD_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_PROD.id + } + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 532 + width = 1064 + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 304 + left = 38 + top = 570 + width = 1064 + } + filter { + management_zone { + name = "CD_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_PROD.id + } + } + filter_config { + type = "MIXED" + custom_name = "Response time, Request Count and Number of Errors" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#008cdb" + key = "nullbuiltin:service.requestCount.total|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275720776 + } + config { + custom_color = "#b4e5f9" + key = "nullbuiltin:service.response.time|AVG|TOTAL|LINE|SERVICE" + last_modified = 1595275686773 + } + config { + custom_color = "#ef651f" + key = "nullbuiltin:service.errors.total.count|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275955999 + } + } + series { + type = "LINE" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.response.time" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.requestCount.total" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.total.count" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:PROD" ] + } + } + } + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 190 + width = 1064 + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "DATABASES_OVERVIEW" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 646 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_PROD.id + } + } + filter_config { + type = "DATABASE" + custom_name = "Databases" + default_name = "Databases" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "DATABASE" + match { + key = "AUTO_TAGS" + values = [ "Environment:PROD" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "SERVICES" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 342 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_PROD.id + } + } + filter_config { + type = "SERVICE" + custom_name = "Services" + default_name = "Services" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:PROD" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "HOSTS" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 38 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_PROD.id + } + } + filter_config { + type = "HOST" + custom_name = "Hosts" + default_name = "Hosts" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "HOST" + match { + key = "AUTO_TAGS" + values = [ "Environment:PROD" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/EMEA_PROD/management_zone/cd_incarexperienceservices.tf b/EMEA_PROD/management_zone/cd_incarexperienceservices.tf new file mode 100644 index 00000000..cce71e46 --- /dev/null +++ b/EMEA_PROD/management_zone/cd_incarexperienceservices.tf @@ -0,0 +1,28 @@ +# DEFINE dynatrace_management_zone.CD_InCarExperienceServices.id = -1116046127431629229 +resource "dynatrace_management_zone" "CD_InCarExperienceServices" { + name = "CD_InCarExperienceServices" + entity_selector_based_rule { + enabled = true + selector =<<-EOT + type(PROCESS_GROUP_INSTANCE),tag("compass-id:ambient-music","compass-id:festive-mode","compass-id:ices-festivalmode","compass-id:ices-login","compass-id:ices-festivalmode-adminui","compass-id:ices-contentdelivery","compass-id:ices-ambientmusic","compass-id:ices-mymodes-manifest","compass-id:ices-mymodes-cache","compass-id:ices-mymodes-admin","compass-id:ices-mymodes-user","compass-id:ices-mymodes-event","compass-id:ices-mymodes-adminui") + EOT + } + entity_selector_based_rule { + enabled = true + selector =<<-EOT + type(Service),tag("compass-id:ambient-music","compass-id:festive-mode","compass-id:ices-festivalmode","compass-id:ices-login","compass-id:ices-festivalmode-adminui","compass-id:ices-contentdelivery","compass-id:ices-ambientmusic","compass-id:ices-mymodes-manifest","compass-id:ices-mymodes-cache","compass-id:ices-mymodes-admin","compass-id:ices-mymodes-user","compass-id:ices-mymodes-event","compass-id:ices-mymodes-adminui") + EOT + } + entity_selector_based_rule { + enabled = true + selector =<<-EOT + type(SERVICE),databaseName.exists(),toRelationship.calls(type(SERVICE),tag("compass-id:ambient-music","compass-id:festive-mode","compass-id:ices-festivalmode","compass-id:ices-login","compass-id:ices-festivalmode-adminui","compass-id:ices-contentdelivery","compass-id:ices-ambientmusic","compass-id:ices-mymodes-manifest","compass-id:ices-mymodes-cache","compass-id:ices-mymodes-admin","compass-id:ices-mymodes-user","compass-id:ices-mymodes-event","compass-id:ices-mymodes-adminui")) + EOT + } + entity_selector_based_rule { + enabled = true + selector =<<-EOT + type(HOST),tag("compass-id:ambient-music","compass-id:festive-mode","compass-id:ices-festivalmode","compass-id:ices-login","compass-id:ices-festivalmode-adminui","compass-id:ices-contentdelivery","compass-id:ices-ambientmusic","compass-id:ices-mymodes-manifest","compass-id:ices-mymodes-cache","compass-id:ices-mymodes-admin","compass-id:ices-mymodes-user","compass-id:ices-mymodes-event","compass-id:ices-mymodes-adminui") + EOT + } +} From a89e75c0818bcc5c087031e8627bfc9df9556184 Mon Sep 17 00:00:00 2001 From: Patryk Gudalewicz Date: Wed, 1 Mar 2023 19:09:05 +0100 Subject: [PATCH 5/6] "Migrating from Monaco to Terraform for management zone: CD_InCarExperienceServices" --- .../cd_incarexperienceservices_int.tf | 38 ++ .../cd_incarexperienceservices_int.tf | 357 ++++++++++++++++++ .../cd_incarexperienceservices_test.tf | 357 ++++++++++++++++++ .../cd_incarexperienceservices.tf | 28 ++ 4 files changed, 780 insertions(+) create mode 100644 NA_PREPROD/alerting/cd_incarexperienceservices_int.tf create mode 100644 NA_PREPROD/dashboard/cd_incarexperienceservices_int.tf create mode 100644 NA_PREPROD/dashboard/cd_incarexperienceservices_test.tf create mode 100644 NA_PREPROD/management_zone/cd_incarexperienceservices.tf diff --git a/NA_PREPROD/alerting/cd_incarexperienceservices_int.tf b/NA_PREPROD/alerting/cd_incarexperienceservices_int.tf new file mode 100644 index 00000000..b59cdc43 --- /dev/null +++ b/NA_PREPROD/alerting/cd_incarexperienceservices_int.tf @@ -0,0 +1,38 @@ +# DEFINE dynatrace_alerting.CD_InCarExperienceServices_INT.id = vu9U3hXa3q0AAAABABhidWlsdGluOmFsZXJ0aW5nLnByb2ZpbGUABnRlbmFudAAGdGVuYW50ACRlOTMzOTNhNi1kODgyLTNiMDAtOTU0OC1iMThkYWZkZWY3MTa-71TeFdrerQ +data "dynatrace_management_zone" "CD_InCarExperienceServices_INT"{ name="CD_InCarExperienceServices" } +resource "dynatrace_alerting" "CD_InCarExperienceServices_INT" { + name = "CD_InCarExperienceServices INT" + management_zone = data.dynatrace_management_zone.CD_InCarExperienceServices_INT.id + rules { + rule { + delay_in_minutes = 0 + include_mode = "INCLUDE_ALL" + severity_level = "AVAILABILITY" + tags = [ "Environment:INT" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ALL" + severity_level = "CUSTOM_ALERT" + tags = [ "Environment:INT" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ALL" + severity_level = "ERRORS" + tags = [ "Environment:INT" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ALL" + severity_level = "PERFORMANCE" + tags = [ "Environment:INT" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ALL" + severity_level = "RESOURCE_CONTENTION" + tags = [ "Environment:INT" ] + } + } +} \ No newline at end of file diff --git a/NA_PREPROD/dashboard/cd_incarexperienceservices_int.tf b/NA_PREPROD/dashboard/cd_incarexperienceservices_int.tf new file mode 100644 index 00000000..13d62476 --- /dev/null +++ b/NA_PREPROD/dashboard/cd_incarexperienceservices_int.tf @@ -0,0 +1,357 @@ +# DEFINE dynatrace_dashboard.CD_InCarExperienceServices_INT.id = 4e9cd35d-bab9-4575-bdf8-e019c7fdcb28 +data "dynatrace_management_zone" "CD_InCarExperienceServices_INT"{ name="CD_InCarExperienceServices" } +resource "dynatrace_dashboard" "CD_InCarExperienceServices_INT" { + dashboard_metadata { + name = "CD_InCarExperienceServices INT" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "CD_InCarExperienceServices" ] + 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_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_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_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_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_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_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_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_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_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_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_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_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_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_INT.id + } + } + filter_config { + type = "HOST" + custom_name = "Hosts" + default_name = "Hosts" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "HOST" + match { + key = "AUTO_TAGS" + values = [ "Environment:INT" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/NA_PREPROD/dashboard/cd_incarexperienceservices_test.tf b/NA_PREPROD/dashboard/cd_incarexperienceservices_test.tf new file mode 100644 index 00000000..c5a6edaf --- /dev/null +++ b/NA_PREPROD/dashboard/cd_incarexperienceservices_test.tf @@ -0,0 +1,357 @@ +# DEFINE dynatrace_dashboard.CD_InCarExperienceServices_TEST.id = 9b4a1666-dca8-4f03-9570-b380430909b3 +data "dynatrace_management_zone" "CD_InCarExperienceServices_TEST"{ name="CD_InCarExperienceServices" } +resource "dynatrace_dashboard" "CD_InCarExperienceServices_TEST" { + dashboard_metadata { + name = "CD_InCarExperienceServices TEST" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "CD_InCarExperienceServices" ] + 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_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_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_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_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_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_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_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_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_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_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_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_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_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_TEST.id + } + } + filter_config { + type = "HOST" + custom_name = "Hosts" + default_name = "Hosts" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "HOST" + match { + key = "AUTO_TAGS" + values = [ "Environment:TEST" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/NA_PREPROD/management_zone/cd_incarexperienceservices.tf b/NA_PREPROD/management_zone/cd_incarexperienceservices.tf new file mode 100644 index 00000000..412c4311 --- /dev/null +++ b/NA_PREPROD/management_zone/cd_incarexperienceservices.tf @@ -0,0 +1,28 @@ +# DEFINE dynatrace_management_zone.CD_InCarExperienceServices.id = -2701557776959902144 +resource "dynatrace_management_zone" "CD_InCarExperienceServices" { + name = "CD_InCarExperienceServices" + entity_selector_based_rule { + enabled = true + selector =<<-EOT + type(PROCESS_GROUP_INSTANCE),tag("compass-id:ambient-music","compass-id:festive-mode","compass-id:ices-festivalmode","compass-id:ices-login","compass-id:ices-festivalmode-adminui","compass-id:ices-contentdelivery","compass-id:ices-ambientmusic","compass-id:ices-mymodes-manifest","compass-id:ices-mymodes-cache","compass-id:ices-mymodes-admin","compass-id:ices-mymodes-user","compass-id:ices-mymodes-event","compass-id:ices-mymodes-adminui") + EOT + } + entity_selector_based_rule { + enabled = true + selector =<<-EOT + type(Service),tag("compass-id:ambient-music","compass-id:festive-mode","compass-id:ices-festivalmode","compass-id:ices-login","compass-id:ices-festivalmode-adminui","compass-id:ices-contentdelivery","compass-id:ices-ambientmusic","compass-id:ices-mymodes-manifest","compass-id:ices-mymodes-cache","compass-id:ices-mymodes-admin","compass-id:ices-mymodes-user","compass-id:ices-mymodes-event","compass-id:ices-mymodes-adminui") + EOT + } + entity_selector_based_rule { + enabled = true + selector =<<-EOT + type(SERVICE),databaseName.exists(),toRelationship.calls(type(SERVICE),tag("compass-id:ambient-music","compass-id:festive-mode","compass-id:ices-festivalmode","compass-id:ices-login","compass-id:ices-festivalmode-adminui","compass-id:ices-contentdelivery","compass-id:ices-ambientmusic","compass-id:ices-mymodes-manifest","compass-id:ices-mymodes-cache","compass-id:ices-mymodes-admin","compass-id:ices-mymodes-user","compass-id:ices-mymodes-event","compass-id:ices-mymodes-adminui")) + EOT + } + entity_selector_based_rule { + enabled = true + selector =<<-EOT + type(HOST),tag("compass-id:ambient-music","compass-id:festive-mode","compass-id:ices-festivalmode","compass-id:ices-login","compass-id:ices-festivalmode-adminui","compass-id:ices-contentdelivery","compass-id:ices-ambientmusic","compass-id:ices-mymodes-manifest","compass-id:ices-mymodes-cache","compass-id:ices-mymodes-admin","compass-id:ices-mymodes-user","compass-id:ices-mymodes-event","compass-id:ices-mymodes-adminui") + EOT + } +} From 0cc336adc63f9eccf039600ec2e1b35f19f62e5f Mon Sep 17 00:00:00 2001 From: Patryk Gudalewicz Date: Wed, 1 Mar 2023 19:12:17 +0100 Subject: [PATCH 6/6] "Migrating from Monaco to Terraform for management zone: CD_InCarExperienceServices" --- .../cd_incarexperienceservices_prod.tf | 38 ++ .../cd_incarexperienceservices_e2e.tf | 357 ++++++++++++++++++ .../cd_incarexperienceservices_prod.tf | 357 ++++++++++++++++++ .../cd_incarexperienceservices.tf | 28 ++ 4 files changed, 780 insertions(+) create mode 100644 NA_PROD/alerting/cd_incarexperienceservices_prod.tf create mode 100644 NA_PROD/dashboard/cd_incarexperienceservices_e2e.tf create mode 100644 NA_PROD/dashboard/cd_incarexperienceservices_prod.tf create mode 100644 NA_PROD/management_zone/cd_incarexperienceservices.tf diff --git a/NA_PROD/alerting/cd_incarexperienceservices_prod.tf b/NA_PROD/alerting/cd_incarexperienceservices_prod.tf new file mode 100644 index 00000000..3f6b0df9 --- /dev/null +++ b/NA_PROD/alerting/cd_incarexperienceservices_prod.tf @@ -0,0 +1,38 @@ +# DEFINE dynatrace_alerting.CD_InCarExperienceServices_PROD.id = vu9U3hXa3q0AAAABABhidWlsdGluOmFsZXJ0aW5nLnByb2ZpbGUABnRlbmFudAAGdGVuYW50ACRjZmViZmIwNS02OGU3LTM2NWYtYTJlNy1jNzk4M2YzZWM3MGS-71TeFdrerQ +data "dynatrace_management_zone" "CD_InCarExperienceServices_PROD"{ name="CD_InCarExperienceServices" } +resource "dynatrace_alerting" "CD_InCarExperienceServices_PROD" { + name = "CD_InCarExperienceServices PROD" + management_zone = data.dynatrace_management_zone.CD_InCarExperienceServices_PROD.id + rules { + rule { + delay_in_minutes = 0 + include_mode = "INCLUDE_ALL" + severity_level = "AVAILABILITY" + tags = [ "Environment:PROD" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ALL" + severity_level = "CUSTOM_ALERT" + tags = [ "Environment:PROD" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ALL" + severity_level = "ERRORS" + tags = [ "Environment:PROD" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ALL" + severity_level = "PERFORMANCE" + tags = [ "Environment:PROD" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ALL" + severity_level = "RESOURCE_CONTENTION" + tags = [ "Environment:PROD" ] + } + } +} \ No newline at end of file diff --git a/NA_PROD/dashboard/cd_incarexperienceservices_e2e.tf b/NA_PROD/dashboard/cd_incarexperienceservices_e2e.tf new file mode 100644 index 00000000..9a72ce0f --- /dev/null +++ b/NA_PROD/dashboard/cd_incarexperienceservices_e2e.tf @@ -0,0 +1,357 @@ +# DEFINE dynatrace_dashboard.CD_InCarExperienceServices_E2E.id = 304dad24-83a7-42fc-b664-57bb26c47809 +data "dynatrace_management_zone" "CD_InCarExperienceServices_E2E"{ name="CD_InCarExperienceServices" } +resource "dynatrace_dashboard" "CD_InCarExperienceServices_E2E" { + dashboard_metadata { + name = "CD_InCarExperienceServices E2E" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "CD_InCarExperienceServices" ] + 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_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_E2E.id + } + } + filter_config { + type = "MIXED" + custom_name = "Failure rate (HTTP 4xx/5xx errors)" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#ff0000" + key = "nullbuiltin:service.errors.fivexx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956393463 + } + config { + custom_color = "#fff29a" + key = "nullbuiltin:service.errors.fourxx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956441725 + } + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fourxx.rate" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fivexx.rate" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:E2E" ] + } + } + } + } + } + tile { + name = "Problems" + configured = true + tile_type = "OPEN_PROBLEMS" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 950 + top = 38 + width = 152 + } + filter { + management_zone { + name = "CD_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_E2E.id + } + } + } + tile { + name = "Overall Health" + configured = true + tile_type = "HEADER" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 0 + width = 1064 + } + filter { + management_zone { + name = "CD_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_E2E.id + } + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 532 + width = 1064 + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 304 + left = 38 + top = 570 + width = 1064 + } + filter { + management_zone { + name = "CD_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_E2E.id + } + } + filter_config { + type = "MIXED" + custom_name = "Response time, Request Count and Number of Errors" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#008cdb" + key = "nullbuiltin:service.requestCount.total|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275720776 + } + config { + custom_color = "#b4e5f9" + key = "nullbuiltin:service.response.time|AVG|TOTAL|LINE|SERVICE" + last_modified = 1595275686773 + } + config { + custom_color = "#ef651f" + key = "nullbuiltin:service.errors.total.count|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275955999 + } + } + series { + type = "LINE" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.response.time" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.requestCount.total" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.total.count" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:E2E" ] + } + } + } + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 190 + width = 1064 + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "DATABASES_OVERVIEW" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 646 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_E2E.id + } + } + filter_config { + type = "DATABASE" + custom_name = "Databases" + default_name = "Databases" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "DATABASE" + match { + key = "AUTO_TAGS" + values = [ "Environment:E2E" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "SERVICES" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 342 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_E2E.id + } + } + filter_config { + type = "SERVICE" + custom_name = "Services" + default_name = "Services" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:E2E" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "HOSTS" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 38 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_E2E.id + } + } + filter_config { + type = "HOST" + custom_name = "Hosts" + default_name = "Hosts" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "HOST" + match { + key = "AUTO_TAGS" + values = [ "Environment:E2E" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/NA_PROD/dashboard/cd_incarexperienceservices_prod.tf b/NA_PROD/dashboard/cd_incarexperienceservices_prod.tf new file mode 100644 index 00000000..8fa224d2 --- /dev/null +++ b/NA_PROD/dashboard/cd_incarexperienceservices_prod.tf @@ -0,0 +1,357 @@ +# DEFINE dynatrace_dashboard.CD_InCarExperienceServices_PROD.id = 1d917d61-8d80-4247-abee-49d4eb316332 +data "dynatrace_management_zone" "CD_InCarExperienceServices_PROD"{ name="CD_InCarExperienceServices" } +resource "dynatrace_dashboard" "CD_InCarExperienceServices_PROD" { + dashboard_metadata { + name = "CD_InCarExperienceServices PROD" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "CD_InCarExperienceServices" ] + 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_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_PROD.id + } + } + filter_config { + type = "MIXED" + custom_name = "Failure rate (HTTP 4xx/5xx errors)" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#ff0000" + key = "nullbuiltin:service.errors.fivexx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956393463 + } + config { + custom_color = "#fff29a" + key = "nullbuiltin:service.errors.fourxx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956441725 + } + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fourxx.rate" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fivexx.rate" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:PROD" ] + } + } + } + } + } + tile { + name = "Problems" + configured = true + tile_type = "OPEN_PROBLEMS" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 950 + top = 38 + width = 152 + } + filter { + management_zone { + name = "CD_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_PROD.id + } + } + } + tile { + name = "Overall Health" + configured = true + tile_type = "HEADER" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 0 + width = 1064 + } + filter { + management_zone { + name = "CD_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_PROD.id + } + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 532 + width = 1064 + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 304 + left = 38 + top = 570 + width = 1064 + } + filter { + management_zone { + name = "CD_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_PROD.id + } + } + filter_config { + type = "MIXED" + custom_name = "Response time, Request Count and Number of Errors" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#008cdb" + key = "nullbuiltin:service.requestCount.total|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275720776 + } + config { + custom_color = "#b4e5f9" + key = "nullbuiltin:service.response.time|AVG|TOTAL|LINE|SERVICE" + last_modified = 1595275686773 + } + config { + custom_color = "#ef651f" + key = "nullbuiltin:service.errors.total.count|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275955999 + } + } + series { + type = "LINE" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.response.time" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.requestCount.total" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.total.count" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:PROD" ] + } + } + } + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 190 + width = 1064 + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "DATABASES_OVERVIEW" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 646 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_PROD.id + } + } + filter_config { + type = "DATABASE" + custom_name = "Databases" + default_name = "Databases" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "DATABASE" + match { + key = "AUTO_TAGS" + values = [ "Environment:PROD" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "SERVICES" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 342 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_PROD.id + } + } + filter_config { + type = "SERVICE" + custom_name = "Services" + default_name = "Services" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Environment:PROD" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "HOSTS" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 38 + top = 38 + width = 190 + } + filter { + management_zone { + name = "CD_InCarExperienceServices" + id = data.dynatrace_management_zone.CD_InCarExperienceServices_PROD.id + } + } + filter_config { + type = "HOST" + custom_name = "Hosts" + default_name = "Hosts" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "HOST" + match { + key = "AUTO_TAGS" + values = [ "Environment:PROD" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/NA_PROD/management_zone/cd_incarexperienceservices.tf b/NA_PROD/management_zone/cd_incarexperienceservices.tf new file mode 100644 index 00000000..6e25a8a7 --- /dev/null +++ b/NA_PROD/management_zone/cd_incarexperienceservices.tf @@ -0,0 +1,28 @@ +# DEFINE dynatrace_management_zone.CD_InCarExperienceServices.id = -4630576172387523602 +resource "dynatrace_management_zone" "CD_InCarExperienceServices" { + name = "CD_InCarExperienceServices" + entity_selector_based_rule { + enabled = true + selector =<<-EOT + type(PROCESS_GROUP_INSTANCE),tag("compass-id:ambient-music","compass-id:festive-mode","compass-id:ices-festivalmode","compass-id:ices-login","compass-id:ices-festivalmode-adminui","compass-id:ices-contentdelivery","compass-id:ices-ambientmusic","compass-id:ices-mymodes-manifest","compass-id:ices-mymodes-cache","compass-id:ices-mymodes-admin","compass-id:ices-mymodes-user","compass-id:ices-mymodes-event","compass-id:ices-mymodes-adminui") + EOT + } + entity_selector_based_rule { + enabled = true + selector =<<-EOT + type(HOST),tag("compass-id:ambient-music","compass-id:festive-mode","compass-id:ices-festivalmode","compass-id:ices-login","compass-id:ices-festivalmode-adminui","compass-id:ices-contentdelivery","compass-id:ices-ambientmusic","compass-id:ices-mymodes-manifest","compass-id:ices-mymodes-cache","compass-id:ices-mymodes-admin","compass-id:ices-mymodes-user","compass-id:ices-mymodes-event","compass-id:ices-mymodes-adminui") + EOT + } + entity_selector_based_rule { + enabled = true + selector =<<-EOT + type(Service),tag("compass-id:ambient-music","compass-id:festive-mode","compass-id:ices-festivalmode","compass-id:ices-login","compass-id:ices-festivalmode-adminui","compass-id:ices-contentdelivery","compass-id:ices-ambientmusic","compass-id:ices-mymodes-manifest","compass-id:ices-mymodes-cache","compass-id:ices-mymodes-admin","compass-id:ices-mymodes-user","compass-id:ices-mymodes-event","compass-id:ices-mymodes-adminui") + EOT + } + entity_selector_based_rule { + enabled = true + selector =<<-EOT + type(SERVICE),databaseName.exists(),toRelationship.calls(type(SERVICE),tag("compass-id:ambient-music","compass-id:festive-mode","compass-id:ices-festivalmode","compass-id:ices-login","compass-id:ices-festivalmode-adminui","compass-id:ices-contentdelivery","compass-id:ices-ambientmusic","compass-id:ices-mymodes-manifest","compass-id:ices-mymodes-cache","compass-id:ices-mymodes-admin","compass-id:ices-mymodes-user","compass-id:ices-mymodes-event","compass-id:ices-mymodes-adminui")) + EOT + } +}