diff --git a/cloud/aws/rds/aurora/mysql/README.md b/cloud/aws/rds/aurora/mysql/README.md index fca0f08..c0eed6a 100644 --- a/cloud/aws/rds/aurora/mysql/README.md +++ b/cloud/aws/rds/aurora/mysql/README.md @@ -27,6 +27,7 @@ Creates DataDog monitors with the following checks: | aurora\_replicalag\_message | Custom message for RDS Aurora replica lag monitor | string | `""` | no | | aurora\_replicalag\_threshold\_critical | Aurora replica lag in milliseconds (critical threshold) | string | `"200"` | no | | aurora\_replicalag\_threshold\_warning | Aurora replica lag in milliseconds (warning threshold) | string | `"100"` | no | +| aurora\_replicalag\_time\_aggregator | Monitor aggregator for RDS Aurora replica lag [available values: min, max or avg] | string | `"avg"` | no | | aurora\_replicalag\_timeframe | Monitor timeframe for RDS Aurora replica lag monitor [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `"last_5m"` | no | | environment | Architecture Environment | string | n/a | yes | | evaluation\_delay | Delay in seconds for the metric evaluation | string | `"900"` | no | @@ -44,4 +45,3 @@ Creates DataDog monitors with the following checks: | rds\_aurora\_mysql\_replica\_lag\_id | id for monitor rds_aurora_mysql_replica_lag | ## Related documentation - diff --git a/cloud/aws/rds/aurora/mysql/inputs.tf b/cloud/aws/rds/aurora/mysql/inputs.tf index d8ebf55..f06d1ba 100644 --- a/cloud/aws/rds/aurora/mysql/inputs.tf +++ b/cloud/aws/rds/aurora/mysql/inputs.tf @@ -59,6 +59,12 @@ variable "aurora_replicalag_message" { default = "" } +variable "aurora_replicalag_time_aggregator" { + description = "Monitor aggregator for RDS Aurora replica lag [available values: min, max or avg]" + type = string + default = "avg" +} + variable "aurora_replicalag_timeframe" { description = "Monitor timeframe for RDS Aurora replica lag monitor [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]" type = string @@ -74,4 +80,3 @@ variable "aurora_replicalag_threshold_critical" { description = "Aurora replica lag in milliseconds (critical threshold)" default = "200" } - diff --git a/cloud/aws/rds/aurora/mysql/monitors-rds-aurora-mysql.tf b/cloud/aws/rds/aurora/mysql/monitors-rds-aurora-mysql.tf index c4d63bd..5b9b1f4 100644 --- a/cloud/aws/rds/aurora/mysql/monitors-rds-aurora-mysql.tf +++ b/cloud/aws/rds/aurora/mysql/monitors-rds-aurora-mysql.tf @@ -6,7 +6,7 @@ resource "datadog_monitor" "rds_aurora_mysql_replica_lag" { type = "query alert" query = < ${var.aurora_replicalag_threshold_critical} EOQ diff --git a/cloud/aws/rds/aurora/postgresql/README.md b/cloud/aws/rds/aurora/postgresql/README.md index 75eb888..688b140 100644 --- a/cloud/aws/rds/aurora/postgresql/README.md +++ b/cloud/aws/rds/aurora/postgresql/README.md @@ -27,6 +27,7 @@ Creates DataDog monitors with the following checks: | aurora\_replicalag\_message | Custom message for RDS Aurora replica lag monitor | string | `""` | no | | aurora\_replicalag\_threshold\_critical | Aurora replica lag in milliseconds (critical threshold) | string | `"200"` | no | | aurora\_replicalag\_threshold\_warning | Aurora replica lag in milliseconds (warning threshold) | string | `"100"` | no | +| aurora\_replicalag\_time\_aggregator | Monitor aggregator for RDS Aurora replica lag [available values: min, max or avg] | string | `"avg"` | no | | aurora\_replicalag\_timeframe | Monitor timeframe for RDS Aurora replica lag monitor [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `"last_5m"` | no | | environment | Architecture Environment | string | n/a | yes | | evaluation\_delay | Delay in seconds for the metric evaluation | string | `"900"` | no | @@ -44,4 +45,3 @@ Creates DataDog monitors with the following checks: | rds\_aurora\_postgresql\_replica\_lag\_id | id for monitor rds_aurora_postgresql_replica_lag | ## Related documentation - diff --git a/cloud/aws/rds/aurora/postgresql/inputs.tf b/cloud/aws/rds/aurora/postgresql/inputs.tf index d8ebf55..f06d1ba 100644 --- a/cloud/aws/rds/aurora/postgresql/inputs.tf +++ b/cloud/aws/rds/aurora/postgresql/inputs.tf @@ -59,6 +59,12 @@ variable "aurora_replicalag_message" { default = "" } +variable "aurora_replicalag_time_aggregator" { + description = "Monitor aggregator for RDS Aurora replica lag [available values: min, max or avg]" + type = string + default = "avg" +} + variable "aurora_replicalag_timeframe" { description = "Monitor timeframe for RDS Aurora replica lag monitor [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]" type = string @@ -74,4 +80,3 @@ variable "aurora_replicalag_threshold_critical" { description = "Aurora replica lag in milliseconds (critical threshold)" default = "200" } - diff --git a/cloud/aws/rds/aurora/postgresql/monitors-rds-aurora-postgresql.tf b/cloud/aws/rds/aurora/postgresql/monitors-rds-aurora-postgresql.tf index 77a2ab3..95fc513 100644 --- a/cloud/aws/rds/aurora/postgresql/monitors-rds-aurora-postgresql.tf +++ b/cloud/aws/rds/aurora/postgresql/monitors-rds-aurora-postgresql.tf @@ -6,7 +6,7 @@ resource "datadog_monitor" "rds_aurora_postgresql_replica_lag" { type = "query alert" query = < ${var.aurora_replicalag_threshold_critical} EOQ diff --git a/cloud/aws/rds/common/README.md b/cloud/aws/rds/common/README.md index b2402be..a31cbec 100644 --- a/cloud/aws/rds/common/README.md +++ b/cloud/aws/rds/common/README.md @@ -51,6 +51,7 @@ Creates DataDog monitors with the following checks: | replicalag\_message | Custom message for RDS replica lag monitor | string | `""` | no | | replicalag\_threshold\_critical | replica lag in seconds (critical threshold) | string | `"300"` | no | | replicalag\_threshold\_warning | replica lag in seconds (warning threshold) | string | `"200"` | no | +| replicalag\_time\_aggregator | Monitor aggregator for RDS replica lag [available values: min, max or avg] | string | `"avg"` | no | | replicalag\_timeframe | Monitor timeframe for RDS replica lag monitor [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `"last_5m"` | no | ## Outputs @@ -66,4 +67,3 @@ Creates DataDog monitors with the following checks: DataDog documentation: [https://docs.datadoghq.com/integrations/amazon_rds/](https://docs.datadoghq.com/integrations/amazon_rds/) AWS RDS Instance metrics documentation: [https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/rds-metricscollected.html](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/rds-metricscollected.html) - diff --git a/cloud/aws/rds/common/inputs.tf b/cloud/aws/rds/common/inputs.tf index f7e0796..b9fa171 100644 --- a/cloud/aws/rds/common/inputs.tf +++ b/cloud/aws/rds/common/inputs.tf @@ -139,6 +139,12 @@ variable "replicalag_message" { default = "" } +variable "replicalag_time_aggregator" { + description = "Monitor aggregator for RDS replica lag [available values: min, max or avg]" + type = string + default = "avg" +} + variable "replicalag_timeframe" { description = "Monitor timeframe for RDS replica lag monitor [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]" type = string @@ -154,4 +160,3 @@ variable "replicalag_threshold_critical" { description = "replica lag in seconds (critical threshold)" default = "300" } - diff --git a/cloud/aws/rds/common/monitors-rds-common.tf b/cloud/aws/rds/common/monitors-rds-common.tf index bbef968..b93c60c 100644 --- a/cloud/aws/rds/common/monitors-rds-common.tf +++ b/cloud/aws/rds/common/monitors-rds-common.tf @@ -75,7 +75,7 @@ resource "datadog_monitor" "rds_replica_lag" { type = "query alert" query = < ${var.replicalag_threshold_critical} EOQ