diff --git a/cloud/azure/app-gateway/README.md b/cloud/azure/app-gateway/README.md index ca1611c..1ec341d 100644 --- a/cloud/azure/app-gateway/README.md +++ b/cloud/azure/app-gateway/README.md @@ -16,15 +16,15 @@ module "datadog-monitors-cloud-azure-app-gateway" { Creates DataDog monitors with the following checks: -- App Gateway backend connect time -- App Gateway Backend HTTP 4xx errors +- App Gateway backend connect time is too high +- App Gateway backend has no healthy host +- App Gateway backend HTTP 4xx errors rate is too high +- App Gateway backend HTTP 5xx errors rate is too high - App Gateway failed requests -- App Gateway HTTP 4xx errors -- App Gateway HTTP 5xx errors -- App Gateway HTTP Backend 5xx errors +- App Gateway has no connection +- App Gateway HTTP 4xx errors rate is too high +- App Gateway HTTP 5xx errors rate is too high - App Gateway is down -- App Gateway no connection -- App Gateway no healthy host ## Inputs @@ -33,54 +33,54 @@ Creates DataDog monitors with the following checks: | appgateway\_backend\_connect\_time\_enabled | Flag to enable App Gateway backend_connect_time monitor | string | `"true"` | no | | appgateway\_backend\_connect\_time\_extra\_tags | Extra tags for App Gateway backend_connect_time monitor | list(string) | `[]` | no | | appgateway\_backend\_connect\_time\_message | Custom message for App Gateway backend_connect_time monitor | string | `""` | no | -| appgateway\_backend\_connect\_time\_threshold\_critical | Maximum critical backend_connect_time errors | string | `"50"` | no | -| appgateway\_backend\_connect\_time\_threshold\_warning | Warning regarding backend_connect_time errors | string | `"40"` | no | -| appgateway\_backend\_connect\_time\_time\_aggregator | Monitor aggregator for App Gateway backend_connect_time [available values: min, max or avg] | string | `"min"` | no | +| appgateway\_backend\_connect\_time\_threshold\_critical | Maximum critical backend_connect_time errors in seconds | string | `"50"` | no | +| appgateway\_backend\_connect\_time\_threshold\_warning | Warning regarding backend_connect_time errors in seconds | string | `"40"` | no | +| appgateway\_backend\_connect\_time\_time\_aggregator | Monitor aggregator for App Gateway backend_connect_time [available values: min, max or avg] | string | `"max"` | no | | appgateway\_backend\_connect\_time\_timeframe | Monitor timeframe for App Gateway backend_connect_time [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `"last_5m"` | no | | appgateway\_backend\_http\_4xx\_errors\_enabled | Flag to enable App Gateway http 4xx errors monitor | string | `"true"` | no | | appgateway\_backend\_http\_4xx\_errors\_extra\_tags | Extra tags for App Gateway http 4xx errors monitor | list(string) | `[]` | no | | appgateway\_backend\_http\_4xx\_errors\_message | Custom message for App Gateway http 4xx errors monitor | string | `""` | no | -| appgateway\_backend\_http\_4xx\_errors\_threshold\_critical | Minimum critical acceptable percent of 4xx error | string | `"30"` | no | -| appgateway\_backend\_http\_4xx\_errors\_threshold\_warning | Warning regarding acceptable percent of 4xx error | string | `"20"` | no | +| appgateway\_backend\_http\_4xx\_errors\_threshold\_critical | Minimum critical acceptable percent of 4xx error | string | `"95"` | no | +| appgateway\_backend\_http\_4xx\_errors\_threshold\_warning | Warning regarding acceptable percent of 4xx error | string | `"80"` | no | | appgateway\_backend\_http\_4xx\_errors\_time\_aggregator | Monitor aggregator for App Gateway http 4xx errors [available values: min, max or avg] | string | `"max"` | no | | appgateway\_backend\_http\_4xx\_errors\_timeframe | Monitor timeframe for App Gateway http 4xx errors [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `"last_5m"` | no | | appgateway\_backend\_http\_5xx\_errors\_enabled | Flag to enable App Gateway http 5xx errors monitor | string | `"true"` | no | | appgateway\_backend\_http\_5xx\_errors\_extra\_tags | Extra tags for App Gateway http 5xx errors monitor | list(string) | `[]` | no | | appgateway\_backend\_http\_5xx\_errors\_message | Custom message for App Gateway http 5xx errors monitor | string | `""` | no | -| appgateway\_backend\_http\_5xx\_errors\_threshold\_critical | Minimum critical acceptable percent of 5xx error | string | `"30"` | no | -| appgateway\_backend\_http\_5xx\_errors\_threshold\_warning | Warning regarding acceptable percent of 5xx error | string | `"20"` | no | +| appgateway\_backend\_http\_5xx\_errors\_threshold\_critical | Minimum critical acceptable percent of 5xx error | string | `"95"` | no | +| appgateway\_backend\_http\_5xx\_errors\_threshold\_warning | Warning regarding acceptable percent of 5xx error | string | `"80"` | no | | appgateway\_backend\_http\_5xx\_errors\_time\_aggregator | Monitor aggregator for App Gateway http 5xx errors [available values: min, max or avg] | string | `"max"` | no | | appgateway\_backend\_http\_5xx\_errors\_timeframe | Monitor timeframe for App Gateway http 5xx errors [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `"last_5m"` | no | | appgateway\_failed\_requests\_enabled | Flag to enable App Gateway failed requests monitor | string | `"true"` | no | | appgateway\_failed\_requests\_extra\_tags | Extra tags for App Gateway failed requests monitor | list(string) | `[]` | no | | appgateway\_failed\_requests\_message | Custom message for App Gateway failed requests monitor | string | `""` | no | -| appgateway\_failed\_requests\_threshold\_critical | Maximum critical acceptable percent of failed errors | string | `"50"` | no | -| appgateway\_failed\_requests\_threshold\_warning | Warning regarding acceptable percent of failed errors | string | `"40"` | no | +| appgateway\_failed\_requests\_threshold\_critical | Maximum critical acceptable percent of failed errors | string | `"95"` | no | +| appgateway\_failed\_requests\_threshold\_warning | Warning regarding acceptable percent of failed errors | string | `"80"` | no | | appgateway\_failed\_requests\_time\_aggregator | Monitor aggregator for App Gateway failed requests [available values: min, max or avg] | string | `"min"` | no | | appgateway\_failed\_requests\_timeframe | Monitor timeframe for App Gateway failed requests [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `"last_5m"` | no | | appgateway\_healthy\_host\_count\_enabled | Flag to enable App Gateway healthy host monitor | string | `"true"` | no | | appgateway\_healthy\_host\_count\_extra\_tags | Extra tags for App Gateway healthy host monitor | list(string) | `[]` | no | | appgateway\_healthy\_host\_count\_message | Custom message for App Gateway healthy host monitor | string | `""` | no | -| appgateway\_healthy\_host\_count\_time\_aggregator | Monitor aggregator for App Gateway healthy host [available values: min, max or avg] | string | `"min"` | no | +| appgateway\_healthy\_host\_count\_time\_aggregator | Monitor aggregator for App Gateway healthy host [available values: min, max or avg] | string | `"max"` | no | | appgateway\_healthy\_host\_count\_timeframe | Monitor timeframe for App Gateway healthy host [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `"last_5m"` | no | | appgateway\_http\_4xx\_errors\_enabled | Flag to enable App Gateway http 4xx errors monitor | string | `"true"` | no | | appgateway\_http\_4xx\_errors\_extra\_tags | Extra tags for App Gateway http 4xx errors monitor | list(string) | `[]` | no | | appgateway\_http\_4xx\_errors\_message | Custom message for App Gateway http 4xx errors monitor | string | `""` | no | -| appgateway\_http\_4xx\_errors\_threshold\_critical | Minimum critical acceptable percent of 4xx error | string | `"30"` | no | -| appgateway\_http\_4xx\_errors\_threshold\_warning | Warning regarding acceptable percent of 4xx error | string | `"20"` | no | +| appgateway\_http\_4xx\_errors\_threshold\_critical | Maximum critical acceptable percent of 4xx error | string | `"95"` | no | +| appgateway\_http\_4xx\_errors\_threshold\_warning | Warning regarding acceptable percent of 4xx error | string | `"80"` | no | | appgateway\_http\_4xx\_errors\_time\_aggregator | Monitor aggregator for App Gateway http 4xx errors [available values: min, max or avg] | string | `"max"` | no | | appgateway\_http\_4xx\_errors\_timeframe | Monitor timeframe for App Gateway http 4xx errors [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `"last_5m"` | no | | appgateway\_http\_5xx\_errors\_enabled | Flag to enable App Gateway http 5xx errors monitor | string | `"true"` | no | | appgateway\_http\_5xx\_errors\_extra\_tags | Extra tags for App Gateway http 5xx errors monitor | list(string) | `[]` | no | | appgateway\_http\_5xx\_errors\_message | Custom message for App Gateway http 5xx errors monitor | string | `""` | no | -| appgateway\_http\_5xx\_errors\_threshold\_critical | Minimum critical acceptable percent of 5xx error | string | `"30"` | no | -| appgateway\_http\_5xx\_errors\_threshold\_warning | Warning regarding acceptable percent of 5xx error | string | `"20"` | no | +| appgateway\_http\_5xx\_errors\_threshold\_critical | Maximum critical acceptable percent of 5xx error | string | `"95"` | no | +| appgateway\_http\_5xx\_errors\_threshold\_warning | Warning regarding acceptable percent of 5xx error | string | `"80"` | no | | appgateway\_http\_5xx\_errors\_time\_aggregator | Monitor aggregator for App Gateway http 5xx errors [available values: min, max or avg] | string | `"max"` | no | | appgateway\_http\_5xx\_errors\_timeframe | Monitor timeframe for App Gateway http 5xx errors [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `"last_5m"` | no | | current\_connection\_enabled | Flag to enable App Gateway current connections monitor | string | `"true"` | no | | current\_connection\_extra\_tags | Extra tags for App Gateway current connections monitor | list(string) | `[]` | no | | current\_connection\_message | Custom message for App Gateway current connections monitor | string | `""` | no | -| current\_connection\_time\_aggregator | Monitor aggregator for App Gateway current connections [available values: min, max or avg] | string | `"min"` | no | +| current\_connection\_time\_aggregator | Monitor aggregator for App Gateway current connections [available values: min, max or avg] | string | `"max"` | no | | current\_connection\_timeframe | Monitor timeframe for App Gateway current connections [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `"last_5m"` | no | | environment | Architecture environment | string | n/a | yes | | evaluation\_delay | Delay in seconds for the metric evaluation | string | `"900"` | no | @@ -93,7 +93,7 @@ Creates DataDog monitors with the following checks: | status\_enabled | Flag to enable App Gateway status | string | `"true"` | no | | status\_extra\_tags | Extra tags for App Gateway status | list(string) | `[]` | no | | status\_message | Custom message for App Gateway status | string | `""` | no | -| status\_time\_aggregator | Monitor aggregator for App Gateway status [available values: min, max or avg] | string | `"min"` | no | +| status\_time\_aggregator | Monitor aggregator for App Gateway status [available values: min, max or avg] | string | `"max"` | no | | status\_timeframe | Monitor timeframe for App Gateway status [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `"last_5m"` | no | ## Outputs diff --git a/cloud/azure/app-gateway/inputs.tf b/cloud/azure/app-gateway/inputs.tf index a59c5ae..1040aad 100644 --- a/cloud/azure/app-gateway/inputs.tf +++ b/cloud/azure/app-gateway/inputs.tf @@ -61,7 +61,7 @@ variable "status_message" { variable "status_time_aggregator" { description = "Monitor aggregator for App Gateway status [available values: min, max or avg]" type = string - default = "min" + default = "max" } variable "status_timeframe" { @@ -92,7 +92,7 @@ variable "current_connection_message" { variable "current_connection_time_aggregator" { description = "Monitor aggregator for App Gateway current connections [available values: min, max or avg]" type = string - default = "min" + default = "max" } variable "current_connection_timeframe" { @@ -123,7 +123,7 @@ variable "appgateway_backend_connect_time_message" { variable "appgateway_backend_connect_time_time_aggregator" { description = "Monitor aggregator for App Gateway backend_connect_time [available values: min, max or avg]" type = string - default = "min" + default = "max" } variable "appgateway_backend_connect_time_timeframe" { @@ -134,12 +134,12 @@ variable "appgateway_backend_connect_time_timeframe" { variable "appgateway_backend_connect_time_threshold_critical" { default = 50 - description = "Maximum critical backend_connect_time errors" + description = "Maximum critical backend_connect_time errors in seconds" } variable "appgateway_backend_connect_time_threshold_warning" { default = 40 - description = "Warning regarding backend_connect_time errors" + description = "Warning regarding backend_connect_time errors in seconds" } # Monitoring App Gateway failed_requests @@ -174,12 +174,12 @@ variable "appgateway_failed_requests_timeframe" { } variable "appgateway_failed_requests_threshold_critical" { - default = 50 + default = 95 description = "Maximum critical acceptable percent of failed errors" } variable "appgateway_failed_requests_threshold_warning" { - default = 40 + default = 80 description = "Warning regarding acceptable percent of failed errors" } @@ -205,7 +205,7 @@ variable "appgateway_healthy_host_count_message" { variable "appgateway_healthy_host_count_time_aggregator" { description = "Monitor aggregator for App Gateway healthy host [available values: min, max or avg]" type = string - default = "min" + default = "max" } variable "appgateway_healthy_host_count_timeframe" { @@ -246,12 +246,12 @@ variable "appgateway_http_4xx_errors_timeframe" { } variable "appgateway_http_4xx_errors_threshold_critical" { - default = 30 - description = "Minimum critical acceptable percent of 4xx error" + default = 95 + description = "Maximum critical acceptable percent of 4xx error" } variable "appgateway_http_4xx_errors_threshold_warning" { - default = 20 + default = 80 description = "Warning regarding acceptable percent of 4xx error" } @@ -287,12 +287,12 @@ variable "appgateway_http_5xx_errors_timeframe" { } variable "appgateway_http_5xx_errors_threshold_critical" { - default = 30 - description = "Minimum critical acceptable percent of 5xx error" + default = 95 + description = "Maximum critical acceptable percent of 5xx error" } variable "appgateway_http_5xx_errors_threshold_warning" { - default = 20 + default = 80 description = "Warning regarding acceptable percent of 5xx error" } @@ -328,12 +328,12 @@ variable "appgateway_backend_http_4xx_errors_timeframe" { } variable "appgateway_backend_http_4xx_errors_threshold_critical" { - default = 30 + default = 95 description = "Minimum critical acceptable percent of 4xx error" } variable "appgateway_backend_http_4xx_errors_threshold_warning" { - default = 20 + default = 80 description = "Warning regarding acceptable percent of 4xx error" } @@ -369,11 +369,11 @@ variable "appgateway_backend_http_5xx_errors_timeframe" { } variable "appgateway_backend_http_5xx_errors_threshold_critical" { - default = 30 + default = 95 description = "Minimum critical acceptable percent of 5xx error" } variable "appgateway_backend_http_5xx_errors_threshold_warning" { - default = 20 + default = 80 description = "Warning regarding acceptable percent of 5xx error" } diff --git a/cloud/azure/app-gateway/monitors-app_gateway.tf b/cloud/azure/app-gateway/monitors-app_gateway.tf index 7ba011f..a204d96 100644 --- a/cloud/azure/app-gateway/monitors-app_gateway.tf +++ b/cloud/azure/app-gateway/monitors-app_gateway.tf @@ -31,13 +31,13 @@ EOQ # Monitoring App Gateway current_connections resource "datadog_monitor" "current_connection" { count = var.current_connection_enabled == "true" ? 1 : 0 - name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] App Gateway no connection {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" + name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] App Gateway has no connection" message = coalesce(var.current_connection_message, var.message) type = "query alert" query = < ${var.appgateway_backend_connect_time_threshold_critical} + sum:azure.network_applicationgateways.backend_connect_time${module.filter-tags.query_alert} by {resource_group,region,name,backendhttpsetting,backendpool,backendserver} > ${var.appgateway_backend_connect_time_threshold_critical} EOQ thresholds = { @@ -100,8 +100,8 @@ resource "datadog_monitor" "appgateway_failed_requests" { query = < ${var.appgateway_failed_requests_threshold_critical} EOQ @@ -130,13 +130,13 @@ EOQ # Monitoring App Gateway healthy_host_count resource "datadog_monitor" "appgateway_healthy_host_count" { count = var.appgateway_healthy_host_count_enabled == "true" ? 1 : 0 - name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] App Gateway no healthy host {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" + name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] App Gateway backend has no healthy host" message = coalesce(var.appgateway_healthy_host_count_message, var.message) type = "query alert" query = < ${var.appgateway_backend_http_4xx_errors_threshold_critical} EOQ @@ -263,14 +263,14 @@ EOQ # Monitoring App Gateway Backend response_status 5xx resource "datadog_monitor" "appgateway_backend_http_5xx_errors" { count = var.appgateway_backend_http_5xx_errors_enabled == "true" ? 1 : 0 - name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] App Gateway HTTP Backend 5xx errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" + name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] App Gateway backend HTTP 5xx errors rate is too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = coalesce(var.appgateway_backend_http_5xx_errors_message, var.message) type = "query alert" query = < ${var.appgateway_backend_http_5xx_errors_threshold_critical} EOQ