MON-140 - Added default function to ELB and Api Gateway monitors
This commit is contained in:
parent
9cc55717e1
commit
50aede5330
@ -37,9 +37,11 @@ resource "datadog_monitor" "API_http_5xx_errors_count" {
|
|||||||
|
|
||||||
query = <<EOF
|
query = <<EOF
|
||||||
sum(last_5m): (
|
sum(last_5m): (
|
||||||
avg:aws.apigateway.5xxerror{${var.filter_tags}} by {region,apiname}.as_count() /
|
default(
|
||||||
(avg:aws.apigateway.count{${var.filter_tags}} by {region,apiname}.as_count() + ${var.artificial_requests_count})
|
avg:aws.apigateway.5xxerror{${var.filter_tags}} by {region,apiname}.as_count() /
|
||||||
) * 100 > ${var.http_5xx_requests_threshold_critical}
|
(avg:aws.apigateway.count{${var.filter_tags}} by {region,apiname}.as_count() + ${var.artificial_requests_count}),
|
||||||
|
0) * 100
|
||||||
|
) > ${var.http_5xx_requests_threshold_critical}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
evaluation_delay = "${var.delay}"
|
evaluation_delay = "${var.delay}"
|
||||||
@ -69,9 +71,11 @@ resource "datadog_monitor" "API_http_4xx_errors_count" {
|
|||||||
|
|
||||||
query = <<EOF
|
query = <<EOF
|
||||||
sum(last_5m): (
|
sum(last_5m): (
|
||||||
avg:aws.apigateway.4xxerror{${var.filter_tags}} by {region,apiname}.as_count() /
|
default(
|
||||||
(avg:aws.apigateway.count{${var.filter_tags}} by {region,apiname}.as_count() + ${var.artificial_requests_count})
|
avg:aws.apigateway.4xxerror{${var.filter_tags}} by {region,apiname}.as_count() /
|
||||||
) * 100 > ${var.http_4xx_requests_threshold_critical}
|
(avg:aws.apigateway.count{${var.filter_tags}} by {region,apiname}.as_count() + ${var.artificial_requests_count}),
|
||||||
|
0) * 100
|
||||||
|
) > ${var.http_4xx_requests_threshold_critical}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
evaluation_delay = "${var.delay}"
|
evaluation_delay = "${var.delay}"
|
||||||
|
|||||||
@ -40,9 +40,11 @@ resource "datadog_monitor" "ELB_too_much_4xx" {
|
|||||||
|
|
||||||
query = <<EOF
|
query = <<EOF
|
||||||
avg(last_5m): (
|
avg(last_5m): (
|
||||||
avg:aws.elb.httpcode_elb_4xx{${data.template_file.filter.rendered}} by {region,loadbalancername} /
|
default(
|
||||||
avg:aws.elb.request_count{${data.template_file.filter.rendered}} by {region,loadbalancername}
|
avg:aws.elb.httpcode_elb_4xx{${data.template_file.filter.rendered}} by {region,loadbalancername} /
|
||||||
) * 100 > ${var.elb_4xx_threshold_critical}
|
avg:aws.elb.request_count{${data.template_file.filter.rendered}} by {region,loadbalancername},
|
||||||
|
0) * 100
|
||||||
|
) > ${var.elb_4xx_threshold_critical}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
type = "metric alert"
|
type = "metric alert"
|
||||||
@ -74,9 +76,11 @@ resource "datadog_monitor" "ELB_too_much_5xx" {
|
|||||||
|
|
||||||
query = <<EOF
|
query = <<EOF
|
||||||
avg(last_5m): (
|
avg(last_5m): (
|
||||||
avg:aws.elb.httpcode_elb_5xx{${data.template_file.filter.rendered}} by {region,loadbalancername} /
|
default(
|
||||||
avg:aws.elb.request_count{${data.template_file.filter.rendered}} by {region,loadbalancername}
|
avg:aws.elb.httpcode_elb_5xx{${data.template_file.filter.rendered}} by {region,loadbalancername} /
|
||||||
) * 100 > ${var.elb_5xx_threshold_critical}
|
avg:aws.elb.request_count{${data.template_file.filter.rendered}} by {region,loadbalancername},
|
||||||
|
0) * 100
|
||||||
|
) > ${var.elb_5xx_threshold_critical}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
type = "metric alert"
|
type = "metric alert"
|
||||||
@ -108,9 +112,11 @@ resource "datadog_monitor" "ELB_too_much_4xx_backend" {
|
|||||||
|
|
||||||
query = <<EOF
|
query = <<EOF
|
||||||
avg(last_5m): (
|
avg(last_5m): (
|
||||||
avg:aws.elb.httpcode_backend_4xx{${data.template_file.filter.rendered}} by {region,loadbalancername} /
|
default(
|
||||||
avg:aws.elb.request_count{${data.template_file.filter.rendered}} by {region,loadbalancername}
|
avg:aws.elb.httpcode_backend_4xx{${data.template_file.filter.rendered}} by {region,loadbalancername} /
|
||||||
) * 100 > ${var.elb_backend_4xx_threshold_critical}
|
avg:aws.elb.request_count{${data.template_file.filter.rendered}} by {region,loadbalancername},
|
||||||
|
0) * 100
|
||||||
|
) > ${var.elb_backend_4xx_threshold_critical}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
type = "metric alert"
|
type = "metric alert"
|
||||||
@ -142,9 +148,11 @@ resource "datadog_monitor" "ELB_too_much_5xx_backend" {
|
|||||||
|
|
||||||
query = <<EOF
|
query = <<EOF
|
||||||
avg(last_5m): (
|
avg(last_5m): (
|
||||||
avg:aws.elb.httpcode_backend_5xx{${data.template_file.filter.rendered}} by {region,loadbalancername} /
|
default(
|
||||||
avg:aws.elb.request_count{${data.template_file.filter.rendered}} by {region,loadbalancername}
|
avg:aws.elb.httpcode_backend_5xx{${data.template_file.filter.rendered}} by {region,loadbalancername} /
|
||||||
) * 100 > ${var.elb_backend_5xx_threshold_critical}
|
avg:aws.elb.request_count{${data.template_file.filter.rendered}} by {region,loadbalancername},
|
||||||
|
0) * 100
|
||||||
|
) > ${var.elb_backend_5xx_threshold_critical}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
type = "metric alert"
|
type = "metric alert"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user