MON-112 add artificial request for false positive mitigation

This commit is contained in:
Quentin Manfroi 2018-03-22 21:07:44 +01:00
parent a8fc9279ab
commit cc0e970dda
2 changed files with 9 additions and 4 deletions

View File

@ -147,3 +147,8 @@ variable "httpcode_target_5xx_threshold_warning" {
default = 60
description = "target 5xx warning threshold in percentage"
}
variable "artificial_requests_count" {
default = 5
description = "Number of false requests used to mitigate false positive in case of low trafic"
}

View File

@ -76,7 +76,7 @@ resource "datadog_monitor" "ALB_httpcode_elb_5xx" {
sum(last_5m): (
default(
avg:aws.applicationelb.httpcode_elb_5xx{${data.template_file.filter.rendered}} by {region,loadbalancer}.as_count() /
avg:aws.applicationelb.request_count{${data.template_file.filter.rendered}} by {region,loadbalancer}.as_count(),
(avg:aws.applicationelb.request_count{${data.template_file.filter.rendered}} by {region,loadbalancer}.as_count() + ${var.artificial_requests_count}),
0) * 100
) > ${var.httpcode_elb_5xx_threshold_critical}
EOF
@ -109,7 +109,7 @@ resource "datadog_monitor" "ALB_httpcode_elb_4xx" {
sum(last_5m): (
default(
avg:aws.applicationelb.httpcode_elb_4xx{${data.template_file.filter.rendered}} by {region,loadbalancer}.as_count() /
avg:aws.applicationelb.request_count{${data.template_file.filter.rendered}} by {region,loadbalancer}.as_count(),
(avg:aws.applicationelb.request_count{${data.template_file.filter.rendered}} by {region,loadbalancer}.as_count() + ${var.artificial_requests_count}),
0) * 100
) > ${var.httpcode_elb_4xx_threshold_critical}
EOF
@ -142,7 +142,7 @@ resource "datadog_monitor" "ALB_httpcode_target_5xx" {
sum(last_5m): (
default(
avg:aws.applicationelb.httpcode_target_5xx{${data.template_file.filter.rendered}} by {region,loadbalancer}.as_count() /
avg:aws.applicationelb.request_count{${data.template_file.filter.rendered}} by {region,loadbalancer}.as_count(),
(avg:aws.applicationelb.request_count{${data.template_file.filter.rendered}} by {region,loadbalancer}.as_count() + ${var.artificial_requests_count}),
0) * 100
) > ${var.httpcode_target_5xx_threshold_critical}
EOF
@ -175,7 +175,7 @@ resource "datadog_monitor" "ALB_httpcode_target_4xx" {
sum(last_5m): (
default(
avg:aws.applicationelb.httpcode_target_4xx{${data.template_file.filter.rendered}} by {region,loadbalancer}.as_count() /
avg:aws.applicationelb.request_count{${data.template_file.filter.rendered}} by {region,loadbalancer}.as_count(),
(avg:aws.applicationelb.request_count{${data.template_file.filter.rendered}} by {region,loadbalancer}.as_count() + ${var.artificial_requests_count}),
0) * 100
) > ${var.httpcode_target_4xx_threshold_critical}
EOF