Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion monitoring.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ locals {
var.enable_glue_create ? lower(var.glue_create_config.sqs_queue_name_dl) : local.base_dlq_name,
var.enable_glue_sync ? lower(var.glue_sync_config.sqs_queue_name_dl) : local.base_dlq_name,
]
additional_query_conditions = length(var.monitoring_query_conditions) > 0 ? ", ${var.monitoring_query_conditions}" : ""
}

resource "datadog_monitor" "dead_letters_monitor" {
Expand All @@ -17,7 +18,7 @@ resource "datadog_monitor" "dead_letters_monitor" {
dead_letters_queue_name = each.key
notify = join(", ", var.dl_alert_recipients)
})
query = "avg(last_1h):avg:aws.sqs.approximate_number_of_messages_visible{queuename:${each.key}} > ${var.dl_critical}"
query = "avg(last_1h):avg:aws.sqs.approximate_number_of_messages_visible{queuename:${each.key}${local.additional_query_conditions}} > ${var.dl_critical}"

monitor_thresholds {
warning = var.dl_warning
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,12 @@ variable "tags_monitoring" {
description = "A list of tags to assign to the monitoring resource"
}

variable "monitoring_query_conditions" {
type = string
description = "Monitoring query conditions a comma peratde key:value pair list"
default = ""
}

variable "enable_aws_glue_catalog_table" {
type = bool
description = "Enable glue catalog table"
Expand Down
Loading