MON-105 use filter tags modules

This commit is contained in:
Quentin Manfroi 2018-09-18 14:42:54 +02:00
parent 2a64727e81
commit c049dc07f2
2 changed files with 10 additions and 2 deletions

View 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}"
}

View File

@ -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