From e8025afa094c6a68e079799e072ad93a03b78dd7 Mon Sep 17 00:00:00 2001 From: "gauthier.ampe@fr.clara.net" Date: Thu, 19 Mar 2020 17:40:37 +0100 Subject: [PATCH 1/2] MON-571 replace current_connections by total_requests metric --- cloud/azure/app-gateway/README.md | 14 +++++++------- cloud/azure/app-gateway/inputs.tf | 14 +++++++------- cloud/azure/app-gateway/monitors-app-gateway.tf | 16 ++++++++-------- cloud/azure/app-gateway/outputs.tf | 6 +++--- 4 files changed, 25 insertions(+), 25 deletions(-) diff --git a/cloud/azure/app-gateway/README.md b/cloud/azure/app-gateway/README.md index f77656e..7b83167 100644 --- a/cloud/azure/app-gateway/README.md +++ b/cloud/azure/app-gateway/README.md @@ -22,7 +22,7 @@ Creates DataDog monitors with the following checks: - App Gateway backend HTTP 5xx errors rate is too high - App Gateway backend unhealthy host ratio is too high - App Gateway failed requests -- App Gateway has no connection +- App Gateway has no successful requests - App Gateway HTTP 4xx errors rate is too high - App Gateway HTTP 5xx errors rate is too high - App Gateway is down @@ -81,11 +81,6 @@ Creates DataDog monitors with the following checks: | appgateway\_unhealthy\_host\_ratio\_threshold\_warning | Warning regarding acceptable ratio of unhealthy host | `number` | `50` | no | | appgateway\_unhealthy\_host\_ratio\_time\_aggregator | Monitor aggregator for App Gateway unhealthy host ratio [available values: min, max or avg] | `string` | `"max"` | no | | appgateway\_unhealthy\_host\_ratio\_timeframe | Monitor timeframe for App Gateway unhealthy host ratio [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` | `"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 | `number` | `900` | no | | filter\_tags\_custom | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no | @@ -100,6 +95,11 @@ Creates DataDog monitors with the following checks: | 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` | `"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 | +| total\_requests\_enabled | Flag to enable App Gateway current connections monitor | `string` | `"true"` | no | +| total\_requests\_extra\_tags | Extra tags for App Gateway current connections monitor | `list(string)` | `[]` | no | +| total\_requests\_message | Custom message for App Gateway current connections monitor | `string` | `""` | no | +| total\_requests\_time\_aggregator | Monitor aggregator for App Gateway current connections [available values: min, max or avg] | `string` | `"max"` | no | +| total\_requests\_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_15m"` | no | ## Outputs @@ -113,7 +113,7 @@ Creates DataDog monitors with the following checks: | appgateway\_http\_4xx\_errors\_id | id for monitor appgateway\_http\_4xx\_errors | | appgateway\_http\_5xx\_errors\_id | id for monitor appgateway\_http\_5xx\_errors | | appgateway\_status\_id | id for monitor appgateway\_status | -| current\_connection\_id | id for monitor current\_connection | +| total\_requests\_id | id for monitor total\_requests | ## Related documentation diff --git a/cloud/azure/app-gateway/inputs.tf b/cloud/azure/app-gateway/inputs.tf index 87eb820..2d37818 100644 --- a/cloud/azure/app-gateway/inputs.tf +++ b/cloud/azure/app-gateway/inputs.tf @@ -81,35 +81,35 @@ variable "status_timeframe" { default = "last_5m" } -# Monitoring App Gateway current_connections -variable "current_connection_enabled" { +# Monitoring App Gateway total_requests +variable "total_requests_enabled" { description = "Flag to enable App Gateway current connections monitor" type = string default = "true" } -variable "current_connection_extra_tags" { +variable "total_requests_extra_tags" { description = "Extra tags for App Gateway current connections monitor" type = list(string) default = [] } -variable "current_connection_message" { +variable "total_requests_message" { description = "Custom message for App Gateway current connections monitor" type = string default = "" } -variable "current_connection_time_aggregator" { +variable "total_requests_time_aggregator" { description = "Monitor aggregator for App Gateway current connections [available values: min, max or avg]" type = string default = "max" } -variable "current_connection_timeframe" { +variable "total_requests_timeframe" { description = "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`]" type = string - default = "last_5m" + default = "last_15m" } # Monitoring App Gateway failed_requests diff --git a/cloud/azure/app-gateway/monitors-app-gateway.tf b/cloud/azure/app-gateway/monitors-app-gateway.tf index 1b5265f..efb0fb3 100644 --- a/cloud/azure/app-gateway/monitors-app-gateway.tf +++ b/cloud/azure/app-gateway/monitors-app-gateway.tf @@ -29,16 +29,16 @@ 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 has no connection" - message = coalesce(var.current_connection_message, var.message) +# Monitoring App Gateway total_requests +resource "datadog_monitor" "total_requests" { + count = var.total_requests_enabled == "true" ? 1 : 0 + name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] App Gateway has no successful requests" + message = coalesce(var.total_requests_message, var.message) type = "query alert" query = < Date: Tue, 24 Mar 2020 17:42:12 +0100 Subject: [PATCH 2/2] MON-571 Apply suggestion to cloud/azure/app-gateway/monitors-app-gateway.tf --- cloud/azure/app-gateway/README.md | 2 +- cloud/azure/app-gateway/monitors-app-gateway.tf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cloud/azure/app-gateway/README.md b/cloud/azure/app-gateway/README.md index 7b83167..958bc9c 100644 --- a/cloud/azure/app-gateway/README.md +++ b/cloud/azure/app-gateway/README.md @@ -22,7 +22,7 @@ Creates DataDog monitors with the following checks: - App Gateway backend HTTP 5xx errors rate is too high - App Gateway backend unhealthy host ratio is too high - App Gateway failed requests -- App Gateway has no successful requests +- App Gateway has no requests - App Gateway HTTP 4xx errors rate is too high - App Gateway HTTP 5xx errors rate is too high - App Gateway is down diff --git a/cloud/azure/app-gateway/monitors-app-gateway.tf b/cloud/azure/app-gateway/monitors-app-gateway.tf index efb0fb3..e4d9236 100644 --- a/cloud/azure/app-gateway/monitors-app-gateway.tf +++ b/cloud/azure/app-gateway/monitors-app-gateway.tf @@ -32,7 +32,7 @@ EOQ # Monitoring App Gateway total_requests resource "datadog_monitor" "total_requests" { count = var.total_requests_enabled == "true" ? 1 : 0 - name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] App Gateway has no successful requests" + name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] App Gateway has no requests" message = coalesce(var.total_requests_message, var.message) type = "query alert"