MON-105 use filter tags modules
This commit is contained in:
parent
2a64727e81
commit
c049dc07f2
8
database/postgresql/modules.tf
Normal file
8
database/postgresql/modules.tf
Normal file
@ -0,0 +1,8 @@
|
||||
module "filter-tags" {
|
||||
source = "../../common/filter-tags"
|
||||
|
||||
environment = "${var.environment}"
|
||||
resource = "postgresql"
|
||||
filter_tags_use_defaults = "${var.filter_tags_use_defaults}"
|
||||
filter_tags_custom = "${var.filter_tags_custom}"
|
||||
}
|
||||
@ -14,7 +14,7 @@ resource "datadog_monitor" "postgresql_connection_too_high" {
|
||||
|
||||
query = <<EOF
|
||||
avg(last_15m): (
|
||||
avg:postgresql.percent_usage_connections{${data.template_file.filter.rendered}} by {db_host}
|
||||
avg:postgresql.percent_usage_connections${module.filter-tags.query_alert} by {db_host}
|
||||
) * 100 > ${var.postgresql_connection_threshold_critical}
|
||||
EOF
|
||||
|
||||
@ -45,7 +45,7 @@ resource "datadog_monitor" "postgresql_too_many_locks" {
|
||||
|
||||
query = <<EOF
|
||||
avg(last_5m): (
|
||||
avg:postgresql.locks{${data.template_file.filter.rendered}} by {db_host}
|
||||
avg:postgresql.locks${module.filter-tags.query_alert} by {db_host}
|
||||
) > ${var.postgresql_lock_threshold_critical}
|
||||
EOF
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user