From 5bb9c0ee2f139492be28418c7ca0e0d081f76a1e Mon Sep 17 00:00:00 2001 From: Patryk Gudalewicz Date: Wed, 1 Mar 2023 18:47:37 +0100 Subject: [PATCH 1/6] "Migrating from Monaco to Terraform for management zone: CD_Speech" --- CN_PREPROD/alerting/cd_speech_htts.tf | 44 ++++ CN_PREPROD/alerting/cd_speech_hvd.tf | 44 ++++ CN_PREPROD/alerting/cd_speech_int.tf | 38 +++ CN_PREPROD/dashboard/cd_speech_int.tf | 294 ++++++++++++++++++++++++ CN_PREPROD/dashboard/cd_speech_test.tf | 294 ++++++++++++++++++++++++ CN_PREPROD/management_zone/cd_speech.tf | 95 ++++++++ 6 files changed, 809 insertions(+) create mode 100644 CN_PREPROD/alerting/cd_speech_htts.tf create mode 100644 CN_PREPROD/alerting/cd_speech_hvd.tf create mode 100644 CN_PREPROD/alerting/cd_speech_int.tf create mode 100644 CN_PREPROD/dashboard/cd_speech_int.tf create mode 100644 CN_PREPROD/dashboard/cd_speech_test.tf create mode 100644 CN_PREPROD/management_zone/cd_speech.tf diff --git a/CN_PREPROD/alerting/cd_speech_htts.tf b/CN_PREPROD/alerting/cd_speech_htts.tf new file mode 100644 index 00000000..4c7559fa --- /dev/null +++ b/CN_PREPROD/alerting/cd_speech_htts.tf @@ -0,0 +1,44 @@ +# DEFINE dynatrace_alerting.CD_Speech_HTTS.id = vu9U3hXa3q0AAAABABhidWlsdGluOmFsZXJ0aW5nLnByb2ZpbGUABnRlbmFudAAGdGVuYW50ACQ3YzY2OGNjYi1hMjM0LTQwMTQtOGI3Zi0zNDQ3ZjliZGU5YTO-71TeFdrerQ +data "dynatrace_management_zone" "CD_Speech_HTTS"{ name="CD_Speech" } +resource "dynatrace_alerting" "CD_Speech_HTTS" { + name = "CD_Speech HTTS" + management_zone = data.dynatrace_management_zone.CD_Speech_HTTS.id + rules { + rule { + delay_in_minutes = 0 + include_mode = "INCLUDE_ANY" + severity_level = "AVAILABILITY" + tags = [ "Component:HTTS" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ANY" + severity_level = "CUSTOM_ALERT" + tags = [ "Component:HTTS" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ANY" + severity_level = "ERRORS" + tags = [ "Component:HTTS" ] + } + rule { + delay_in_minutes = 0 + include_mode = "INCLUDE_ANY" + severity_level = "MONITORING_UNAVAILABLE" + tags = [ "Component:HTTS" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ANY" + severity_level = "PERFORMANCE" + tags = [ "Component:HTTS" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ANY" + severity_level = "RESOURCE_CONTENTION" + tags = [ "Component:HTTS" ] + } + } +} \ No newline at end of file diff --git a/CN_PREPROD/alerting/cd_speech_hvd.tf b/CN_PREPROD/alerting/cd_speech_hvd.tf new file mode 100644 index 00000000..785be9ee --- /dev/null +++ b/CN_PREPROD/alerting/cd_speech_hvd.tf @@ -0,0 +1,44 @@ +# DEFINE dynatrace_alerting.CD_Speech_HVD.id = vu9U3hXa3q0AAAABABhidWlsdGluOmFsZXJ0aW5nLnByb2ZpbGUABnRlbmFudAAGdGVuYW50ACQxY2EyYTQ1OS1jYjY0LTRhMTEtYmYzZC1kZmE5ZjNhODE4OTW-71TeFdrerQ +data "dynatrace_management_zone" "CD_Speech_HVD"{ name="CD_Speech" } +resource "dynatrace_alerting" "CD_Speech_HVD" { + name = "CD_Speech HVD" + management_zone = data.dynatrace_management_zone.CD_Speech_HVD.id + rules { + rule { + delay_in_minutes = 0 + include_mode = "INCLUDE_ANY" + severity_level = "AVAILABILITY" + tags = [ "Component:HVD" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ANY" + severity_level = "CUSTOM_ALERT" + tags = [ "Component:HVD" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ANY" + severity_level = "ERRORS" + tags = [ "Component:HVD" ] + } + rule { + delay_in_minutes = 0 + include_mode = "INCLUDE_ANY" + severity_level = "MONITORING_UNAVAILABLE" + tags = [ "Component:HVD" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ANY" + severity_level = "PERFORMANCE" + tags = [ "Component:HVD" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ANY" + severity_level = "RESOURCE_CONTENTION" + tags = [ "Component:HVD" ] + } + } +} \ No newline at end of file diff --git a/CN_PREPROD/alerting/cd_speech_int.tf b/CN_PREPROD/alerting/cd_speech_int.tf new file mode 100644 index 00000000..4b6ec673 --- /dev/null +++ b/CN_PREPROD/alerting/cd_speech_int.tf @@ -0,0 +1,38 @@ +# DEFINE dynatrace_alerting.CD_Speech_INT.id = vu9U3hXa3q0AAAABABhidWlsdGluOmFsZXJ0aW5nLnByb2ZpbGUABnRlbmFudAAGdGVuYW50ACQxNmVlY2MyYS05MWQ5LTQ0ZTAtYmM3Mi0zZjdhYmIyNjc2ODG-71TeFdrerQ +data "dynatrace_management_zone" "CD_Speech_INT"{ name="CD_Speech" } +resource "dynatrace_alerting" "CD_Speech_INT" { + name = "CD_Speech INT" + management_zone = data.dynatrace_management_zone.CD_Speech_INT.id + rules { + rule { + delay_in_minutes = 0 + include_mode = "INCLUDE_ALL" + severity_level = "AVAILABILITY" + tags = [ "Component:Speech", "Environment:INT" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ALL" + severity_level = "CUSTOM_ALERT" + tags = [ "Component:Speech", "Environment:INT" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ALL" + severity_level = "ERRORS" + tags = [ "Component:Speech", "Environment:INT" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ALL" + severity_level = "PERFORMANCE" + tags = [ "Component:Speech", "Environment:INT" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ALL" + severity_level = "RESOURCE_CONTENTION" + tags = [ "Component:Speech", "Environment:INT" ] + } + } +} \ No newline at end of file diff --git a/CN_PREPROD/dashboard/cd_speech_int.tf b/CN_PREPROD/dashboard/cd_speech_int.tf new file mode 100644 index 00000000..d783ac29 --- /dev/null +++ b/CN_PREPROD/dashboard/cd_speech_int.tf @@ -0,0 +1,294 @@ +# DEFINE dynatrace_dashboard.CD_Speech_INT.id = 73cf246b-f35a-4391-9ff1-7417f4a215ac +data "dynatrace_management_zone" "CD_Speech_INT"{ name="CD_Speech" } +resource "dynatrace_dashboard" "CD_Speech_INT" { + dashboard_metadata { + name = "CD_Speech INT" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "Speech" ] + filter { + timeframe = "-24h to now" + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + bounds { + height = 304 + left = 38 + top = 228 + width = 1064 + } + filter_config { + type = "MIXED" + custom_name = "Failure rate (HTTP 4xx/5xx errors)" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#ff0000" + key = "nullbuiltin:service.errors.fivexx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956393463 + } + config { + custom_color = "#fff29a" + key = "nullbuiltin:service.errors.fourxx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956441725 + } + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fourxx.rate" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fivexx.rate" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Component:Speech", "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_Speech" + id = data.dynatrace_management_zone.CD_Speech_INT.id + } + } + } + tile { + name = "Overall Health" + configured = true + tile_type = "HEADER" + bounds { + height = 38 + left = 38 + top = 0 + width = 1064 + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + bounds { + height = 38 + left = 38 + top = 532 + width = 1064 + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + bounds { + height = 304 + left = 38 + top = 570 + width = 1064 + } + filter_config { + type = "MIXED" + custom_name = "Response time, Request Count and Number of Errors" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#008cdb" + key = "nullbuiltin:service.requestCount.total|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275720776 + } + config { + custom_color = "#b4e5f9" + key = "nullbuiltin:service.response.time|AVG|TOTAL|LINE|SERVICE" + last_modified = 1595275686773 + } + config { + custom_color = "#ef651f" + key = "nullbuiltin:service.errors.total.count|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275955999 + } + } + series { + type = "LINE" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.response.time" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.requestCount.total" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.total.count" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Component:Speech", "Environment:INT" ] + } + } + } + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + bounds { + height = 38 + left = 38 + top = 190 + width = 1064 + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "DATABASES_OVERVIEW" + bounds { + height = 152 + left = 646 + top = 38 + width = 190 + } + filter_config { + type = "DATABASE" + custom_name = "Databases" + default_name = "Databases" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "DATABASE" + match { + key = "AUTO_TAGS" + values = [ "Component:Speech", "Environment:INT" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "SERVICES" + bounds { + height = 152 + left = 342 + top = 38 + width = 190 + } + filter_config { + type = "SERVICE" + custom_name = "Services" + default_name = "Services" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Component:Speech", "Environment:INT" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "HOSTS" + bounds { + height = 152 + left = 38 + top = 38 + width = 190 + } + filter_config { + type = "HOST" + custom_name = "Hosts" + default_name = "Hosts" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "HOST" + match { + key = "AUTO_TAGS" + values = [ "Component:Speech", "Environment:INT" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/CN_PREPROD/dashboard/cd_speech_test.tf b/CN_PREPROD/dashboard/cd_speech_test.tf new file mode 100644 index 00000000..d0e8dea9 --- /dev/null +++ b/CN_PREPROD/dashboard/cd_speech_test.tf @@ -0,0 +1,294 @@ +# DEFINE dynatrace_dashboard.CD_Speech_TEST.id = 643bcee4-9d90-4df1-8e2d-0a5d3cf7df41 +data "dynatrace_management_zone" "CD_Speech_TEST"{ name="CD_Speech" } +resource "dynatrace_dashboard" "CD_Speech_TEST" { + dashboard_metadata { + name = "CD_Speech TEST" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "Speech" ] + filter { + timeframe = "-24h to now" + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + bounds { + height = 304 + left = 38 + top = 228 + width = 1064 + } + filter_config { + type = "MIXED" + custom_name = "Failure rate (HTTP 4xx/5xx errors)" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#ff0000" + key = "nullbuiltin:service.errors.fivexx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956393463 + } + config { + custom_color = "#fff29a" + key = "nullbuiltin:service.errors.fourxx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956441725 + } + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fourxx.rate" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fivexx.rate" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Component:Speech", "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_Speech" + id = data.dynatrace_management_zone.CD_Speech_TEST.id + } + } + } + tile { + name = "Overall Health" + configured = true + tile_type = "HEADER" + bounds { + height = 38 + left = 38 + top = 0 + width = 1064 + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + bounds { + height = 38 + left = 38 + top = 532 + width = 1064 + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + bounds { + height = 304 + left = 38 + top = 570 + width = 1064 + } + filter_config { + type = "MIXED" + custom_name = "Response time, Request Count and Number of Errors" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#008cdb" + key = "nullbuiltin:service.requestCount.total|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275720776 + } + config { + custom_color = "#b4e5f9" + key = "nullbuiltin:service.response.time|AVG|TOTAL|LINE|SERVICE" + last_modified = 1595275686773 + } + config { + custom_color = "#ef651f" + key = "nullbuiltin:service.errors.total.count|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275955999 + } + } + series { + type = "LINE" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.response.time" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.requestCount.total" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.total.count" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Component:Speech", "Environment:TEST" ] + } + } + } + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + bounds { + height = 38 + left = 38 + top = 190 + width = 1064 + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "DATABASES_OVERVIEW" + bounds { + height = 152 + left = 646 + top = 38 + width = 190 + } + filter_config { + type = "DATABASE" + custom_name = "Databases" + default_name = "Databases" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "DATABASE" + match { + key = "AUTO_TAGS" + values = [ "Component:Speech", "Environment:TEST" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "SERVICES" + bounds { + height = 152 + left = 342 + top = 38 + width = 190 + } + filter_config { + type = "SERVICE" + custom_name = "Services" + default_name = "Services" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Component:Speech", "Environment:TEST" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "HOSTS" + bounds { + height = 152 + left = 38 + top = 38 + width = 190 + } + filter_config { + type = "HOST" + custom_name = "Hosts" + default_name = "Hosts" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "HOST" + match { + key = "AUTO_TAGS" + values = [ "Component:Speech", "Environment:TEST" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/CN_PREPROD/management_zone/cd_speech.tf b/CN_PREPROD/management_zone/cd_speech.tf new file mode 100644 index 00000000..a1687266 --- /dev/null +++ b/CN_PREPROD/management_zone/cd_speech.tf @@ -0,0 +1,95 @@ +# DEFINE dynatrace_management_zone.CD_Speech.id = -2862030380634840431 +resource "dynatrace_management_zone" "CD_Speech" { + name = "CD_Speech" + rules { + type = "CLOUD_APPLICATION" + enabled = true + conditions { + key { + type = "STATIC" + attribute = "CLOUD_APPLICATION_NAME" + } + string { + case_sensitive = true + # negate = false + operator = "CONTAINS" + value = "Speech" + } + } + } + rules { + type = "CLOUD_APPLICATION_NAMESPACE" + enabled = true + conditions { + key { + type = "STATIC" + attribute = "CLOUD_APPLICATION_NAMESPACE_NAME" + } + string { + case_sensitive = true + # negate = false + operator = "CONTAINS" + value = "Speech" + } + } + } + rules { + type = "HOST" + enabled = true + conditions { + key { + type = "STATIC" + attribute = "HOST_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = "Component" + value = "Speech" + } + } + } + } + rules { + type = "PROCESS_GROUP" + enabled = true + propagation_types = [ "PROCESS_GROUP_TO_HOST" ] + conditions { + key { + type = "STATIC" + attribute = "PROCESS_GROUP_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = "Component" + value = "Speech" + } + } + } + } + rules { + type = "SERVICE" + enabled = true + propagation_types = [ "SERVICE_TO_HOST_LIKE", "SERVICE_TO_PROCESS_GROUP_LIKE" ] + conditions { + key { + type = "STATIC" + attribute = "SERVICE_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = "Component" + value = "Speech" + } + } + } + } +} From 275f005267d79d1770695c0cc85af7ca7604fc7f Mon Sep 17 00:00:00 2001 From: Patryk Gudalewicz Date: Wed, 1 Mar 2023 18:53:12 +0100 Subject: [PATCH 2/6] "Migrating from Monaco to Terraform for management zone: CD_Speech" --- CN_PROD/alerting/cd_speech_htts.tf | 44 ++++ CN_PROD/alerting/cd_speech_hvd.tf | 44 ++++ CN_PROD/alerting/cd_speech_prod.tf | 38 ++++ CN_PROD/dashboard/cd_speech_prod.tf | 294 +++++++++++++++++++++++++++ CN_PROD/management_zone/cd_speech.tf | 95 +++++++++ 5 files changed, 515 insertions(+) create mode 100644 CN_PROD/alerting/cd_speech_htts.tf create mode 100644 CN_PROD/alerting/cd_speech_hvd.tf create mode 100644 CN_PROD/alerting/cd_speech_prod.tf create mode 100644 CN_PROD/dashboard/cd_speech_prod.tf create mode 100644 CN_PROD/management_zone/cd_speech.tf diff --git a/CN_PROD/alerting/cd_speech_htts.tf b/CN_PROD/alerting/cd_speech_htts.tf new file mode 100644 index 00000000..045e9e69 --- /dev/null +++ b/CN_PROD/alerting/cd_speech_htts.tf @@ -0,0 +1,44 @@ +# DEFINE dynatrace_alerting.CD_Speech_HTTS.id = vu9U3hXa3q0AAAABABhidWlsdGluOmFsZXJ0aW5nLnByb2ZpbGUABnRlbmFudAAGdGVuYW50ACQ4YmU4ZWIxNy0zYjI2LTQ3YzItYjU5Zi01MWY5MGFkMzc4NGO-71TeFdrerQ +data "dynatrace_management_zone" "CD_Speech_HTTS"{ name="CD_Speech" } +resource "dynatrace_alerting" "CD_Speech_HTTS" { + name = "CD_Speech HTTS" + management_zone = data.dynatrace_management_zone.CD_Speech_HTTS.id + rules { + rule { + delay_in_minutes = 0 + include_mode = "INCLUDE_ANY" + severity_level = "AVAILABILITY" + tags = [ "Component:HTTS" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ANY" + severity_level = "CUSTOM_ALERT" + tags = [ "Component:HTTS" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ANY" + severity_level = "ERRORS" + tags = [ "Component:HTTS" ] + } + rule { + delay_in_minutes = 0 + include_mode = "INCLUDE_ANY" + severity_level = "MONITORING_UNAVAILABLE" + tags = [ "Component:HTTS" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ANY" + severity_level = "PERFORMANCE" + tags = [ "Component:HTTS" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ANY" + severity_level = "RESOURCE_CONTENTION" + tags = [ "Component:HTTS" ] + } + } +} \ No newline at end of file diff --git a/CN_PROD/alerting/cd_speech_hvd.tf b/CN_PROD/alerting/cd_speech_hvd.tf new file mode 100644 index 00000000..b6464a3e --- /dev/null +++ b/CN_PROD/alerting/cd_speech_hvd.tf @@ -0,0 +1,44 @@ +# DEFINE dynatrace_alerting.CD_Speech_HVD.id = vu9U3hXa3q0AAAABABhidWlsdGluOmFsZXJ0aW5nLnByb2ZpbGUABnRlbmFudAAGdGVuYW50ACRjNTYxNmI5Yy1iZDQxLTQ2MDgtYTdmMS03OGJhYjAwN2NlZGO-71TeFdrerQ +data "dynatrace_management_zone" "CD_Speech_HVD"{ name="CD_Speech" } +resource "dynatrace_alerting" "CD_Speech_HVD" { + name = "CD_Speech HVD" + management_zone = data.dynatrace_management_zone.CD_Speech_HVD.id + rules { + rule { + delay_in_minutes = 0 + include_mode = "INCLUDE_ANY" + severity_level = "AVAILABILITY" + tags = [ "Component:HVD" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ANY" + severity_level = "CUSTOM_ALERT" + tags = [ "Component:HVD" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ANY" + severity_level = "ERRORS" + tags = [ "Component:HVD" ] + } + rule { + delay_in_minutes = 0 + include_mode = "INCLUDE_ANY" + severity_level = "MONITORING_UNAVAILABLE" + tags = [ "Component:HVD" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ANY" + severity_level = "PERFORMANCE" + tags = [ "Component:HVD" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ANY" + severity_level = "RESOURCE_CONTENTION" + tags = [ "Component:HVD" ] + } + } +} \ No newline at end of file diff --git a/CN_PROD/alerting/cd_speech_prod.tf b/CN_PROD/alerting/cd_speech_prod.tf new file mode 100644 index 00000000..37e6e15a --- /dev/null +++ b/CN_PROD/alerting/cd_speech_prod.tf @@ -0,0 +1,38 @@ +# DEFINE dynatrace_alerting.CD_Speech_PROD.id = vu9U3hXa3q0AAAABABhidWlsdGluOmFsZXJ0aW5nLnByb2ZpbGUABnRlbmFudAAGdGVuYW50ACQ4NzlmMDU5My1hZWIxLTQ4NDAtYTI0NS0wOWYzMGJjODI5ZWK-71TeFdrerQ +data "dynatrace_management_zone" "CD_Speech_PROD"{ name="CD_Speech" } +resource "dynatrace_alerting" "CD_Speech_PROD" { + name = "CD_Speech PROD" + management_zone = data.dynatrace_management_zone.CD_Speech_PROD.id + rules { + rule { + delay_in_minutes = 0 + include_mode = "INCLUDE_ALL" + severity_level = "AVAILABILITY" + tags = [ "Component:Speech", "Environment:PROD" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ALL" + severity_level = "CUSTOM_ALERT" + tags = [ "Component:Speech", "Environment:PROD" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ALL" + severity_level = "ERRORS" + tags = [ "Component:Speech", "Environment:PROD" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ALL" + severity_level = "PERFORMANCE" + tags = [ "Component:Speech", "Environment:PROD" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ALL" + severity_level = "RESOURCE_CONTENTION" + tags = [ "Component:Speech", "Environment:PROD" ] + } + } +} \ No newline at end of file diff --git a/CN_PROD/dashboard/cd_speech_prod.tf b/CN_PROD/dashboard/cd_speech_prod.tf new file mode 100644 index 00000000..9b3230f9 --- /dev/null +++ b/CN_PROD/dashboard/cd_speech_prod.tf @@ -0,0 +1,294 @@ +# DEFINE dynatrace_dashboard.CD_Speech_PROD.id = a6522b4f-96c5-41f9-8940-2203607fb575 +data "dynatrace_management_zone" "CD_Speech_PROD"{ name="CD_Speech" } +resource "dynatrace_dashboard" "CD_Speech_PROD" { + dashboard_metadata { + name = "CD_Speech PROD" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "Speech" ] + filter { + timeframe = "-24h to now" + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + bounds { + height = 304 + left = 38 + top = 228 + width = 1064 + } + filter_config { + type = "MIXED" + custom_name = "Failure rate (HTTP 4xx/5xx errors)" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#ff0000" + key = "nullbuiltin:service.errors.fivexx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956393463 + } + config { + custom_color = "#fff29a" + key = "nullbuiltin:service.errors.fourxx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956441725 + } + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fourxx.rate" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fivexx.rate" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Component:Speech", "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_Speech" + id = data.dynatrace_management_zone.CD_Speech_PROD.id + } + } + } + tile { + name = "Overall Health" + configured = true + tile_type = "HEADER" + bounds { + height = 38 + left = 38 + top = 0 + width = 1064 + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + bounds { + height = 38 + left = 38 + top = 532 + width = 1064 + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + bounds { + height = 304 + left = 38 + top = 570 + width = 1064 + } + filter_config { + type = "MIXED" + custom_name = "Response time, Request Count and Number of Errors" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#008cdb" + key = "nullbuiltin:service.requestCount.total|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275720776 + } + config { + custom_color = "#b4e5f9" + key = "nullbuiltin:service.response.time|AVG|TOTAL|LINE|SERVICE" + last_modified = 1595275686773 + } + config { + custom_color = "#ef651f" + key = "nullbuiltin:service.errors.total.count|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275955999 + } + } + series { + type = "LINE" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.response.time" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.requestCount.total" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.total.count" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Component:Speech", "Environment:PROD" ] + } + } + } + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + bounds { + height = 38 + left = 38 + top = 190 + width = 1064 + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "DATABASES_OVERVIEW" + bounds { + height = 152 + left = 646 + top = 38 + width = 190 + } + filter_config { + type = "DATABASE" + custom_name = "Databases" + default_name = "Databases" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "DATABASE" + match { + key = "AUTO_TAGS" + values = [ "Component:Speech", "Environment:PROD" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "SERVICES" + bounds { + height = 152 + left = 342 + top = 38 + width = 190 + } + filter_config { + type = "SERVICE" + custom_name = "Services" + default_name = "Services" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Component:Speech", "Environment:PROD" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "HOSTS" + bounds { + height = 152 + left = 38 + top = 38 + width = 190 + } + filter_config { + type = "HOST" + custom_name = "Hosts" + default_name = "Hosts" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "HOST" + match { + key = "AUTO_TAGS" + values = [ "Component:Speech", "Environment:PROD" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/CN_PROD/management_zone/cd_speech.tf b/CN_PROD/management_zone/cd_speech.tf new file mode 100644 index 00000000..d2ffa9e4 --- /dev/null +++ b/CN_PROD/management_zone/cd_speech.tf @@ -0,0 +1,95 @@ +# DEFINE dynatrace_management_zone.CD_Speech.id = 4180433676688433156 +resource "dynatrace_management_zone" "CD_Speech" { + name = "CD_Speech" + rules { + type = "CLOUD_APPLICATION" + enabled = true + conditions { + key { + type = "STATIC" + attribute = "CLOUD_APPLICATION_NAME" + } + string { + case_sensitive = true + # negate = false + operator = "CONTAINS" + value = "Speech" + } + } + } + rules { + type = "CLOUD_APPLICATION_NAMESPACE" + enabled = true + conditions { + key { + type = "STATIC" + attribute = "CLOUD_APPLICATION_NAMESPACE_NAME" + } + string { + case_sensitive = true + # negate = false + operator = "CONTAINS" + value = "Speech" + } + } + } + rules { + type = "HOST" + enabled = true + conditions { + key { + type = "STATIC" + attribute = "HOST_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = "Component" + value = "Speech" + } + } + } + } + rules { + type = "PROCESS_GROUP" + enabled = true + propagation_types = [ "PROCESS_GROUP_TO_HOST" ] + conditions { + key { + type = "STATIC" + attribute = "PROCESS_GROUP_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = "Component" + value = "Speech" + } + } + } + } + rules { + type = "SERVICE" + enabled = true + propagation_types = [ "SERVICE_TO_HOST_LIKE", "SERVICE_TO_PROCESS_GROUP_LIKE" ] + conditions { + key { + type = "STATIC" + attribute = "SERVICE_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = "Component" + value = "Speech" + } + } + } + } +} From 844d618339cb5899847e8c899a634f59331adf0f Mon Sep 17 00:00:00 2001 From: Patryk Gudalewicz Date: Wed, 1 Mar 2023 18:57:45 +0100 Subject: [PATCH 3/6] "Migrating from Monaco to Terraform for management zone: CD_Speech" --- EMEA_PREPROD/alerting/cd_speech_htts.tf | 44 +++ EMEA_PREPROD/alerting/cd_speech_hvd.tf | 44 +++ EMEA_PREPROD/dashboard/cd_speech_int.tf | 357 ++++++++++++++++++++++ EMEA_PREPROD/dashboard/cd_speech_test.tf | 357 ++++++++++++++++++++++ EMEA_PREPROD/management_zone/cd_speech.tf | 95 ++++++ 5 files changed, 897 insertions(+) create mode 100644 EMEA_PREPROD/alerting/cd_speech_htts.tf create mode 100644 EMEA_PREPROD/alerting/cd_speech_hvd.tf create mode 100644 EMEA_PREPROD/dashboard/cd_speech_int.tf create mode 100644 EMEA_PREPROD/dashboard/cd_speech_test.tf create mode 100644 EMEA_PREPROD/management_zone/cd_speech.tf diff --git a/EMEA_PREPROD/alerting/cd_speech_htts.tf b/EMEA_PREPROD/alerting/cd_speech_htts.tf new file mode 100644 index 00000000..9ed3d8d5 --- /dev/null +++ b/EMEA_PREPROD/alerting/cd_speech_htts.tf @@ -0,0 +1,44 @@ +# DEFINE dynatrace_alerting.CD_Speech_HTTS.id = vu9U3hXa3q0AAAABABhidWlsdGluOmFsZXJ0aW5nLnByb2ZpbGUABnRlbmFudAAGdGVuYW50ACQyZjE5ZmEwYy0xZDg2LTQxMzAtOGNjZC04MDc3YWU3ZmZhMmO-71TeFdrerQ +data "dynatrace_management_zone" "CD_Speech_HTTS"{ name="CD_Speech" } +resource "dynatrace_alerting" "CD_Speech_HTTS" { + name = "CD_Speech HTTS" + management_zone = data.dynatrace_management_zone.CD_Speech_HTTS.id + rules { + rule { + delay_in_minutes = 0 + include_mode = "INCLUDE_ANY" + severity_level = "AVAILABILITY" + tags = [ "Component:HTTS" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ANY" + severity_level = "CUSTOM_ALERT" + tags = [ "Component:HTTS" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ANY" + severity_level = "ERRORS" + tags = [ "Component:HTTS" ] + } + rule { + delay_in_minutes = 0 + include_mode = "INCLUDE_ANY" + severity_level = "MONITORING_UNAVAILABLE" + tags = [ "Component:HTTS" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ANY" + severity_level = "PERFORMANCE" + tags = [ "Component:HTTS" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ANY" + severity_level = "RESOURCE_CONTENTION" + tags = [ "Component:HTTS" ] + } + } +} \ No newline at end of file diff --git a/EMEA_PREPROD/alerting/cd_speech_hvd.tf b/EMEA_PREPROD/alerting/cd_speech_hvd.tf new file mode 100644 index 00000000..3cf48fef --- /dev/null +++ b/EMEA_PREPROD/alerting/cd_speech_hvd.tf @@ -0,0 +1,44 @@ +# DEFINE dynatrace_alerting.CD_Speech_HVD.id = vu9U3hXa3q0AAAABABhidWlsdGluOmFsZXJ0aW5nLnByb2ZpbGUABnRlbmFudAAGdGVuYW50ACQ5NmUyNjM0Mi02ZjAyLTQ1MWItYTc3Ny0xZmMyZjhiNmEyYWW-71TeFdrerQ +data "dynatrace_management_zone" "CD_Speech_HVD"{ name="CD_Speech" } +resource "dynatrace_alerting" "CD_Speech_HVD" { + name = "CD_Speech HVD" + management_zone = data.dynatrace_management_zone.CD_Speech_HVD.id + rules { + rule { + delay_in_minutes = 0 + include_mode = "INCLUDE_ANY" + severity_level = "AVAILABILITY" + tags = [ "Component:HVD" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ANY" + severity_level = "CUSTOM_ALERT" + tags = [ "Component:HVD" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ANY" + severity_level = "ERRORS" + tags = [ "Component:HVD" ] + } + rule { + delay_in_minutes = 0 + include_mode = "INCLUDE_ANY" + severity_level = "MONITORING_UNAVAILABLE" + tags = [ "Component:HVD" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ANY" + severity_level = "PERFORMANCE" + tags = [ "Component:HVD" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ANY" + severity_level = "RESOURCE_CONTENTION" + tags = [ "Component:HVD" ] + } + } +} \ No newline at end of file diff --git a/EMEA_PREPROD/dashboard/cd_speech_int.tf b/EMEA_PREPROD/dashboard/cd_speech_int.tf new file mode 100644 index 00000000..648a8b1b --- /dev/null +++ b/EMEA_PREPROD/dashboard/cd_speech_int.tf @@ -0,0 +1,357 @@ +# DEFINE dynatrace_dashboard.CD_Speech_INT.id = 38376f6b-9d97-45be-9067-f06cda959244 +data "dynatrace_management_zone" "CD_Speech_INT"{ name="CD_Speech" } +resource "dynatrace_dashboard" "CD_Speech_INT" { + dashboard_metadata { + name = "CD_Speech INT" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "CD_Speech" ] + 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_Speech" + id = data.dynatrace_management_zone.CD_Speech_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_Speech" + id = data.dynatrace_management_zone.CD_Speech_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_Speech" + id = data.dynatrace_management_zone.CD_Speech_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_Speech" + id = data.dynatrace_management_zone.CD_Speech_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_Speech" + id = data.dynatrace_management_zone.CD_Speech_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_Speech" + id = data.dynatrace_management_zone.CD_Speech_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_Speech" + id = data.dynatrace_management_zone.CD_Speech_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_speech_test.tf b/EMEA_PREPROD/dashboard/cd_speech_test.tf new file mode 100644 index 00000000..48f9f518 --- /dev/null +++ b/EMEA_PREPROD/dashboard/cd_speech_test.tf @@ -0,0 +1,357 @@ +# DEFINE dynatrace_dashboard.CD_Speech_TEST.id = c00d9c4a-1289-445a-a55f-17c3c9497c70 +data "dynatrace_management_zone" "CD_Speech_TEST"{ name="CD_Speech" } +resource "dynatrace_dashboard" "CD_Speech_TEST" { + dashboard_metadata { + name = "CD_Speech TEST" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "CD_Speech" ] + 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_Speech" + id = data.dynatrace_management_zone.CD_Speech_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_Speech" + id = data.dynatrace_management_zone.CD_Speech_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_Speech" + id = data.dynatrace_management_zone.CD_Speech_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_Speech" + id = data.dynatrace_management_zone.CD_Speech_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_Speech" + id = data.dynatrace_management_zone.CD_Speech_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_Speech" + id = data.dynatrace_management_zone.CD_Speech_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_Speech" + id = data.dynatrace_management_zone.CD_Speech_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_speech.tf b/EMEA_PREPROD/management_zone/cd_speech.tf new file mode 100644 index 00000000..8b6dc6d5 --- /dev/null +++ b/EMEA_PREPROD/management_zone/cd_speech.tf @@ -0,0 +1,95 @@ +# DEFINE dynatrace_management_zone.CD_Speech.id = 5235727476777724379 +resource "dynatrace_management_zone" "CD_Speech" { + name = "CD_Speech" + rules { + type = "CLOUD_APPLICATION" + enabled = true + conditions { + key { + type = "STATIC" + attribute = "CLOUD_APPLICATION_NAME" + } + string { + case_sensitive = true + # negate = false + operator = "CONTAINS" + value = "Speech" + } + } + } + rules { + type = "CLOUD_APPLICATION_NAMESPACE" + enabled = true + conditions { + key { + type = "STATIC" + attribute = "CLOUD_APPLICATION_NAMESPACE_NAME" + } + string { + case_sensitive = true + # negate = false + operator = "CONTAINS" + value = "Speech" + } + } + } + rules { + type = "HOST" + enabled = true + conditions { + key { + type = "STATIC" + attribute = "HOST_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = "Component" + value = "Speech" + } + } + } + } + rules { + type = "PROCESS_GROUP" + enabled = true + propagation_types = [ "PROCESS_GROUP_TO_HOST" ] + conditions { + key { + type = "STATIC" + attribute = "PROCESS_GROUP_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = "Component" + value = "Speech" + } + } + } + } + rules { + type = "SERVICE" + enabled = true + propagation_types = [ "SERVICE_TO_HOST_LIKE", "SERVICE_TO_PROCESS_GROUP_LIKE" ] + conditions { + key { + type = "STATIC" + attribute = "SERVICE_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = "Component" + value = "Speech" + } + } + } + } +} From f8f3530c1884c80ca8bb8012191f71d75282ee22 Mon Sep 17 00:00:00 2001 From: Patryk Gudalewicz Date: Wed, 1 Mar 2023 19:06:38 +0100 Subject: [PATCH 4/6] "Migrating from Monaco to Terraform for management zone: CD_Speech" --- EMEA_PROD/alerting/cd_speech_htts.tf | 44 ++++ EMEA_PROD/alerting/cd_speech_hvd.tf | 44 ++++ EMEA_PROD/dashboard/cd_speech_prod.tf | 321 +++++++++++++++++++++++++ EMEA_PROD/management_zone/cd_speech.tf | 95 ++++++++ 4 files changed, 504 insertions(+) create mode 100644 EMEA_PROD/alerting/cd_speech_htts.tf create mode 100644 EMEA_PROD/alerting/cd_speech_hvd.tf create mode 100644 EMEA_PROD/dashboard/cd_speech_prod.tf create mode 100644 EMEA_PROD/management_zone/cd_speech.tf diff --git a/EMEA_PROD/alerting/cd_speech_htts.tf b/EMEA_PROD/alerting/cd_speech_htts.tf new file mode 100644 index 00000000..3bc4da05 --- /dev/null +++ b/EMEA_PROD/alerting/cd_speech_htts.tf @@ -0,0 +1,44 @@ +# DEFINE dynatrace_alerting.CD_Speech_HTTS.id = vu9U3hXa3q0AAAABABhidWlsdGluOmFsZXJ0aW5nLnByb2ZpbGUABnRlbmFudAAGdGVuYW50ACQ3MGVmM2I2Mi03OTUxLTRkMzktYWI0Zi1iMDNiOTljMGY1MDG-71TeFdrerQ +data "dynatrace_management_zone" "CD_Speech_HTTS"{ name="CD_Speech" } +resource "dynatrace_alerting" "CD_Speech_HTTS" { + name = "CD_Speech HTTS" + management_zone = data.dynatrace_management_zone.CD_Speech_HTTS.id + rules { + rule { + delay_in_minutes = 0 + include_mode = "INCLUDE_ANY" + severity_level = "AVAILABILITY" + tags = [ "Component:HTTS" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ANY" + severity_level = "CUSTOM_ALERT" + tags = [ "Component:HTTS" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ANY" + severity_level = "ERRORS" + tags = [ "Component:HTTS" ] + } + rule { + delay_in_minutes = 0 + include_mode = "INCLUDE_ANY" + severity_level = "MONITORING_UNAVAILABLE" + tags = [ "Component:HTTS" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ANY" + severity_level = "PERFORMANCE" + tags = [ "Component:HTTS" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ANY" + severity_level = "RESOURCE_CONTENTION" + tags = [ "Component:HTTS" ] + } + } +} \ No newline at end of file diff --git a/EMEA_PROD/alerting/cd_speech_hvd.tf b/EMEA_PROD/alerting/cd_speech_hvd.tf new file mode 100644 index 00000000..6107d7e1 --- /dev/null +++ b/EMEA_PROD/alerting/cd_speech_hvd.tf @@ -0,0 +1,44 @@ +# DEFINE dynatrace_alerting.CD_Speech_HVD.id = vu9U3hXa3q0AAAABABhidWlsdGluOmFsZXJ0aW5nLnByb2ZpbGUABnRlbmFudAAGdGVuYW50ACQ4ZmM1YWE4OC02YzJhLTQ1MTItYjQ3Mi0zODNlZmJlMWM5MGS-71TeFdrerQ +data "dynatrace_management_zone" "CD_Speech_HVD"{ name="CD_Speech" } +resource "dynatrace_alerting" "CD_Speech_HVD" { + name = "CD_Speech HVD" + management_zone = data.dynatrace_management_zone.CD_Speech_HVD.id + rules { + rule { + delay_in_minutes = 0 + include_mode = "INCLUDE_ANY" + severity_level = "AVAILABILITY" + tags = [ "Component:HVD" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ANY" + severity_level = "CUSTOM_ALERT" + tags = [ "Component:HVD" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ANY" + severity_level = "ERRORS" + tags = [ "Component:HVD" ] + } + rule { + delay_in_minutes = 0 + include_mode = "INCLUDE_ANY" + severity_level = "MONITORING_UNAVAILABLE" + tags = [ "Component:HVD" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ANY" + severity_level = "PERFORMANCE" + tags = [ "Component:HVD" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ANY" + severity_level = "RESOURCE_CONTENTION" + tags = [ "Component:HVD" ] + } + } +} \ No newline at end of file diff --git a/EMEA_PROD/dashboard/cd_speech_prod.tf b/EMEA_PROD/dashboard/cd_speech_prod.tf new file mode 100644 index 00000000..40f26538 --- /dev/null +++ b/EMEA_PROD/dashboard/cd_speech_prod.tf @@ -0,0 +1,321 @@ +# DEFINE dynatrace_dashboard.CD_Speech_PROD.id = 7bf20688-297e-4759-a738-a25c0f699d04 +data "dynatrace_management_zone" "CD_Speech_PROD"{ name="CD_Speech" } +resource "dynatrace_dashboard" "CD_Speech_PROD" { + dashboard_metadata { + name = "CD_Speech PROD" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "Speech" ] + filter { + timeframe = "-24h to now" + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 304 + left = 38 + top = 228 + width = 1064 + } + filter_config { + type = "MIXED" + custom_name = "Failure rate (HTTP 4xx/5xx errors)" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#ff0000" + key = "nullbuiltin:service.errors.fivexx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956393463 + } + config { + custom_color = "#fff29a" + key = "nullbuiltin:service.errors.fourxx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956441725 + } + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fourxx.rate" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fivexx.rate" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Component:Speech", "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_Speech" + id = data.dynatrace_management_zone.CD_Speech_PROD.id + } + } + } + tile { + name = "Overall Health" + configured = true + tile_type = "HEADER" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 0 + width = 1064 + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 532 + width = 1064 + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 304 + left = 38 + top = 570 + width = 1064 + } + filter_config { + type = "MIXED" + custom_name = "Response time, Request Count and Number of Errors" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#008cdb" + key = "nullbuiltin:service.requestCount.total|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275720776 + } + config { + custom_color = "#b4e5f9" + key = "nullbuiltin:service.response.time|AVG|TOTAL|LINE|SERVICE" + last_modified = 1595275686773 + } + config { + custom_color = "#ef651f" + key = "nullbuiltin:service.errors.total.count|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275955999 + } + } + series { + type = "LINE" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.response.time" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.requestCount.total" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.total.count" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Component:Speech", "Environment:PROD" ] + } + } + } + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 190 + width = 1064 + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "DATABASES_OVERVIEW" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 646 + top = 38 + width = 190 + } + filter_config { + type = "DATABASE" + custom_name = "Databases" + default_name = "Databases" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "DATABASE" + match { + key = "AUTO_TAGS" + values = [ "Component:Speech", "Environment:PROD" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "SERVICES" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 342 + top = 38 + width = 190 + } + filter_config { + type = "SERVICE" + custom_name = "Services" + default_name = "Services" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Component:Speech", "Environment:PROD" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "HOSTS" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 38 + top = 38 + width = 190 + } + filter_config { + type = "HOST" + custom_name = "Hosts" + default_name = "Hosts" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "HOST" + match { + key = "AUTO_TAGS" + values = [ "Component:Speech", "Environment:PROD" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/EMEA_PROD/management_zone/cd_speech.tf b/EMEA_PROD/management_zone/cd_speech.tf new file mode 100644 index 00000000..7f284b06 --- /dev/null +++ b/EMEA_PROD/management_zone/cd_speech.tf @@ -0,0 +1,95 @@ +# DEFINE dynatrace_management_zone.CD_Speech.id = 4065036998432033236 +resource "dynatrace_management_zone" "CD_Speech" { + name = "CD_Speech" + rules { + type = "CLOUD_APPLICATION" + enabled = true + conditions { + key { + type = "STATIC" + attribute = "CLOUD_APPLICATION_NAME" + } + string { + case_sensitive = true + # negate = false + operator = "CONTAINS" + value = "Speech" + } + } + } + rules { + type = "CLOUD_APPLICATION_NAMESPACE" + enabled = true + conditions { + key { + type = "STATIC" + attribute = "CLOUD_APPLICATION_NAMESPACE_NAME" + } + string { + case_sensitive = true + # negate = false + operator = "CONTAINS" + value = "Speech" + } + } + } + rules { + type = "HOST" + enabled = true + conditions { + key { + type = "STATIC" + attribute = "HOST_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = "Component" + value = "Speech" + } + } + } + } + rules { + type = "PROCESS_GROUP" + enabled = true + propagation_types = [ "PROCESS_GROUP_TO_HOST" ] + conditions { + key { + type = "STATIC" + attribute = "PROCESS_GROUP_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = "Component" + value = "Speech" + } + } + } + } + rules { + type = "SERVICE" + enabled = true + propagation_types = [ "SERVICE_TO_HOST_LIKE", "SERVICE_TO_PROCESS_GROUP_LIKE" ] + conditions { + key { + type = "STATIC" + attribute = "SERVICE_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = "Component" + value = "Speech" + } + } + } + } +} From 700092b5338fedc4a33e093ec869ad44f96f5296 Mon Sep 17 00:00:00 2001 From: Patryk Gudalewicz Date: Wed, 1 Mar 2023 19:09:56 +0100 Subject: [PATCH 5/6] "Migrating from Monaco to Terraform for management zone: CD_Speech" --- NA_PREPROD/alerting/cd_speech_htts.tf | 44 ++++ NA_PREPROD/alerting/cd_speech_hvd.tf | 44 ++++ NA_PREPROD/dashboard/cd_speech_int.tf | 321 ++++++++++++++++++++++++ NA_PREPROD/dashboard/cd_speech_test.tf | 321 ++++++++++++++++++++++++ NA_PREPROD/management_zone/cd_speech.tf | 95 +++++++ 5 files changed, 825 insertions(+) create mode 100644 NA_PREPROD/alerting/cd_speech_htts.tf create mode 100644 NA_PREPROD/alerting/cd_speech_hvd.tf create mode 100644 NA_PREPROD/dashboard/cd_speech_int.tf create mode 100644 NA_PREPROD/dashboard/cd_speech_test.tf create mode 100644 NA_PREPROD/management_zone/cd_speech.tf diff --git a/NA_PREPROD/alerting/cd_speech_htts.tf b/NA_PREPROD/alerting/cd_speech_htts.tf new file mode 100644 index 00000000..22e1bda5 --- /dev/null +++ b/NA_PREPROD/alerting/cd_speech_htts.tf @@ -0,0 +1,44 @@ +# DEFINE dynatrace_alerting.CD_Speech_HTTS.id = vu9U3hXa3q0AAAABABhidWlsdGluOmFsZXJ0aW5nLnByb2ZpbGUABnRlbmFudAAGdGVuYW50ACRjNWYwNTg5MS02ZGRhLTQxNjQtYTdkMi1mZjlhNGJhNjg3Zjm-71TeFdrerQ +data "dynatrace_management_zone" "CD_Speech_HTTS"{ name="CD_Speech" } +resource "dynatrace_alerting" "CD_Speech_HTTS" { + name = "CD_Speech HTTS" + management_zone = data.dynatrace_management_zone.CD_Speech_HTTS.id + rules { + rule { + delay_in_minutes = 0 + include_mode = "INCLUDE_ANY" + severity_level = "AVAILABILITY" + tags = [ "Component:HTTS" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ANY" + severity_level = "CUSTOM_ALERT" + tags = [ "Component:HTTS" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ANY" + severity_level = "ERRORS" + tags = [ "Component:HTTS" ] + } + rule { + delay_in_minutes = 0 + include_mode = "INCLUDE_ANY" + severity_level = "MONITORING_UNAVAILABLE" + tags = [ "Component:HTTS" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ANY" + severity_level = "PERFORMANCE" + tags = [ "Component:HTTS" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ANY" + severity_level = "RESOURCE_CONTENTION" + tags = [ "Component:HTTS" ] + } + } +} \ No newline at end of file diff --git a/NA_PREPROD/alerting/cd_speech_hvd.tf b/NA_PREPROD/alerting/cd_speech_hvd.tf new file mode 100644 index 00000000..24b78b4a --- /dev/null +++ b/NA_PREPROD/alerting/cd_speech_hvd.tf @@ -0,0 +1,44 @@ +# DEFINE dynatrace_alerting.CD_Speech_HVD.id = vu9U3hXa3q0AAAABABhidWlsdGluOmFsZXJ0aW5nLnByb2ZpbGUABnRlbmFudAAGdGVuYW50ACQwODdkMTM1NC1hNWUzLTQ2NTMtOWU3MS0yODcxMjNlMWRiM2W-71TeFdrerQ +data "dynatrace_management_zone" "CD_Speech_HVD"{ name="CD_Speech" } +resource "dynatrace_alerting" "CD_Speech_HVD" { + name = "CD_Speech HVD" + management_zone = data.dynatrace_management_zone.CD_Speech_HVD.id + rules { + rule { + delay_in_minutes = 0 + include_mode = "INCLUDE_ANY" + severity_level = "AVAILABILITY" + tags = [ "Component:HVD" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ANY" + severity_level = "CUSTOM_ALERT" + tags = [ "Component:HVD" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ANY" + severity_level = "ERRORS" + tags = [ "Component:HVD" ] + } + rule { + delay_in_minutes = 0 + include_mode = "INCLUDE_ANY" + severity_level = "MONITORING_UNAVAILABLE" + tags = [ "Component:HVD" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ANY" + severity_level = "PERFORMANCE" + tags = [ "Component:HVD" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ANY" + severity_level = "RESOURCE_CONTENTION" + tags = [ "Component:HVD" ] + } + } +} \ No newline at end of file diff --git a/NA_PREPROD/dashboard/cd_speech_int.tf b/NA_PREPROD/dashboard/cd_speech_int.tf new file mode 100644 index 00000000..d4452aa0 --- /dev/null +++ b/NA_PREPROD/dashboard/cd_speech_int.tf @@ -0,0 +1,321 @@ +# DEFINE dynatrace_dashboard.CD_Speech_INT.id = 6c9031c1-77d3-4a4f-bb7d-14140b58a186 +data "dynatrace_management_zone" "CD_Speech_INT"{ name="CD_Speech" } +resource "dynatrace_dashboard" "CD_Speech_INT" { + dashboard_metadata { + name = "CD_Speech INT" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "Speech" ] + filter { + timeframe = "-24h to now" + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 304 + left = 38 + top = 228 + width = 1064 + } + filter_config { + type = "MIXED" + custom_name = "Failure rate (HTTP 4xx/5xx errors)" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#ff0000" + key = "nullbuiltin:service.errors.fivexx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956393463 + } + config { + custom_color = "#fff29a" + key = "nullbuiltin:service.errors.fourxx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956441725 + } + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fourxx.rate" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fivexx.rate" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Component:Speech", "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_Speech" + id = data.dynatrace_management_zone.CD_Speech_INT.id + } + } + } + tile { + name = "Overall Health" + configured = true + tile_type = "HEADER" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 0 + width = 1064 + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 532 + width = 1064 + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 304 + left = 38 + top = 570 + width = 1064 + } + filter_config { + type = "MIXED" + custom_name = "Response time, Request Count and Number of Errors" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#008cdb" + key = "nullbuiltin:service.requestCount.total|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275720776 + } + config { + custom_color = "#b4e5f9" + key = "nullbuiltin:service.response.time|AVG|TOTAL|LINE|SERVICE" + last_modified = 1595275686773 + } + config { + custom_color = "#ef651f" + key = "nullbuiltin:service.errors.total.count|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275955999 + } + } + series { + type = "LINE" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.response.time" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.requestCount.total" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.total.count" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Component:Speech", "Environment:INT" ] + } + } + } + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 190 + width = 1064 + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "DATABASES_OVERVIEW" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 646 + top = 38 + width = 190 + } + filter_config { + type = "DATABASE" + custom_name = "Databases" + default_name = "Databases" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "DATABASE" + match { + key = "AUTO_TAGS" + values = [ "Component:Speech", "Environment:INT" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "SERVICES" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 342 + top = 38 + width = 190 + } + filter_config { + type = "SERVICE" + custom_name = "Services" + default_name = "Services" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Component:Speech", "Environment:INT" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "HOSTS" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 38 + top = 38 + width = 190 + } + filter_config { + type = "HOST" + custom_name = "Hosts" + default_name = "Hosts" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "HOST" + match { + key = "AUTO_TAGS" + values = [ "Component:Speech", "Environment:INT" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/NA_PREPROD/dashboard/cd_speech_test.tf b/NA_PREPROD/dashboard/cd_speech_test.tf new file mode 100644 index 00000000..c0f407d4 --- /dev/null +++ b/NA_PREPROD/dashboard/cd_speech_test.tf @@ -0,0 +1,321 @@ +# DEFINE dynatrace_dashboard.CD_Speech_TEST.id = adae280d-0ffb-43bd-86bc-f6bf305174e0 +data "dynatrace_management_zone" "CD_Speech_TEST"{ name="CD_Speech" } +resource "dynatrace_dashboard" "CD_Speech_TEST" { + dashboard_metadata { + name = "CD_Speech TEST" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "Speech" ] + filter { + timeframe = "-24h to now" + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 304 + left = 38 + top = 228 + width = 1064 + } + filter_config { + type = "MIXED" + custom_name = "Failure rate (HTTP 4xx/5xx errors)" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#ff0000" + key = "nullbuiltin:service.errors.fivexx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956393463 + } + config { + custom_color = "#fff29a" + key = "nullbuiltin:service.errors.fourxx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956441725 + } + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fourxx.rate" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fivexx.rate" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Component:Speech", "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_Speech" + id = data.dynatrace_management_zone.CD_Speech_TEST.id + } + } + } + tile { + name = "Overall Health" + configured = true + tile_type = "HEADER" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 0 + width = 1064 + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 532 + width = 1064 + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 304 + left = 38 + top = 570 + width = 1064 + } + filter_config { + type = "MIXED" + custom_name = "Response time, Request Count and Number of Errors" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#008cdb" + key = "nullbuiltin:service.requestCount.total|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275720776 + } + config { + custom_color = "#b4e5f9" + key = "nullbuiltin:service.response.time|AVG|TOTAL|LINE|SERVICE" + last_modified = 1595275686773 + } + config { + custom_color = "#ef651f" + key = "nullbuiltin:service.errors.total.count|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275955999 + } + } + series { + type = "LINE" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.response.time" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.requestCount.total" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.total.count" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Component:Speech", "Environment:TEST" ] + } + } + } + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 190 + width = 1064 + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "DATABASES_OVERVIEW" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 646 + top = 38 + width = 190 + } + filter_config { + type = "DATABASE" + custom_name = "Databases" + default_name = "Databases" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "DATABASE" + match { + key = "AUTO_TAGS" + values = [ "Component:Speech", "Environment:TEST" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "SERVICES" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 342 + top = 38 + width = 190 + } + filter_config { + type = "SERVICE" + custom_name = "Services" + default_name = "Services" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Component:Speech", "Environment:TEST" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "HOSTS" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 38 + top = 38 + width = 190 + } + filter_config { + type = "HOST" + custom_name = "Hosts" + default_name = "Hosts" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "HOST" + match { + key = "AUTO_TAGS" + values = [ "Component:Speech", "Environment:TEST" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/NA_PREPROD/management_zone/cd_speech.tf b/NA_PREPROD/management_zone/cd_speech.tf new file mode 100644 index 00000000..48d85dab --- /dev/null +++ b/NA_PREPROD/management_zone/cd_speech.tf @@ -0,0 +1,95 @@ +# DEFINE dynatrace_management_zone.CD_Speech.id = 4622121853600374422 +resource "dynatrace_management_zone" "CD_Speech" { + name = "CD_Speech" + rules { + type = "CLOUD_APPLICATION" + enabled = true + conditions { + key { + type = "STATIC" + attribute = "CLOUD_APPLICATION_NAME" + } + string { + case_sensitive = true + # negate = false + operator = "CONTAINS" + value = "Speech" + } + } + } + rules { + type = "CLOUD_APPLICATION_NAMESPACE" + enabled = true + conditions { + key { + type = "STATIC" + attribute = "CLOUD_APPLICATION_NAMESPACE_NAME" + } + string { + case_sensitive = true + # negate = false + operator = "CONTAINS" + value = "Speech" + } + } + } + rules { + type = "HOST" + enabled = true + conditions { + key { + type = "STATIC" + attribute = "HOST_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = "Component" + value = "Speech" + } + } + } + } + rules { + type = "PROCESS_GROUP" + enabled = true + propagation_types = [ "PROCESS_GROUP_TO_HOST" ] + conditions { + key { + type = "STATIC" + attribute = "PROCESS_GROUP_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = "Component" + value = "Speech" + } + } + } + } + rules { + type = "SERVICE" + enabled = true + propagation_types = [ "SERVICE_TO_HOST_LIKE", "SERVICE_TO_PROCESS_GROUP_LIKE" ] + conditions { + key { + type = "STATIC" + attribute = "SERVICE_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = "Component" + value = "Speech" + } + } + } + } +} From dbf405a92aaca9b68b5c6a56e58dacdddf52227e Mon Sep 17 00:00:00 2001 From: Patryk Gudalewicz Date: Wed, 1 Mar 2023 19:13:01 +0100 Subject: [PATCH 6/6] "Migrating from Monaco to Terraform for management zone: CD_Speech" --- NA_PROD/alerting/cd_speech_htts.tf | 44 ++++ NA_PROD/alerting/cd_speech_hvd.tf | 44 ++++ NA_PROD/dashboard/cd_speech_prod.tf | 321 +++++++++++++++++++++++++++ NA_PROD/management_zone/cd_speech.tf | 95 ++++++++ 4 files changed, 504 insertions(+) create mode 100644 NA_PROD/alerting/cd_speech_htts.tf create mode 100644 NA_PROD/alerting/cd_speech_hvd.tf create mode 100644 NA_PROD/dashboard/cd_speech_prod.tf create mode 100644 NA_PROD/management_zone/cd_speech.tf diff --git a/NA_PROD/alerting/cd_speech_htts.tf b/NA_PROD/alerting/cd_speech_htts.tf new file mode 100644 index 00000000..0eac8b29 --- /dev/null +++ b/NA_PROD/alerting/cd_speech_htts.tf @@ -0,0 +1,44 @@ +# DEFINE dynatrace_alerting.CD_Speech_HTTS.id = vu9U3hXa3q0AAAABABhidWlsdGluOmFsZXJ0aW5nLnByb2ZpbGUABnRlbmFudAAGdGVuYW50ACRhODkwNTk5Ni0zMmE5LTRmZTctODkxZS1iODQzMjIzN2M1ZDK-71TeFdrerQ +data "dynatrace_management_zone" "CD_Speech_HTTS"{ name="CD_Speech" } +resource "dynatrace_alerting" "CD_Speech_HTTS" { + name = "CD_Speech HTTS" + management_zone = data.dynatrace_management_zone.CD_Speech_HTTS.id + rules { + rule { + delay_in_minutes = 0 + include_mode = "INCLUDE_ANY" + severity_level = "AVAILABILITY" + tags = [ "Component:HTTS" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ANY" + severity_level = "CUSTOM_ALERT" + tags = [ "Component:HTTS" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ANY" + severity_level = "ERRORS" + tags = [ "Component:HTTS" ] + } + rule { + delay_in_minutes = 0 + include_mode = "INCLUDE_ANY" + severity_level = "MONITORING_UNAVAILABLE" + tags = [ "Component:HTTS" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ANY" + severity_level = "PERFORMANCE" + tags = [ "Component:HTTS" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ANY" + severity_level = "RESOURCE_CONTENTION" + tags = [ "Component:HTTS" ] + } + } +} \ No newline at end of file diff --git a/NA_PROD/alerting/cd_speech_hvd.tf b/NA_PROD/alerting/cd_speech_hvd.tf new file mode 100644 index 00000000..0c4580ee --- /dev/null +++ b/NA_PROD/alerting/cd_speech_hvd.tf @@ -0,0 +1,44 @@ +# DEFINE dynatrace_alerting.CD_Speech_HVD.id = vu9U3hXa3q0AAAABABhidWlsdGluOmFsZXJ0aW5nLnByb2ZpbGUABnRlbmFudAAGdGVuYW50ACQ2MzU0MTJhNS0yYzdkLTRmNGYtYTA2Mi03YTQxMTg1YWYxZDC-71TeFdrerQ +data "dynatrace_management_zone" "CD_Speech_HVD"{ name="CD_Speech" } +resource "dynatrace_alerting" "CD_Speech_HVD" { + name = "CD_Speech HVD" + management_zone = data.dynatrace_management_zone.CD_Speech_HVD.id + rules { + rule { + delay_in_minutes = 0 + include_mode = "INCLUDE_ANY" + severity_level = "AVAILABILITY" + tags = [ "Component:HVD" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ANY" + severity_level = "CUSTOM_ALERT" + tags = [ "Component:HVD" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ANY" + severity_level = "ERRORS" + tags = [ "Component:HVD" ] + } + rule { + delay_in_minutes = 0 + include_mode = "INCLUDE_ANY" + severity_level = "MONITORING_UNAVAILABLE" + tags = [ "Component:HVD" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ANY" + severity_level = "PERFORMANCE" + tags = [ "Component:HVD" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ANY" + severity_level = "RESOURCE_CONTENTION" + tags = [ "Component:HVD" ] + } + } +} \ No newline at end of file diff --git a/NA_PROD/dashboard/cd_speech_prod.tf b/NA_PROD/dashboard/cd_speech_prod.tf new file mode 100644 index 00000000..2b9d90a9 --- /dev/null +++ b/NA_PROD/dashboard/cd_speech_prod.tf @@ -0,0 +1,321 @@ +# DEFINE dynatrace_dashboard.CD_Speech_PROD.id = e8bf472c-27a1-4de0-9df7-1e4701f501c0 +data "dynatrace_management_zone" "CD_Speech_PROD"{ name="CD_Speech" } +resource "dynatrace_dashboard" "CD_Speech_PROD" { + dashboard_metadata { + name = "CD_Speech PROD" + owner = "Ignacio.Goldman@partner.bmwgroup.com" + preset = true + shared = true + tags = [ "Speech" ] + filter { + timeframe = "-24h to now" + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 304 + left = 38 + top = 228 + width = 1064 + } + filter_config { + type = "MIXED" + custom_name = "Failure rate (HTTP 4xx/5xx errors)" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#ff0000" + key = "nullbuiltin:service.errors.fivexx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956393463 + } + config { + custom_color = "#fff29a" + key = "nullbuiltin:service.errors.fourxx.rate|AVG|TOTAL|BAR|SERVICE" + last_modified = 1617956441725 + } + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fourxx.rate" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.fivexx.rate" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Component:Speech", "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_Speech" + id = data.dynatrace_management_zone.CD_Speech_PROD.id + } + } + } + tile { + name = "Overall Health" + configured = true + tile_type = "HEADER" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 0 + width = 1064 + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 532 + width = 1064 + } + } + tile { + name = "Custom chart" + configured = true + tile_type = "CUSTOM_CHARTING" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 304 + left = 38 + top = 570 + width = 1064 + } + filter_config { + type = "MIXED" + custom_name = "Response time, Request Count and Number of Errors" + default_name = "Custom chart" + chart_config { + type = "TIMESERIES" + legend = true + result_metadata { + config { + custom_color = "#008cdb" + key = "nullbuiltin:service.requestCount.total|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275720776 + } + config { + custom_color = "#b4e5f9" + key = "nullbuiltin:service.response.time|AVG|TOTAL|LINE|SERVICE" + last_modified = 1595275686773 + } + config { + custom_color = "#ef651f" + key = "nullbuiltin:service.errors.total.count|NONE|TOTAL|BAR|SERVICE" + last_modified = 1595275955999 + } + } + series { + type = "LINE" + aggregation = "AVG" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.response.time" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.requestCount.total" + # sort_ascending = false + # sort_column = false + } + series { + type = "BAR" + aggregation = "NONE" + aggregation_rate = "TOTAL" + entity_type = "SERVICE" + metric = "builtin:service.errors.total.count" + # sort_ascending = false + sort_column = true + } + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Component:Speech", "Environment:PROD" ] + } + } + } + } + } + tile { + name = "Markdown" + configured = true + markdown =<<-EOT + --- + + EOT + tile_type = "MARKDOWN" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 38 + left = 38 + top = 190 + width = 1064 + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "DATABASES_OVERVIEW" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 646 + top = 38 + width = 190 + } + filter_config { + type = "DATABASE" + custom_name = "Databases" + default_name = "Databases" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "DATABASE" + match { + key = "AUTO_TAGS" + values = [ "Component:Speech", "Environment:PROD" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "SERVICES" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 342 + top = 38 + width = 190 + } + filter_config { + type = "SERVICE" + custom_name = "Services" + default_name = "Services" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "SERVICE" + match { + key = "AUTO_TAGS" + values = [ "Component:Speech", "Environment:PROD" ] + } + } + } + } + } + tile { + name = "" + chart_visible = true + configured = true + tile_type = "HOSTS" + unknowns = jsonencode({ + "isAutoRefreshDisabled": false + }) + bounds { + height = 152 + left = 38 + top = 38 + width = 190 + } + filter_config { + type = "HOST" + custom_name = "Hosts" + default_name = "Hosts" + chart_config { + type = "TIMESERIES" + legend = true + } + filters { + filter { + entity_type = "HOST" + match { + key = "AUTO_TAGS" + values = [ "Component:Speech", "Environment:PROD" ] + } + } + } + } + } +} \ No newline at end of file diff --git a/NA_PROD/management_zone/cd_speech.tf b/NA_PROD/management_zone/cd_speech.tf new file mode 100644 index 00000000..4de6e673 --- /dev/null +++ b/NA_PROD/management_zone/cd_speech.tf @@ -0,0 +1,95 @@ +# DEFINE dynatrace_management_zone.CD_Speech.id = 4252069029655595292 +resource "dynatrace_management_zone" "CD_Speech" { + name = "CD_Speech" + rules { + type = "CLOUD_APPLICATION" + enabled = true + conditions { + key { + type = "STATIC" + attribute = "CLOUD_APPLICATION_NAME" + } + string { + case_sensitive = true + # negate = false + operator = "CONTAINS" + value = "Speech" + } + } + } + rules { + type = "CLOUD_APPLICATION_NAMESPACE" + enabled = true + conditions { + key { + type = "STATIC" + attribute = "CLOUD_APPLICATION_NAMESPACE_NAME" + } + string { + case_sensitive = true + # negate = false + operator = "CONTAINS" + value = "Speech" + } + } + } + rules { + type = "HOST" + enabled = true + conditions { + key { + type = "STATIC" + attribute = "HOST_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = "Component" + value = "Speech" + } + } + } + } + rules { + type = "PROCESS_GROUP" + enabled = true + propagation_types = [ "PROCESS_GROUP_TO_HOST" ] + conditions { + key { + type = "STATIC" + attribute = "PROCESS_GROUP_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = "Component" + value = "Speech" + } + } + } + } + rules { + type = "SERVICE" + enabled = true + propagation_types = [ "SERVICE_TO_HOST_LIKE", "SERVICE_TO_PROCESS_GROUP_LIKE" ] + conditions { + key { + type = "STATIC" + attribute = "SERVICE_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = "Component" + value = "Speech" + } + } + } + } +}