diff --git a/cloud/aws/lambda/README.md b/cloud/aws/lambda/README.md index 484ba04..4bd3792 100644 --- a/cloud/aws/lambda/README.md +++ b/cloud/aws/lambda/README.md @@ -16,9 +16,9 @@ module "datadog-monitors-cloud-aws-lambda" { Creates DataDog monitors with the following checks: -- Lambda Number of Errors -- Lambda Number of Invocations (disabled by default) -- Lambda Number of Throttles +- Lambda Invocations throttled due to concurrent limit reached +- Lambda Number of errors +- Lambda Number of invocations (disabled by default) - Lambda Percentage of errors ## Inputs @@ -44,7 +44,7 @@ Creates DataDog monitors with the following checks: | invocations\_threshold\_critical | Alerting threshold in number of invocations | string | `"1"` | no | | invocations\_threshold\_warning | Warning threshold in number of invocations | string | `"2"` | no | | invocations\_time\_aggregator | Monitor aggregator for Invocations [available values: min, max or avg] | string | `"sum"` | no | -| invocations\_timeframe | Monitor timeframe for Invocations [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `"last_1h"` | no | +| invocations\_timeframe | Monitor timeframe for Invocations [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `"last_30m"` | no | | message | Message sent when a monitor is triggered | string | n/a | yes | | new\_host\_delay | Delay in seconds before monitor new resource | string | `"300"` | no | | pct\_errors\_enabled | Flag to enable Percentage of errors monitor | string | `"true"` | no | diff --git a/cloud/aws/lambda/inputs.tf b/cloud/aws/lambda/inputs.tf index def3ab1..20f0f1f 100644 --- a/cloud/aws/lambda/inputs.tf +++ b/cloud/aws/lambda/inputs.tf @@ -192,7 +192,7 @@ variable "invocations_time_aggregator" { variable "invocations_timeframe" { description = "Monitor timeframe for Invocations [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]" type = string - default = "last_1h" + default = "last_30m" } variable "invocations_threshold_critical" { diff --git a/cloud/aws/lambda/monitors-lambda.tf b/cloud/aws/lambda/monitors-lambda.tf index ce47291..50f5027 100644 --- a/cloud/aws/lambda/monitors-lambda.tf +++ b/cloud/aws/lambda/monitors-lambda.tf @@ -7,10 +7,11 @@ resource "datadog_monitor" "pct_errors" { query = < ${var.pct_errors_threshold_critical} EOQ @@ -40,13 +41,13 @@ resource "datadog_monitor" "pct_errors" { # Errors Absolute Value resource "datadog_monitor" "errors" { count = var.errors_enabled == "true" ? 1 : 0 - name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Lambda Number of Errors {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" + name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Lambda Number of errors {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" type = "metric alert" message = coalesce(var.errors_message, var.message) query = < ${var.errors_threshold_critical} EOQ @@ -76,13 +77,13 @@ resource "datadog_monitor" "errors" { # Throttles resource "datadog_monitor" "throttles" { count = var.throttles_enabled == "true" ? 1 : 0 - name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Lambda Number of Throttles {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" + name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Lambda Invocations throttled due to concurrent limit reached {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" type = "metric alert" message = coalesce(var.throttles_message, var.message) query = < ${var.throttles_threshold_critical} EOQ @@ -112,14 +113,14 @@ resource "datadog_monitor" "throttles" { # INVOCATIONS resource "datadog_monitor" "invocations" { count = var.invocations_enabled == "true" ? 1 : 0 - name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Lambda Number of Invocations {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" + name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Lambda Number of invocations {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" type = "metric alert" message = coalesce(var.invocations_message, var.message) query = <