MON-74 Change 404 errors to 4xx
This commit is contained in:
parent
3a56b974c1
commit
e3e3469cfb
@ -20,7 +20,7 @@ Creates a DataDog monitors with the following checks :
|
||||
* Response time
|
||||
* Memory usage count
|
||||
* HTTP 5xx requests
|
||||
* HTTP 404 requests
|
||||
* HTTP 4xx requests
|
||||
* HTTP 2xx requests
|
||||
|
||||
Inputs
|
||||
@ -34,8 +34,8 @@ Inputs
|
||||
| filter_tags_use_defaults | Use default filter tags convention | string | `true` | no |
|
||||
| http_2xx_requests_threshold_critical | Minimum critical acceptable percent of 2xx requests | string | `90` | no |
|
||||
| http_2xx_requests_threshold_warning | Minimum warning acceptable percent of 2xx requests | string | `95` | no |
|
||||
| http_404_requests_threshold_critical | Maximum critical acceptable percent of 404 errors | string | `40` | no |
|
||||
| http_404_requests_threshold_warning | Maximum warning acceptable percent of 404 errors | string | `30` | no |
|
||||
| http_4xx_requests_threshold_critical | Maximum critical acceptable percent of 4xx errors | string | `40` | no |
|
||||
| http_4xx_requests_threshold_warning | Maximum warning acceptable percent of 4xx errors | string | `30` | no |
|
||||
| http_5xx_requests_threshold_critical | Maximum critical acceptable percent of 5xx errors | string | `40` | no |
|
||||
| http_5xx_requests_threshold_warning | Maximum warning acceptable percent of 5xx errors | string | `30` | no |
|
||||
| memory_usage_threshold_critical | Alerting threshold in Mib | string | `52430000` | no |
|
||||
|
||||
@ -65,17 +65,17 @@ variable "http_5xx_requests_threshold_warning" {
|
||||
}
|
||||
|
||||
#################################
|
||||
### HTTP 404 status pages ###
|
||||
### HTTP 4xx status pages ###
|
||||
#################################
|
||||
|
||||
variable "http_404_requests_threshold_critical" {
|
||||
variable "http_4xx_requests_threshold_critical" {
|
||||
default = 30
|
||||
description = "Maximum critical acceptable percent of 404 errors"
|
||||
description = "Maximum critical acceptable percent of 4xx errors"
|
||||
}
|
||||
|
||||
variable "http_404_requests_threshold_warning" {
|
||||
variable "http_4xx_requests_threshold_warning" {
|
||||
default = 15
|
||||
description = "Maximum warning acceptable percent of 404 errors"
|
||||
description = "Maximum warning acceptable percent of 4xx errors"
|
||||
}
|
||||
|
||||
#################################
|
||||
|
||||
@ -94,25 +94,25 @@ resource "datadog_monitor" "appservices_http_5xx_errors_count" {
|
||||
tags = ["env:${var.environment}", "resource:appservices", "team:azure", "provider:azure"]
|
||||
}
|
||||
|
||||
# Monitoring App Services 404 errors percent
|
||||
resource "datadog_monitor" "appservices_http_404_errors_count" {
|
||||
name = "[${var.environment}] App Services HTTP 404 errors is {{value}}% above the limit on {{name}}"
|
||||
# Monitoring App Services 4xx errors percent
|
||||
resource "datadog_monitor" "appservices_http_4xx_errors_count" {
|
||||
name = "[${var.environment}] App Services HTTP 4xx errors is {{value}}% above the limit on {{name}}"
|
||||
type = "metric alert"
|
||||
message = "${var.message}"
|
||||
|
||||
query = <<EOF
|
||||
sum(last_5m): (
|
||||
avg:azure.app_services.http404{${data.template_file.filter.rendered}} by {resource_group,region,name}.as_count() /
|
||||
avg:azure.app_services.http4xx{${data.template_file.filter.rendered}} by {resource_group,region,name}.as_count() /
|
||||
avg:azure.app_services.requests{${data.template_file.filter.rendered}} by {resource_group,region,name}.as_count()
|
||||
) * 100 > ${var.http_404_requests_threshold_critical}
|
||||
) * 100 > ${var.http_4xx_requests_threshold_critical}
|
||||
EOF
|
||||
|
||||
evaluation_delay = "${var.delay}"
|
||||
new_host_delay = "${var.delay}"
|
||||
|
||||
thresholds {
|
||||
warning = "${var.http_404_requests_threshold_warning}"
|
||||
critical = "${var.http_404_requests_threshold_critical}"
|
||||
warning = "${var.http_4xx_requests_threshold_warning}"
|
||||
critical = "${var.http_4xx_requests_threshold_critical}"
|
||||
}
|
||||
|
||||
notify_no_data = false # Will NOT notify when no data is received
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user