diff --git a/cloud/aws/alb/README.md b/cloud/aws/alb/README.md index 8f202da..5c17cb0 100644 --- a/cloud/aws/alb/README.md +++ b/cloud/aws/alb/README.md @@ -27,6 +27,7 @@ Creates DataDog monitors with the following checks: | Name | Description | Type | Default | Required | |------|-------------|:----:|:-----:|:-----:| +| alb_no_healthy_instances_enabled | Flag to enable ALB no healthy instances monitor | string | `true` | no | | alb_no_healthy_instances_extra_tags | Extra tags for ALB no healthy instances monitor | list | `` | no | | alb_no_healthy_instances_message | Custom message for ALB no healthy instances monitor | string | `` | no | | alb_no_healthy_instances_silenced | Groups to mute for ALB no healthy instances monitor | map | `` | no | @@ -37,30 +38,35 @@ Creates DataDog monitors with the following checks: | evaluation_delay | Delay in seconds for the metric evaluation | string | `900` | no | | filter_tags_custom | Tags used for custom filtering when filter_tags_use_defaults is false | string | `*` | no | | filter_tags_use_defaults | Use default filter tags convention | string | `true` | no | +| httpcode_alb_4xx_enabled | Flag to enable ALB httpcode 4xx monitor | string | `true` | no | | httpcode_alb_4xx_extra_tags | Extra tags for ALB httpcode 4xx monitor | list | `` | no | | httpcode_alb_4xx_message | Custom message for ALB httpcode 4xx monitor | string | `` | no | | httpcode_alb_4xx_silenced | Groups to mute for ALB httpcode 4xx monitor | map | `` | no | | httpcode_alb_4xx_threshold_critical | loadbalancer 4xx critical threshold in percentage | string | `80` | no | | httpcode_alb_4xx_threshold_warning | loadbalancer 4xx warning threshold in percentage | string | `60` | no | | httpcode_alb_4xx_timeframe | Monitor timeframe for ALB httpcode 4xx [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | +| httpcode_alb_5xx_enabled | Flag to enable ALB httpcode 5xx monitor | string | `true` | no | | httpcode_alb_5xx_extra_tags | Extra tags for ALB httpcode 5xx monitor | list | `` | no | | httpcode_alb_5xx_message | Custom message for ALB httpcode 5xx monitor | string | `` | no | | httpcode_alb_5xx_silenced | Groups to mute for ALB httpcode 5xx monitor | map | `` | no | | httpcode_alb_5xx_threshold_critical | loadbalancer 5xx critical threshold in percentage | string | `80` | no | | httpcode_alb_5xx_threshold_warning | loadbalancer 5xx warning threshold in percentage | string | `60` | no | | httpcode_alb_5xx_timeframe | Monitor timeframe for ALB httpcode 5xx [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | +| httpcode_target_4xx_enabled | Flag to enable ALB target httpcode 4xx monitor | string | `true` | no | | httpcode_target_4xx_extra_tags | Extra tags for ALB target httpcode 4xx monitor | list | `` | no | | httpcode_target_4xx_message | Custom message for ALB target httpcode 4xx monitor | string | `` | no | | httpcode_target_4xx_silenced | Groups to mute for ALB target httpcode 4xx monitor | map | `` | no | | httpcode_target_4xx_threshold_critical | target 4xx critical threshold in percentage | string | `80` | no | | httpcode_target_4xx_threshold_warning | target 4xx warning threshold in percentage | string | `60` | no | | httpcode_target_4xx_timeframe | Monitor timeframe for ALB target httpcode 4xx [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | +| httpcode_target_5xx_enabled | Flag to enable ALB target httpcode 5xx monitor | string | `true` | no | | httpcode_target_5xx_extra_tags | Extra tags for ALB target httpcode 5xx monitor | list | `` | no | | httpcode_target_5xx_message | Custom message for ALB target httpcode 5xx monitor | string | `` | no | | httpcode_target_5xx_silenced | Groups to mute for ALB target httpcode 5xx monitor | map | `` | no | | httpcode_target_5xx_threshold_critical | target 5xx critical threshold in percentage | string | `80` | no | | httpcode_target_5xx_threshold_warning | target 5xx warning threshold in percentage | string | `60` | no | | httpcode_target_5xx_timeframe | Monitor timeframe for ALB target httpcode 5xx [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | +| latency_enabled | Flag to enable ALB latency monitor | string | `true` | no | | latency_extra_tags | Extra tags for ALB latency monitor | list | `` | no | | latency_message | Custom message for ALB latency monitor | string | `` | no | | latency_silenced | Groups to mute for ALB latency monitor | map | `` | no | diff --git a/cloud/aws/alb/inputs.tf b/cloud/aws/alb/inputs.tf index 8dc3808..721274a 100644 --- a/cloud/aws/alb/inputs.tf +++ b/cloud/aws/alb/inputs.tf @@ -37,6 +37,12 @@ variable "alb_no_healthy_instances_silenced" { default = {} } +variable "alb_no_healthy_instances_enabled" { + description = "Flag to enable ALB no healthy instances monitor" + type = "string" + default = "true" +} + variable "alb_no_healthy_instances_extra_tags" { description = "Extra tags for ALB no healthy instances monitor" type = "list" @@ -67,6 +73,12 @@ variable "latency_silenced" { default = {} } +variable "latency_enabled" { + description = "Flag to enable ALB latency monitor" + type = "string" + default = "true" +} + variable "latency_extra_tags" { description = "Extra tags for ALB latency monitor" type = "list" @@ -107,6 +119,12 @@ variable "httpcode_alb_4xx_silenced" { default = {} } +variable "httpcode_alb_4xx_enabled" { + description = "Flag to enable ALB httpcode 4xx monitor" + type = "string" + default = "true" +} + variable "httpcode_alb_4xx_extra_tags" { description = "Extra tags for ALB httpcode 4xx monitor" type = "list" @@ -141,6 +159,12 @@ variable "httpcode_target_4xx_silenced" { default = {} } +variable "httpcode_target_4xx_enabled" { + description = "Flag to enable ALB target httpcode 4xx monitor" + type = "string" + default = "true" +} + variable "httpcode_target_4xx_extra_tags" { description = "Extra tags for ALB target httpcode 4xx monitor" type = "list" @@ -175,6 +199,12 @@ variable "httpcode_alb_5xx_silenced" { default = {} } +variable "httpcode_alb_5xx_enabled" { + description = "Flag to enable ALB httpcode 5xx monitor" + type = "string" + default = "true" +} + variable "httpcode_alb_5xx_extra_tags" { description = "Extra tags for ALB httpcode 5xx monitor" type = "list" @@ -209,6 +239,12 @@ variable "httpcode_target_5xx_silenced" { default = {} } +variable "httpcode_target_5xx_enabled" { + description = "Flag to enable ALB target httpcode 5xx monitor" + type = "string" + default = "true" +} + variable "httpcode_target_5xx_extra_tags" { description = "Extra tags for ALB target httpcode 5xx monitor" type = "list" diff --git a/cloud/aws/alb/monitors-alb.tf b/cloud/aws/alb/monitors-alb.tf index cb4b232..c57da93 100644 --- a/cloud/aws/alb/monitors-alb.tf +++ b/cloud/aws/alb/monitors-alb.tf @@ -1,4 +1,5 @@ resource "datadog_monitor" "ALB_no_healthy_instances" { + count = "${var.alb_no_healthy_instances_enabled ? 1 : 0}" name = "[${var.environment}] ALB no healthy instances" type = "metric alert" message = "${coalesce(var.alb_no_healthy_instances_message, var.message)}" @@ -28,6 +29,7 @@ resource "datadog_monitor" "ALB_no_healthy_instances" { } resource "datadog_monitor" "ALB_latency" { + count = "${var.latency_enabled ? 1 : 0}" name = "[${var.environment}] ALB latency {{#is_alert}}{{{comparator}}} {{threshold}}s ({{value}}s){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}s ({{value}}s){{/is_warning}}" type = "metric alert" message = "${coalesce(var.latency_message, var.message)}" @@ -58,6 +60,7 @@ resource "datadog_monitor" "ALB_latency" { } resource "datadog_monitor" "ALB_httpcode_5xx" { + count = "${var.httpcode_alb_5xx_enabled ? 1 : 0}" name = "[${var.environment}] ALB HTTP code 5xx {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" type = "metric alert" message = "${coalesce(var.httpcode_alb_5xx_message, var.message)}" @@ -91,6 +94,7 @@ resource "datadog_monitor" "ALB_httpcode_5xx" { } resource "datadog_monitor" "ALB_httpcode_4xx" { + count = "${var.httpcode_alb_4xx_enabled ? 1 : 0}" name = "[${var.environment}] ALB HTTP code 4xx {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" type = "metric alert" message = "${coalesce(var.httpcode_alb_4xx_message, var.message)}" @@ -124,6 +128,7 @@ resource "datadog_monitor" "ALB_httpcode_4xx" { } resource "datadog_monitor" "ALB_httpcode_target_5xx" { + count = "${var.httpcode_target_5xx_enabled ? 1 : 0}" name = "[${var.environment}] ALB target HTTP code 5xx {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" type = "metric alert" message = "${coalesce(var.httpcode_target_5xx_message, var.message)}" @@ -157,6 +162,7 @@ resource "datadog_monitor" "ALB_httpcode_target_5xx" { } resource "datadog_monitor" "ALB_httpcode_target_4xx" { + count = "${var.httpcode_target_4xx_enabled ? 1 : 0}" name = "[${var.environment}] ALB target HTTP code 4xx {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" type = "metric alert" message = "${coalesce(var.httpcode_target_4xx_message, var.message)}" diff --git a/cloud/aws/alb/outputs.tf b/cloud/aws/alb/outputs.tf index 27b5f1f..9a88a81 100644 --- a/cloud/aws/alb/outputs.tf +++ b/cloud/aws/alb/outputs.tf @@ -1,29 +1,29 @@ output "ALB_no_healthy_instances_id" { description = "id for monitor ALB_no_healthy_instances" - value = "${datadog_monitor.ALB_no_healthy_instances.id}" + value = "${datadog_monitor.ALB_no_healthy_instances.*.id}" } output "ALB_latency_id" { description = "id for monitor ALB_latency" - value = "${datadog_monitor.ALB_latency.id}" + value = "${datadog_monitor.ALB_latency.*.id}" } output "ALB_httpcode_5xx_id" { description = "id for monitor ALB_httpcode_5xx" - value = "${datadog_monitor.ALB_httpcode_5xx.id}" + value = "${datadog_monitor.ALB_httpcode_5xx.*.id}" } output "ALB_httpcode_4xx_id" { description = "id for monitor ALB_httpcode_4xx" - value = "${datadog_monitor.ALB_httpcode_4xx.id}" + value = "${datadog_monitor.ALB_httpcode_4xx.*.id}" } output "ALB_httpcode_target_5xx_id" { description = "id for monitor ALB_httpcode_target_5xx" - value = "${datadog_monitor.ALB_httpcode_target_5xx.id}" + value = "${datadog_monitor.ALB_httpcode_target_5xx.*.id}" } output "ALB_httpcode_target_4xx_id" { description = "id for monitor ALB_httpcode_target_4xx" - value = "${datadog_monitor.ALB_httpcode_target_4xx.id}" + value = "${datadog_monitor.ALB_httpcode_target_4xx.*.id}" } diff --git a/cloud/aws/apigateway/README.md b/cloud/aws/apigateway/README.md index 50a1496..57258b3 100644 --- a/cloud/aws/apigateway/README.md +++ b/cloud/aws/apigateway/README.md @@ -28,18 +28,21 @@ Creates DataDog monitors with the following checks: | environment | Environment | string | - | yes | | evaluation_delay | Delay in seconds for the metric evaluation | string | `900` | no | | filter_tags | Tags used for filtering | string | `*` | no | +| http_4xx_requests_enabled | Flag to enable API Gateway HTTP 4xx requests monitor | string | `true` | no | | http_4xx_requests_extra_tags | Extra tags for API Gateway HTTP 4xx requests monitor | list | `` | no | | http_4xx_requests_message | Custom message for API Gateway HTTP 4xx requests monitor | string | `` | no | | http_4xx_requests_silenced | Groups to mute for API Gateway HTTP 4xx requests monitor | map | `` | no | | http_4xx_requests_threshold_critical | Maximum critical acceptable percent of 4xx errors | string | `30` | no | | http_4xx_requests_threshold_warning | Maximum warning acceptable percent of 4xx errors | string | `15` | no | | http_4xx_requests_timeframe | Monitor timeframe for API HTTP 4xx requests [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | +| http_5xx_requests_enabled | Flag to enable API Gateway HTTP 5xx requests monitor | string | `true` | no | | http_5xx_requests_extra_tags | Extra tags for API Gateway HTTP 5xx requests monitor | list | `` | no | | http_5xx_requests_message | Custom message for API Gateway HTTP 5xx requests monitor | string | `` | no | | http_5xx_requests_silenced | Groups to mute for API Gateway HTTP 5xx requests monitor | map | `` | no | | http_5xx_requests_threshold_critical | Maximum critical acceptable percent of 5xx errors | string | `20` | no | | http_5xx_requests_threshold_warning | Maximum warning acceptable percent of 5xx errors | string | `10` | no | | http_5xx_requests_timeframe | Monitor timeframe for API HTTP 5xx requests [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | +| latency_enabled | Flag to enable API Gateway latency monitor | string | `true` | no | | latency_extra_tags | Extra tags for API Gateway latency monitor | list | `` | no | | latency_message | Custom message for API Gateway latency monitor | string | `` | no | | latency_silenced | Groups to mute for API Gateway latency monitor | map | `` | no | diff --git a/cloud/aws/apigateway/inputs.tf b/cloud/aws/apigateway/inputs.tf index 5fb3744..810080d 100644 --- a/cloud/aws/apigateway/inputs.tf +++ b/cloud/aws/apigateway/inputs.tf @@ -32,6 +32,12 @@ variable "latency_silenced" { default = {} } +variable "latency_enabled" { + description = "Flag to enable API Gateway latency monitor" + type = "string" + default = "true" +} + variable "latency_extra_tags" { description = "Extra tags for API Gateway latency monitor" type = "list" @@ -76,6 +82,12 @@ variable "http_5xx_requests_silenced" { default = {} } +variable "http_5xx_requests_enabled" { + description = "Flag to enable API Gateway HTTP 5xx requests monitor" + type = "string" + default = "true" +} + variable "http_5xx_requests_extra_tags" { description = "Extra tags for API Gateway HTTP 5xx requests monitor" type = "list" @@ -114,6 +126,12 @@ variable "http_4xx_requests_silenced" { default = {} } +variable "http_4xx_requests_enabled" { + description = "Flag to enable API Gateway HTTP 4xx requests monitor" + type = "string" + default = "true" +} + variable "http_4xx_requests_extra_tags" { description = "Extra tags for API Gateway HTTP 4xx requests monitor" type = "list" diff --git a/cloud/aws/apigateway/monitors-api.tf b/cloud/aws/apigateway/monitors-api.tf index 81ea5c3..e19b7ec 100644 --- a/cloud/aws/apigateway/monitors-api.tf +++ b/cloud/aws/apigateway/monitors-api.tf @@ -1,5 +1,6 @@ # Monitoring Api Gateway latency resource "datadog_monitor" "API_Gateway_latency" { + count = "${var.latency_enabled ? 1 : 0}" name = "[${var.environment}] API Gateway latency {{#is_alert}}{{{comparator}}} {{threshold}}ms ({{value}}ms){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}ms ({{value}}ms){{/is_warning}}" type = "metric alert" message = "${coalesce(var.latency_message, var.message)}" @@ -31,6 +32,7 @@ resource "datadog_monitor" "API_Gateway_latency" { # Monitoring API Gateway 5xx errors percent resource "datadog_monitor" "API_http_5xx_errors_count" { + count = "${var.http_5xx_requests_enabled ? 1 : 0}" name = "[${var.environment}] API Gateway HTTP 5xx errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" type = "metric alert" message = "${coalesce(var.http_5xx_requests_message, var.message)}" @@ -65,6 +67,7 @@ resource "datadog_monitor" "API_http_5xx_errors_count" { # Monitoring API Gateway 4xx errors percent resource "datadog_monitor" "API_http_4xx_errors_count" { + count = "${var.http_4xx_requests_enabled ? 1 : 0}" name = "[${var.environment}] API Gateway HTTP 4xx errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" type = "metric alert" message = "${coalesce(var.http_4xx_requests_message, var.message)}" diff --git a/cloud/aws/apigateway/outputs.tf b/cloud/aws/apigateway/outputs.tf index 43812ba..cfcce70 100644 --- a/cloud/aws/apigateway/outputs.tf +++ b/cloud/aws/apigateway/outputs.tf @@ -1,14 +1,14 @@ output "API_Gateway_latency_id" { description = "id for monitor API_Gateway_latency" - value = "${datadog_monitor.API_Gateway_latency.id}" + value = "${datadog_monitor.API_Gateway_latency.*.id}" } output "API_http_5xx_errors_count_id" { description = "id for monitor API_http_5xx_errors_count" - value = "${datadog_monitor.API_http_5xx_errors_count.id}" + value = "${datadog_monitor.API_http_5xx_errors_count.*.id}" } output "API_http_4xx_errors_count_id" { description = "id for monitor API_http_4xx_errors_count" - value = "${datadog_monitor.API_http_4xx_errors_count.id}" + value = "${datadog_monitor.API_http_4xx_errors_count.*.id}" } diff --git a/cloud/aws/elasticsearch/README.md b/cloud/aws/elasticsearch/README.md index 62c7619..23ab741 100644 --- a/cloud/aws/elasticsearch/README.md +++ b/cloud/aws/elasticsearch/README.md @@ -24,6 +24,7 @@ Creates DataDog monitors with the following checks: | Name | Description | Type | Default | Required | |------|-------------|:----:|:-----:|:-----:| +| cpu_enabled | Flag to enable ES cluster cpu monitor | string | `true` | no | | cpu_extra_tags | Extra tags for ES cluster cpu monitor | list | `` | no | | cpu_message | Custom message for ES cluster cpu monitor | string | `` | no | | cpu_silenced | Groups to mute for ES cluster cpu monitor | map | `` | no | @@ -31,6 +32,7 @@ Creates DataDog monitors with the following checks: | cpu_threshold_warning | CPU usage in percent (warning threshold) | string | `80` | no | | cpu_time_aggregator | Monitor aggregator for ES cluster cpu [available values: min, max or avg] | string | `min` | no | | cpu_timeframe | Monitor timeframe for ES cluster cpu [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_15m` | no | +| diskspace_enabled | Flag to enable ES cluster diskspace monitor | string | `true` | no | | diskspace_extra_tags | Extra tags for ES cluster diskspace monitor | list | `` | no | | diskspace_message | Custom message for ES cluster diskspace monitor | string | `` | no | | diskspace_silenced | Groups to mute for ES cluster diskspace monitor | map | `` | no | @@ -39,6 +41,7 @@ Creates DataDog monitors with the following checks: | diskspace_time_aggregator | Monitor aggregator for ES cluster diskspace [available values: min, max or avg] | string | `max` | no | | diskspace_timeframe | Monitor timeframe for ES cluster diskspace [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_15m` | no | | environment | Architecture Environment | string | - | yes | +| es_cluster_status_enabled | Flag to enable ES cluster status monitor | string | `true` | no | | es_cluster_status_extra_tags | Extra tags for ES cluster status monitor | list | `` | no | | es_cluster_status_message | Custom message for ES cluster status monitor | string | `` | no | | es_cluster_status_silenced | Groups to mute for ES cluster status monitor | map | `` | no | diff --git a/cloud/aws/elasticsearch/inputs.tf b/cloud/aws/elasticsearch/inputs.tf index 29c0974..8080198 100644 --- a/cloud/aws/elasticsearch/inputs.tf +++ b/cloud/aws/elasticsearch/inputs.tf @@ -37,6 +37,12 @@ variable "es_cluster_status_silenced" { default = {} } +variable "es_cluster_status_enabled" { + description = "Flag to enable ES cluster status monitor" + type = "string" + default = "true" +} + variable "es_cluster_status_extra_tags" { description = "Extra tags for ES cluster status monitor" type = "list" @@ -65,6 +71,12 @@ variable "diskspace_silenced" { default = {} } +variable "diskspace_enabled" { + description = "Flag to enable ES cluster diskspace monitor" + type = "string" + default = "true" +} + variable "diskspace_extra_tags" { description = "Extra tags for ES cluster diskspace monitor" type = "list" @@ -105,6 +117,12 @@ variable "cpu_silenced" { default = {} } +variable "cpu_enabled" { + description = "Flag to enable ES cluster cpu monitor" + type = "string" + default = "true" +} + variable "cpu_extra_tags" { description = "Extra tags for ES cluster cpu monitor" type = "list" diff --git a/cloud/aws/elasticsearch/monitors-elasticsearch.tf b/cloud/aws/elasticsearch/monitors-elasticsearch.tf index c718d84..84f24eb 100644 --- a/cloud/aws/elasticsearch/monitors-elasticsearch.tf +++ b/cloud/aws/elasticsearch/monitors-elasticsearch.tf @@ -4,6 +4,7 @@ - If aws.es.cluster_statusyellow is 1 --> 1 < query value (=1.1) < 2 : warning Workaround : in the query, we add "0.1" to the result and we use the comparator ">=". No alert was triggered without that. */ resource "datadog_monitor" "es_cluster_status" { + count = "${var.es_cluster_status_enabled ? 1 : 0}" name = "[${var.environment}] ElasticSearch cluster status is not green" message = "${coalesce(var.es_cluster_status_message, var.message)}" @@ -38,6 +39,7 @@ EOF ### Elasticsearch cluster free storage space monitor ### resource "datadog_monitor" "es_free_space_low" { + count = "${var.diskspace_enabled ? 1 : 0}" name = "[${var.environment}] ElasticSearch cluster free storage space {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.diskspace_message, var.message)}" @@ -72,6 +74,7 @@ EOF ### Elasticsearch cluster CPU monitor ### resource "datadog_monitor" "es_cpu_90_15min" { + count = "${var.cpu_enabled ? 1 : 0}" name = "[${var.environment}] ElasticSearch cluster CPU high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.cpu_message, var.message)}" diff --git a/cloud/aws/elasticsearch/outputs.tf b/cloud/aws/elasticsearch/outputs.tf index 69a6ab6..dc12393 100644 --- a/cloud/aws/elasticsearch/outputs.tf +++ b/cloud/aws/elasticsearch/outputs.tf @@ -1,14 +1,14 @@ output "es_cluster_status_id" { description = "id for monitor es_cluster_status" - value = "${datadog_monitor.es_cluster_status.id}" + value = "${datadog_monitor.es_cluster_status.*.id}" } output "es_free_space_low_id" { description = "id for monitor es_free_space_low" - value = "${datadog_monitor.es_free_space_low.id}" + value = "${datadog_monitor.es_free_space_low.*.id}" } output "es_cpu_90_15min_id" { description = "id for monitor es_cpu_90_15min" - value = "${datadog_monitor.es_cpu_90_15min.id}" + value = "${datadog_monitor.es_cpu_90_15min.*.id}" } diff --git a/cloud/aws/elb/README.md b/cloud/aws/elb/README.md index 04273d7..3fa748f 100644 --- a/cloud/aws/elb/README.md +++ b/cloud/aws/elb/README.md @@ -28,24 +28,28 @@ Creates DataDog monitors with the following checks: | Name | Description | Type | Default | Required | |------|-------------|:----:|:-----:|:-----:| | artificial_requests_count | Number of false requests used to mitigate false positive in case of low trafic | string | `5` | no | +| elb_4xx_enabled | Flag to enable ELB 4xx errors monitor | string | `true` | no | | elb_4xx_extra_tags | Extra tags for ELB 4xx errors monitor | list | `` | no | | elb_4xx_message | Custom message for ELB 4xx errors monitor | string | `` | no | | elb_4xx_silenced | Groups to mute for ELB 4xx errors monitor | map | `` | no | | elb_4xx_threshold_critical | loadbalancer 4xx critical threshold in percentage | string | `10` | no | | elb_4xx_threshold_warning | loadbalancer 4xx warning threshold in percentage | string | `5` | no | | elb_4xx_timeframe | Monitor timeframe for ELB 4xx errors [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | +| elb_5xx_enabled | Flag to enable ELB 5xx errors monitor | string | `true` | no | | elb_5xx_extra_tags | Extra tags for ELB 5xx errors monitor | list | `` | no | | elb_5xx_message | Custom message for ELB 5xx errors monitor | string | `` | no | | elb_5xx_silenced | Groups to mute for ELB 5xx errors monitor | map | `` | no | | elb_5xx_threshold_critical | loadbalancer 5xx critical threshold in percentage | string | `10` | no | | elb_5xx_threshold_warning | loadbalancer 5xx warning threshold in percentage | string | `5` | no | | elb_5xx_timeframe | Monitor timeframe for ELB 5xx errors [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | +| elb_backend_4xx_enabled | Flag to enable ELB backend 4xx errors monitor | string | `true` | no | | elb_backend_4xx_extra_tags | Extra tags for ELB backend 4xx errors monitor | list | `` | no | | elb_backend_4xx_message | Custom message for ELB backend 4xx errors monitor | string | `` | no | | elb_backend_4xx_silenced | Groups to mute for ELB backend 4xx errors monitor | map | `` | no | | elb_backend_4xx_threshold_critical | loadbalancer backend 4xx critical threshold in percentage | string | `10` | no | | elb_backend_4xx_threshold_warning | loadbalancer backend 4xx warning threshold in percentage | string | `5` | no | | elb_backend_4xx_timeframe | Monitor timeframe for ELB backend 4xx errors [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | +| elb_backend_5xx_enabled | Flag to enable ELB backend 5xx errors monitor | string | `true` | no | | elb_backend_5xx_extra_tags | Extra tags for ELB backend 5xx errors monitor | list | `` | no | | elb_backend_5xx_message | Custom message for ELB backend 5xx errors monitor | string | `` | no | | elb_backend_5xx_silenced | Groups to mute for ELB backend 5xx errors monitor | map | `` | no | @@ -53,12 +57,14 @@ Creates DataDog monitors with the following checks: | elb_backend_5xx_threshold_warning | loadbalancer backend 5xx warning threshold in percentage | string | `5` | no | | elb_backend_5xx_timeframe | Monitor timeframe for ELB backend 5xx errors [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | | elb_backend_latency_critical | latency critical threshold in seconds | string | `5` | no | +| elb_backend_latency_enabled | Flag to enable ELB backend latency monitor | string | `true` | no | | elb_backend_latency_extra_tags | Extra tags for ELB backend latency monitor | list | `` | no | | elb_backend_latency_message | Custom message for ELB backend latency monitor | string | `` | no | | elb_backend_latency_silenced | Groups to mute for ELB backend latency monitor | map | `` | no | | elb_backend_latency_time_aggregator | Monitor aggregator for ELB backend latency [available values: min, max or avg] | string | `min` | no | | elb_backend_latency_timeframe | Monitor timeframe for ELB backend latency [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | | elb_backend_latency_warning | latency warning threshold in seconds | string | `1` | no | +| elb_no_healthy_instance_enabled | Flag to enable ELB no healty instance monitor | string | `true` | no | | elb_no_healthy_instance_extra_tags | Extra tags for ELB no healty instance monitor | list | `` | no | | elb_no_healthy_instance_message | Custom message for ELB no healty instance monitor | string | `` | no | | elb_no_healthy_instance_silenced | Groups to mute for ELB no healty instance monitor | map | `` | no | diff --git a/cloud/aws/elb/inputs.tf b/cloud/aws/elb/inputs.tf index 7654cbc..44085f3 100644 --- a/cloud/aws/elb/inputs.tf +++ b/cloud/aws/elb/inputs.tf @@ -36,6 +36,12 @@ variable "elb_no_healthy_instance_silenced" { default = {} } +variable "elb_no_healthy_instance_enabled" { + description = "Flag to enable ELB no healty instance monitor" + type = "string" + default = "true" +} + variable "elb_no_healthy_instance_extra_tags" { description = "Extra tags for ELB no healty instance monitor" type = "list" @@ -66,6 +72,12 @@ variable "elb_4xx_silenced" { default = {} } +variable "elb_4xx_enabled" { + description = "Flag to enable ELB 4xx errors monitor" + type = "string" + default = "true" +} + variable "elb_4xx_extra_tags" { description = "Extra tags for ELB 4xx errors monitor" type = "list" @@ -100,6 +112,12 @@ variable "elb_5xx_silenced" { default = {} } +variable "elb_5xx_enabled" { + description = "Flag to enable ELB 5xx errors monitor" + type = "string" + default = "true" +} + variable "elb_5xx_extra_tags" { description = "Extra tags for ELB 5xx errors monitor" type = "list" @@ -134,6 +152,12 @@ variable "elb_backend_4xx_silenced" { default = {} } +variable "elb_backend_4xx_enabled" { + description = "Flag to enable ELB backend 4xx errors monitor" + type = "string" + default = "true" +} + variable "elb_backend_4xx_extra_tags" { description = "Extra tags for ELB backend 4xx errors monitor" type = "list" @@ -168,6 +192,12 @@ variable "elb_backend_5xx_silenced" { default = {} } +variable "elb_backend_5xx_enabled" { + description = "Flag to enable ELB backend 5xx errors monitor" + type = "string" + default = "true" +} + variable "elb_backend_5xx_extra_tags" { description = "Extra tags for ELB backend 5xx errors monitor" type = "list" @@ -202,6 +232,12 @@ variable "elb_backend_latency_silenced" { default = {} } +variable "elb_backend_latency_enabled" { + description = "Flag to enable ELB backend latency monitor" + type = "string" + default = "true" +} + variable "elb_backend_latency_extra_tags" { description = "Extra tags for ELB backend latency monitor" type = "list" diff --git a/cloud/aws/elb/monitors-elb.tf b/cloud/aws/elb/monitors-elb.tf index 61b44c7..62bbcf4 100644 --- a/cloud/aws/elb/monitors-elb.tf +++ b/cloud/aws/elb/monitors-elb.tf @@ -1,4 +1,5 @@ resource "datadog_monitor" "ELB_no_healthy_instances" { + count = "${var.elb_no_healthy_instance_enabled ? 1 : 0}" name = "[${var.environment}] ELB no healthy instances" message = "${coalesce(var.elb_no_healthy_instance_message, var.message)}" @@ -26,6 +27,7 @@ resource "datadog_monitor" "ELB_no_healthy_instances" { } resource "datadog_monitor" "ELB_too_much_4xx" { + count = "${var.elb_4xx_enabled ? 1 : 0}" name = "[${var.environment}] ELB 4xx errors too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.elb_4xx_message, var.message)}" @@ -61,6 +63,7 @@ resource "datadog_monitor" "ELB_too_much_4xx" { } resource "datadog_monitor" "ELB_too_much_5xx" { + count = "${var.elb_5xx_enabled ? 1 : 0}" name = "[${var.environment}] ELB 5xx errors too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.elb_5xx_message, var.message)}" @@ -96,6 +99,7 @@ resource "datadog_monitor" "ELB_too_much_5xx" { } resource "datadog_monitor" "ELB_too_much_4xx_backend" { + count = "${var.elb_backend_4xx_enabled ? 1 : 0}" name = "[${var.environment}] ELB backend 4xx errors too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.elb_backend_4xx_message, var.message)}" @@ -131,6 +135,7 @@ resource "datadog_monitor" "ELB_too_much_4xx_backend" { } resource "datadog_monitor" "ELB_too_much_5xx_backend" { + count = "${var.elb_backend_5xx_enabled ? 1 : 0}" name = "[${var.environment}] ELB backend 5xx errors too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.elb_backend_5xx_message, var.message)}" @@ -166,6 +171,7 @@ resource "datadog_monitor" "ELB_too_much_5xx_backend" { } resource "datadog_monitor" "ELB_backend_latency" { + count = "${var.elb_backend_latency_enabled ? 1 : 0}" name = "[${var.environment}] ELB latency too high {{#is_alert}}{{{comparator}}} {{threshold}}s ({{value}}s){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}s ({{value}}s){{/is_warning}}" message = "${coalesce(var.elb_backend_latency_message, var.message)}" diff --git a/cloud/aws/elb/outputs.tf b/cloud/aws/elb/outputs.tf index 835b219..d657bc4 100644 --- a/cloud/aws/elb/outputs.tf +++ b/cloud/aws/elb/outputs.tf @@ -1,29 +1,29 @@ output "ELB_no_healthy_instances_id" { description = "id for monitor ELB_no_healthy_instances" - value = "${datadog_monitor.ELB_no_healthy_instances.id}" + value = "${datadog_monitor.ELB_no_healthy_instances.*.id}" } output "ELB_too_much_4xx_id" { description = "id for monitor ELB_too_much_4xx" - value = "${datadog_monitor.ELB_too_much_4xx.id}" + value = "${datadog_monitor.ELB_too_much_4xx.*.id}" } output "ELB_too_much_5xx_id" { description = "id for monitor ELB_too_much_5xx" - value = "${datadog_monitor.ELB_too_much_5xx.id}" + value = "${datadog_monitor.ELB_too_much_5xx.*.id}" } output "ELB_too_much_4xx_backend_id" { description = "id for monitor ELB_too_much_4xx_backend" - value = "${datadog_monitor.ELB_too_much_4xx_backend.id}" + value = "${datadog_monitor.ELB_too_much_4xx_backend.*.id}" } output "ELB_too_much_5xx_backend_id" { description = "id for monitor ELB_too_much_5xx_backend" - value = "${datadog_monitor.ELB_too_much_5xx_backend.id}" + value = "${datadog_monitor.ELB_too_much_5xx_backend.*.id}" } output "ELB_backend_latency_id" { description = "id for monitor ELB_backend_latency" - value = "${datadog_monitor.ELB_backend_latency.id}" + value = "${datadog_monitor.ELB_backend_latency.*.id}" } diff --git a/cloud/aws/kinesis-firehose/README.md b/cloud/aws/kinesis-firehose/README.md index 5c0d8e1..6f07141 100644 --- a/cloud/aws/kinesis-firehose/README.md +++ b/cloud/aws/kinesis-firehose/README.md @@ -26,6 +26,7 @@ Creates DataDog monitors with the following checks: | evaluation_delay | Delay in seconds for the metric evaluation | string | `900` | no | | filter_tags_custom | Tags used for custom filtering when filter_tags_use_defaults is false | string | `*` | no | | filter_tags_use_defaults | Use default filter tags convention | string | `true` | no | +| incoming_records_enabled | Flag to enable Kinesis Firehorse incoming records monitor | string | `true` | no | | incoming_records_extra_tags | Extra tags for Kinesis Firehorse incoming records monitor | list | `` | no | | incoming_records_message | Custom message for Kinesis Firehorse incoming records monitor | string | `` | no | | incoming_records_silenced | Groups to mute for Kinesis Firehorse incoming records monitor | map | `` | no | diff --git a/cloud/aws/kinesis-firehose/inputs.tf b/cloud/aws/kinesis-firehose/inputs.tf index b229e6b..f8aa2a9 100644 --- a/cloud/aws/kinesis-firehose/inputs.tf +++ b/cloud/aws/kinesis-firehose/inputs.tf @@ -37,6 +37,12 @@ variable "incoming_records_silenced" { default = {} } +variable "incoming_records_enabled" { + description = "Flag to enable Kinesis Firehorse incoming records monitor" + type = "string" + default = "true" +} + variable "incoming_records_extra_tags" { description = "Extra tags for Kinesis Firehorse incoming records monitor" type = "list" diff --git a/cloud/aws/kinesis-firehose/monitors-kinesis-firehose.tf b/cloud/aws/kinesis-firehose/monitors-kinesis-firehose.tf index 6d0f428..4ddc01a 100644 --- a/cloud/aws/kinesis-firehose/monitors-kinesis-firehose.tf +++ b/cloud/aws/kinesis-firehose/monitors-kinesis-firehose.tf @@ -1,5 +1,6 @@ ### Kinesis Firehose Incoming records ### resource "datadog_monitor" "firehose_incoming_records" { + count = "${var.incoming_records_enabled ? 1 : 0}" name = "[${var.environment}] Kinesis Firehose No incoming records" message = "${coalesce(var.incoming_records_message, var.message)}" diff --git a/cloud/aws/kinesis-firehose/outputs.tf b/cloud/aws/kinesis-firehose/outputs.tf index 5989c7d..6e3e2df 100644 --- a/cloud/aws/kinesis-firehose/outputs.tf +++ b/cloud/aws/kinesis-firehose/outputs.tf @@ -1,4 +1,4 @@ output "firehose_incoming_records_id" { description = "id for monitor firehose_incoming_records" - value = "${datadog_monitor.firehose_incoming_records.id}" + value = "${datadog_monitor.firehose_incoming_records.*.id}" } diff --git a/cloud/aws/rds/README.md b/cloud/aws/rds/README.md index d4941ab..38a67e9 100644 --- a/cloud/aws/rds/README.md +++ b/cloud/aws/rds/README.md @@ -23,6 +23,7 @@ Creates DataDog monitors with the following checks: | Name | Description | Type | Default | Required | |------|-------------|:----:|:-----:|:-----:| +| cpu_enabled | Flag to enable RDS CPU usage monitor | string | `true` | no | | cpu_extra_tags | Extra tags for RDS CPU usage monitor | list | `` | no | | cpu_message | Custom message for RDS CPU usage monitor | string | `` | no | | cpu_silenced | Groups to mute for RDS CPU usage monitor | map | `` | no | @@ -30,6 +31,7 @@ Creates DataDog monitors with the following checks: | cpu_threshold_warning | CPU usage in percent (warning threshold) | string | `80` | no | | cpu_time_aggregator | Monitor aggregator for RDS CPU usage [available values: min, max or avg] | string | `min` | no | | cpu_timeframe | Monitor timeframe for RDS CPU usage [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_15m` | no | +| diskspace_enabled | Flag to enable RDS free diskspace monitor | string | `true` | no | | diskspace_extra_tags | Extra tags for RDS free diskspace monitor | list | `` | no | | diskspace_message | Custom message for RDS free diskspace monitor | string | `` | no | | diskspace_silenced | Groups to mute for RDS free diskspace monitor | map | `` | no | diff --git a/cloud/aws/rds/inputs.tf b/cloud/aws/rds/inputs.tf index 4c8d05b..54cf425 100644 --- a/cloud/aws/rds/inputs.tf +++ b/cloud/aws/rds/inputs.tf @@ -37,6 +37,12 @@ variable "cpu_silenced" { default = {} } +variable "cpu_enabled" { + description = "Flag to enable RDS CPU usage monitor" + type = "string" + default = "true" +} + variable "cpu_extra_tags" { description = "Extra tags for RDS CPU usage monitor" type = "list" @@ -77,6 +83,12 @@ variable "diskspace_silenced" { default = {} } +variable "diskspace_enabled" { + description = "Flag to enable RDS free diskspace monitor" + type = "string" + default = "true" +} + variable "diskspace_extra_tags" { description = "Extra tags for RDS free diskspace monitor" type = "list" diff --git a/cloud/aws/rds/monitors-rds.tf b/cloud/aws/rds/monitors-rds.tf index 9563a0a..3168194 100644 --- a/cloud/aws/rds/monitors-rds.tf +++ b/cloud/aws/rds/monitors-rds.tf @@ -1,5 +1,6 @@ ### RDS instance CPU monitor ### resource "datadog_monitor" "rds_cpu_90_15min" { + count = "${var.cpu_enabled ? 1 : 0}" name = "[${var.environment}] RDS instance CPU high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.cpu_message, var.message)}" @@ -32,6 +33,7 @@ EOF ### RDS instance free space monitor ### resource "datadog_monitor" "rds_free_space_low" { + count = "${var.diskspace_enabled ? 1 : 0}" name = "[${var.environment}] RDS instance free space {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.diskspace_message, var.message)}" diff --git a/cloud/aws/rds/outputs.tf b/cloud/aws/rds/outputs.tf index a745e51..4d2c8c5 100644 --- a/cloud/aws/rds/outputs.tf +++ b/cloud/aws/rds/outputs.tf @@ -1,9 +1,9 @@ output "rds_cpu_90_15min_id" { description = "id for monitor rds_cpu_90_15min" - value = "${datadog_monitor.rds_cpu_90_15min.id}" + value = "${datadog_monitor.rds_cpu_90_15min.*.id}" } output "rds_free_space_low_id" { description = "id for monitor rds_free_space_low" - value = "${datadog_monitor.rds_free_space_low.id}" + value = "${datadog_monitor.rds_free_space_low.*.id}" } diff --git a/cloud/aws/vpn/README.md b/cloud/aws/vpn/README.md index c1c8aeb..c2f1ee8 100644 --- a/cloud/aws/vpn/README.md +++ b/cloud/aws/vpn/README.md @@ -27,6 +27,7 @@ Creates DataDog monitors with the following checks: | filter_tags | Tags used for metrics filtering | string | `*` | no | | message | Message sent when an alert is triggered | string | - | yes | | new_host_delay | Delay in seconds before monitor new resource | string | `300` | no | +| vpn_status_enabled | Flag to enable VPN status monitor | string | `true` | no | | vpn_status_extra_tags | Extra tags for VPN status monitor | list | `` | no | | vpn_status_message | Custom message for VPN status monitor | string | `` | no | | vpn_status_silenced | Groups to mute for VPN status monitor | map | `` | no | diff --git a/cloud/aws/vpn/inputs.tf b/cloud/aws/vpn/inputs.tf index 6424ca3..cfaa845 100644 --- a/cloud/aws/vpn/inputs.tf +++ b/cloud/aws/vpn/inputs.tf @@ -30,6 +30,12 @@ variable "vpn_status_silenced" { default = {} } +variable "vpn_status_enabled" { + description = "Flag to enable VPN status monitor" + type = "string" + default = "true" +} + variable "vpn_status_extra_tags" { description = "Extra tags for VPN status monitor" type = "list" diff --git a/cloud/aws/vpn/monitors-vpn.tf b/cloud/aws/vpn/monitors-vpn.tf index 4117502..2ceade7 100644 --- a/cloud/aws/vpn/monitors-vpn.tf +++ b/cloud/aws/vpn/monitors-vpn.tf @@ -1,4 +1,5 @@ resource "datadog_monitor" "VPN_status" { + count = "${var.vpn_status_enabled ? 1 : 0}" name = "[${var.environment}] VPN tunnel down" message = "${coalesce(var.vpn_status_message, var.message)}" diff --git a/cloud/aws/vpn/outputs.tf b/cloud/aws/vpn/outputs.tf index 0f79df2..7e1e077 100644 --- a/cloud/aws/vpn/outputs.tf +++ b/cloud/aws/vpn/outputs.tf @@ -1,4 +1,4 @@ output "VPN_status_id" { description = "id for monitor VPN_status" - value = "${datadog_monitor.VPN_status.id}" + value = "${datadog_monitor.VPN_status.*.id}" } diff --git a/cloud/azure/apimanagement/README.md b/cloud/azure/apimanagement/README.md index 02a24d1..3128b9e 100644 --- a/cloud/azure/apimanagement/README.md +++ b/cloud/azure/apimanagement/README.md @@ -28,6 +28,7 @@ Creates DataDog monitors with the following checks: |------|-------------|:----:|:-----:|:-----:| | environment | Architecture environment | string | - | yes | | evaluation_delay | Delay in seconds for the metric evaluation | string | `900` | no | +| failed_requests_enabled | Flag to enable API Management failed requests monitor | string | `true` | no | | failed_requests_extra_tags | Extra tags for API Management failed requests monitor | list | `` | no | | failed_requests_message | Custom message for API Management failed requests monitor | string | `` | no | | failed_requests_silenced | Groups to mute for API Management failed requests monitor | map | `` | no | @@ -38,23 +39,27 @@ Creates DataDog monitors with the following checks: | filter_tags_use_defaults | Use default filter tags convention | string | `true` | no | | message | Message sent when a Redis monitor is triggered | string | - | yes | | new_host_delay | Delay in seconds before monitor new resource | string | `300` | no | +| other_requests_enabled | Flag to enable API Management other requests monitor | string | `true` | no | | other_requests_extra_tags | Extra tags for API Management other requests monitor | list | `` | no | | other_requests_message | Custom message for API Management other requests monitor | string | `` | no | | other_requests_silenced | Groups to mute for API Management other requests monitor | map | `` | no | | other_requests_threshold_critical | Maximum acceptable percent of other requests | string | `90` | no | | other_requests_threshold_warning | Warning regarding acceptable percent of other requests | string | `50` | no | | other_requests_timeframe | Monitor timeframe for API Management other requests [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | +| status_enabled | Flag to enable API Management status monitor | string | `true` | no | | status_extra_tags | Extra tags for API Management status monitor | list | `` | no | | status_message | Custom message for API Management status monitor | string | `` | no | | status_silenced | Groups to mute for API Management status monitor | map | `` | no | | status_time_aggregator | Monitor aggregator for API Management status [available values: min, max or avg] | string | `max` | no | | status_timeframe | Monitor timeframe for API Management status [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | +| successful_requests_enabled | Flag to enable API Management successful requests monitor | string | `true` | no | | successful_requests_extra_tags | Extra tags for API Management successful requests monitor | list | `` | no | | successful_requests_message | Custom message for API Management successful requests monitor | string | `` | no | | successful_requests_silenced | Groups to mute for API Management successful requests monitor | map | `` | no | | successful_requests_threshold_critical | Minimum acceptable percent of successful requests | string | `10` | no | | successful_requests_threshold_warning | Warning regarding acceptable percent of successful requests | string | `30` | no | | successful_requests_timeframe | Monitor timeframe for API Management successful requests [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | +| unauthorized_requests_enabled | Flag to enable API Management unauthorized requests monitor | string | `true` | no | | unauthorized_requests_extra_tags | Extra tags for API Management unauthorized requests monitor | list | `` | no | | unauthorized_requests_message | Custom message for API Management unauthorized requests monitor | string | `` | no | | unauthorized_requests_silenced | Groups to mute for API Management unauthorized requests monitor | map | `` | no | diff --git a/cloud/azure/apimanagement/inputs.tf b/cloud/azure/apimanagement/inputs.tf index 4a012fa..7651f80 100644 --- a/cloud/azure/apimanagement/inputs.tf +++ b/cloud/azure/apimanagement/inputs.tf @@ -36,6 +36,12 @@ variable "status_silenced" { default = {} } +variable "status_enabled" { + description = "Flag to enable API Management status monitor" + type = "string" + default = "true" +} + variable "status_extra_tags" { description = "Extra tags for API Management status monitor" type = "list" @@ -66,6 +72,12 @@ variable "failed_requests_silenced" { default = {} } +variable "failed_requests_enabled" { + description = "Flag to enable API Management failed requests monitor" + type = "string" + default = "true" +} + variable "failed_requests_extra_tags" { description = "Extra tags for API Management failed requests monitor" type = "list" @@ -100,6 +112,12 @@ variable "other_requests_silenced" { default = {} } +variable "other_requests_enabled" { + description = "Flag to enable API Management other requests monitor" + type = "string" + default = "true" +} + variable "other_requests_extra_tags" { description = "Extra tags for API Management other requests monitor" type = "list" @@ -134,6 +152,12 @@ variable "unauthorized_requests_silenced" { default = {} } +variable "unauthorized_requests_enabled" { + description = "Flag to enable API Management unauthorized requests monitor" + type = "string" + default = "true" +} + variable "unauthorized_requests_extra_tags" { description = "Extra tags for API Management unauthorized requests monitor" type = "list" @@ -168,6 +192,12 @@ variable "successful_requests_silenced" { default = {} } +variable "successful_requests_enabled" { + description = "Flag to enable API Management successful requests monitor" + type = "string" + default = "true" +} + variable "successful_requests_extra_tags" { description = "Extra tags for API Management successful requests monitor" type = "list" diff --git a/cloud/azure/apimanagement/monitors-azure-apimanagement.tf b/cloud/azure/apimanagement/monitors-azure-apimanagement.tf index 6c91665..e58fff0 100644 --- a/cloud/azure/apimanagement/monitors-azure-apimanagement.tf +++ b/cloud/azure/apimanagement/monitors-azure-apimanagement.tf @@ -1,4 +1,5 @@ resource "datadog_monitor" "apimgt_status" { + count = "${var.status_enabled ? 1 : 0}" name = "[${var.environment}] API Management is down" message = "${coalesce(var.status_message, var.message)}" @@ -28,6 +29,7 @@ resource "datadog_monitor" "apimgt_status" { } resource "datadog_monitor" "apimgt_failed_requests" { + count = "${var.failed_requests_enabled ? 1 : 0}" name = "[${var.environment}] API Management too many failed requests {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.failed_requests_message, var.message)}" @@ -60,6 +62,7 @@ resource "datadog_monitor" "apimgt_failed_requests" { } resource "datadog_monitor" "apimgt_other_requests" { + count = "${var.other_requests_enabled ? 1 : 0}" name = "[${var.environment}] API Management too many other requests {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.other_requests_message, var.message)}" @@ -92,6 +95,7 @@ resource "datadog_monitor" "apimgt_other_requests" { } resource "datadog_monitor" "apimgt_unauthorized_requests" { + count = "${var.unauthorized_requests_enabled ? 1 : 0}" name = "[${var.environment}] API Management too many unauthorized requests {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.unauthorized_requests_message, var.message)}" @@ -124,6 +128,7 @@ resource "datadog_monitor" "apimgt_unauthorized_requests" { } resource "datadog_monitor" "apimgt_successful_requests" { + count = "${var.successful_requests_enabled ? 1 : 0}" name = "[${var.environment}] API Management successful requests rate too low {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.successful_requests_message, var.message)}" diff --git a/cloud/azure/apimanagement/outputs.tf b/cloud/azure/apimanagement/outputs.tf index f75e638..56214a5 100644 --- a/cloud/azure/apimanagement/outputs.tf +++ b/cloud/azure/apimanagement/outputs.tf @@ -1,24 +1,24 @@ output "apimgt_status_id" { description = "id for monitor apimgt_status" - value = "${datadog_monitor.apimgt_status.id}" + value = "${datadog_monitor.apimgt_status.*.id}" } output "apimgt_failed_requests_id" { description = "id for monitor apimgt_failed_requests" - value = "${datadog_monitor.apimgt_failed_requests.id}" + value = "${datadog_monitor.apimgt_failed_requests.*.id}" } output "apimgt_other_requests_id" { description = "id for monitor apimgt_other_requests" - value = "${datadog_monitor.apimgt_other_requests.id}" + value = "${datadog_monitor.apimgt_other_requests.*.id}" } output "apimgt_unauthorized_requests_id" { description = "id for monitor apimgt_unauthorized_requests" - value = "${datadog_monitor.apimgt_unauthorized_requests.id}" + value = "${datadog_monitor.apimgt_unauthorized_requests.*.id}" } output "apimgt_successful_requests_id" { description = "id for monitor apimgt_successful_requests" - value = "${datadog_monitor.apimgt_successful_requests.id}" + value = "${datadog_monitor.apimgt_successful_requests.*.id}" } diff --git a/cloud/azure/app-services/README.md b/cloud/azure/app-services/README.md index 192bb4e..b99feb1 100644 --- a/cloud/azure/app-services/README.md +++ b/cloud/azure/app-services/README.md @@ -30,24 +30,28 @@ Creates DataDog monitors with the following checks: | evaluation_delay | Delay in seconds for the metric evaluation | string | `900` | no | | filter_tags_custom | Tags used for custom filtering when filter_tags_use_defaults is false | string | `*` | no | | filter_tags_use_defaults | Use default filter tags convention | string | `true` | no | +| http_4xx_requests_enabled | Flag to enable App Services 4xx requests monitor | string | `true` | no | | http_4xx_requests_extra_tags | Extra tags for App Services 4xx requests monitor | list | `` | no | | http_4xx_requests_message | Custom message for App Services 4xx requests monitor | string | `` | no | | http_4xx_requests_silenced | Groups to mute for App Services 4xx requests monitor | map | `` | no | | http_4xx_requests_threshold_critical | Maximum critical acceptable percent of 4xx errors | string | `90` | no | | http_4xx_requests_threshold_warning | Warning regarding acceptable percent of 4xx errors | string | `50` | no | | http_4xx_requests_timeframe | Monitor timeframe for App Services 4xx requests [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | +| http_5xx_requests_enabled | Flag to enable App Services 5xx requests monitor | string | `true` | no | | http_5xx_requests_extra_tags | Extra tags for App Services 5xx requests monitor | list | `` | no | | http_5xx_requests_message | Custom message for App Services 5xx requests monitor | string | `` | no | | http_5xx_requests_silenced | Groups to mute for App Services 5xx requests monitor | map | `` | no | | http_5xx_requests_threshold_critical | Maximum critical acceptable percent of 5xx errors | string | `90` | no | | http_5xx_requests_threshold_warning | Warning regarding acceptable percent of 5xx errors | string | `50` | no | | http_5xx_requests_timeframe | Monitor timeframe for App Services 5xx requests [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | +| http_successful_requests_enabled | Flag to enable App Services successful requests monitor | string | `true` | no | | http_successful_requests_extra_tags | Extra tags for App Services successful requests monitor | list | `` | no | | http_successful_requests_message | Custom message for App Services successful requests monitor | string | `` | no | | http_successful_requests_silenced | Groups to mute for App Services successful requests monitor | map | `` | no | | http_successful_requests_threshold_critical | Minimum critical acceptable percent of 2xx & 3xx requests | string | `10` | no | | http_successful_requests_threshold_warning | Warning regarding acceptable percent of 2xx & 3xx requests | string | `30` | no | | http_successful_requests_timeframe | Monitor timeframe for App Services successful requests [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | +| memory_usage_enabled | Flag to enable App Services memory usage monitor | string | `true` | no | | memory_usage_extra_tags | Extra tags for App Services memory usage monitor | list | `` | no | | memory_usage_message | Custom message for App Services memory usage monitor | string | `` | no | | memory_usage_silenced | Groups to mute for App Services memory usage monitor | map | `` | no | @@ -57,6 +61,7 @@ Creates DataDog monitors with the following checks: | memory_usage_timeframe | Monitor timeframe for App Services memory usage [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | | message | Message sent when a monitor is triggered | string | - | yes | | new_host_delay | Delay in seconds before monitor new resource | string | `300` | no | +| response_time_enabled | Flag to enable App Services response time monitor | string | `true` | no | | response_time_extra_tags | Extra tags for App Services response time monitor | list | `` | no | | response_time_message | Custom message for App Services response time monitor | string | `` | no | | response_time_silenced | Groups to mute for App Services response time monitor | map | `` | no | diff --git a/cloud/azure/app-services/inputs.tf b/cloud/azure/app-services/inputs.tf index 04df4e3..30ff56a 100644 --- a/cloud/azure/app-services/inputs.tf +++ b/cloud/azure/app-services/inputs.tf @@ -34,6 +34,12 @@ variable "response_time_silenced" { default = {} } +variable "response_time_enabled" { + description = "Flag to enable App Services response time monitor" + type = "string" + default = "true" +} + variable "response_time_extra_tags" { description = "Extra tags for App Services response time monitor" type = "list" @@ -74,6 +80,12 @@ variable "memory_usage_silenced" { default = {} } +variable "memory_usage_enabled" { + description = "Flag to enable App Services memory usage monitor" + type = "string" + default = "true" +} + variable "memory_usage_extra_tags" { description = "Extra tags for App Services memory usage monitor" type = "list" @@ -114,6 +126,12 @@ variable "http_4xx_requests_silenced" { default = {} } +variable "http_4xx_requests_enabled" { + description = "Flag to enable App Services 4xx requests monitor" + type = "string" + default = "true" +} + variable "http_4xx_requests_extra_tags" { description = "Extra tags for App Services 4xx requests monitor" type = "list" @@ -148,6 +166,12 @@ variable "http_5xx_requests_silenced" { default = {} } +variable "http_5xx_requests_enabled" { + description = "Flag to enable App Services 5xx requests monitor" + type = "string" + default = "true" +} + variable "http_5xx_requests_extra_tags" { description = "Extra tags for App Services 5xx requests monitor" type = "list" @@ -182,6 +206,12 @@ variable "http_successful_requests_silenced" { default = {} } +variable "http_successful_requests_enabled" { + description = "Flag to enable App Services successful requests monitor" + type = "string" + default = "true" +} + variable "http_successful_requests_extra_tags" { description = "Extra tags for App Services successful requests monitor" type = "list" diff --git a/cloud/azure/app-services/monitors-app_services.tf b/cloud/azure/app-services/monitors-app_services.tf index 346ba22..f20fea6 100644 --- a/cloud/azure/app-services/monitors-app_services.tf +++ b/cloud/azure/app-services/monitors-app_services.tf @@ -1,5 +1,6 @@ # Monitoring App Services response time resource "datadog_monitor" "appservices_response_time" { + count = "${var.response_time_enabled ? 1 : 0}" name = "[${var.environment}] App Services response time too high {{#is_alert}}{{{comparator}}} {{threshold}}s ({{value}}s){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}s ({{value}}s){{/is_warning}}" type = "metric alert" message = "${coalesce(var.response_time_message, var.message)}" @@ -31,6 +32,7 @@ resource "datadog_monitor" "appservices_response_time" { # Monitoring App Services memory usage resource "datadog_monitor" "appservices_memory_usage_count" { + count = "${var.memory_usage_enabled ? 1 : 0}" name = "[${var.environment}] App Services memory usage {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" type = "metric alert" message = "${coalesce(var.memory_usage_message, var.message)}" @@ -62,6 +64,7 @@ resource "datadog_monitor" "appservices_memory_usage_count" { # Monitoring App Services 5xx errors percent resource "datadog_monitor" "appservices_http_5xx_errors_count" { + count = "${var.http_5xx_requests_enabled ? 1 : 0}" name = "[${var.environment}] App Services HTTP 5xx errors too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" type = "metric alert" message = "${coalesce(var.http_5xx_requests_message, var.message)}" @@ -94,6 +97,7 @@ resource "datadog_monitor" "appservices_http_5xx_errors_count" { # Monitoring App Services 4xx errors percent resource "datadog_monitor" "appservices_http_4xx_errors_count" { + count = "${var.http_4xx_requests_enabled ? 1 : 0}" name = "[${var.environment}] App Services HTTP 4xx errors too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" type = "metric alert" message = "${coalesce(var.http_4xx_requests_message, var.message)}" @@ -126,6 +130,7 @@ resource "datadog_monitor" "appservices_http_4xx_errors_count" { # Monitoring App Services HTTP 2xx & 3xx status pages percent resource "datadog_monitor" "appservices_http_success_status_rate" { + count = "${var.http_successful_requests_enabled ? 1 : 0}" name = "[${var.environment}] App Services HTTP successful responses too low {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" type = "metric alert" message = "${coalesce(var.http_successful_requests_message, var.message)}" diff --git a/cloud/azure/app-services/outputs.tf b/cloud/azure/app-services/outputs.tf index c1a3689..509444d 100644 --- a/cloud/azure/app-services/outputs.tf +++ b/cloud/azure/app-services/outputs.tf @@ -1,24 +1,24 @@ output "appservices_response_time_id" { description = "id for monitor appservices_response_time" - value = "${datadog_monitor.appservices_response_time.id}" + value = "${datadog_monitor.appservices_response_time.*.id}" } output "appservices_memory_usage_count_id" { description = "id for monitor appservices_memory_usage_count" - value = "${datadog_monitor.appservices_memory_usage_count.id}" + value = "${datadog_monitor.appservices_memory_usage_count.*.id}" } output "appservices_http_5xx_errors_count_id" { description = "id for monitor appservices_http_5xx_errors_count" - value = "${datadog_monitor.appservices_http_5xx_errors_count.id}" + value = "${datadog_monitor.appservices_http_5xx_errors_count.*.id}" } output "appservices_http_4xx_errors_count_id" { description = "id for monitor appservices_http_4xx_errors_count" - value = "${datadog_monitor.appservices_http_4xx_errors_count.id}" + value = "${datadog_monitor.appservices_http_4xx_errors_count.*.id}" } output "appservices_http_success_status_rate_id" { description = "id for monitor appservices_http_success_status_rate" - value = "${datadog_monitor.appservices_http_success_status_rate.id}" + value = "${datadog_monitor.appservices_http_success_status_rate.*.id}" } diff --git a/cloud/azure/eventhub/README.md b/cloud/azure/eventhub/README.md index 24e3732..92656a1 100644 --- a/cloud/azure/eventhub/README.md +++ b/cloud/azure/eventhub/README.md @@ -25,6 +25,7 @@ Creates DataDog monitors with the following checks: | Name | Description | Type | Default | Required | |------|-------------|:----:|:-----:|:-----:| | environment | Architecture environment | string | - | yes | +| errors_rate_enabled | Flag to enable Event Hub errors monitor | string | `true` | no | | errors_rate_extra_tags | Extra tags for Event Hub errors monitor | list | `` | no | | errors_rate_message | Custom message for Event Hub errors monitor | string | `` | no | | errors_rate_silenced | Groups to mute for Event Hub errors monitor | map | `` | no | @@ -32,6 +33,7 @@ Creates DataDog monitors with the following checks: | errors_rate_thresold_warning | Errors ratio (percentage) to trigger a warning alert | string | `50` | no | | errors_rate_timeframe | Monitor timeframe for Event Hub errors [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | | evaluation_delay | Delay in seconds for the metric evaluation | string | `900` | no | +| failed_requests_rate_enabled | Flag to enable Event Hub failed requests monitor | string | `true` | no | | failed_requests_rate_extra_tags | Extra tags for Event Hub failed requests monitor | list | `` | no | | failed_requests_rate_message | Custom message for Event Hub failed requests monitor | string | `` | no | | failed_requests_rate_silenced | Groups to mute for Event Hub failed requests monitor | map | `` | no | @@ -42,6 +44,7 @@ Creates DataDog monitors with the following checks: | filter_tags_use_defaults | Use default filter tags convention | string | `true` | no | | message | Message sent when an alert is triggered | string | - | yes | | new_host_delay | Delay in seconds before monitor new resource | string | `300` | no | +| status_enabled | Flag to enable Event Hub status monitor | string | `true` | no | | status_extra_tags | Extra tags for Event Hub status monitor | list | `` | no | | status_message | Custom message for Event Hub status monitor | string | `` | no | | status_silenced | Groups to mute for Event Hub status monitor | map | `` | no | diff --git a/cloud/azure/eventhub/inputs.tf b/cloud/azure/eventhub/inputs.tf index 95757ae..83608d5 100644 --- a/cloud/azure/eventhub/inputs.tf +++ b/cloud/azure/eventhub/inputs.tf @@ -36,6 +36,12 @@ variable "status_silenced" { default = {} } +variable "status_enabled" { + description = "Flag to enable Event Hub status monitor" + type = "string" + default = "true" +} + variable "status_extra_tags" { description = "Extra tags for Event Hub status monitor" type = "list" @@ -66,6 +72,12 @@ variable "failed_requests_rate_silenced" { default = {} } +variable "failed_requests_rate_enabled" { + description = "Flag to enable Event Hub failed requests monitor" + type = "string" + default = "true" +} + variable "failed_requests_rate_extra_tags" { description = "Extra tags for Event Hub failed requests monitor" type = "list" @@ -100,6 +112,12 @@ variable "errors_rate_silenced" { default = {} } +variable "errors_rate_enabled" { + description = "Flag to enable Event Hub errors monitor" + type = "string" + default = "true" +} + variable "errors_rate_extra_tags" { description = "Extra tags for Event Hub errors monitor" type = "list" diff --git a/cloud/azure/eventhub/monitors-eventhub.tf b/cloud/azure/eventhub/monitors-eventhub.tf index e7520a1..d2118fe 100644 --- a/cloud/azure/eventhub/monitors-eventhub.tf +++ b/cloud/azure/eventhub/monitors-eventhub.tf @@ -1,4 +1,5 @@ resource "datadog_monitor" "eventhub_status" { + count = "${var.status_enabled ? 1 : 0}" name = "[${var.environment}] Event Hub is down" message = "${coalesce(var.status_message, var.message)}" @@ -26,6 +27,7 @@ resource "datadog_monitor" "eventhub_status" { } resource "datadog_monitor" "eventhub_failed_requests" { + count = "${var.failed_requests_rate_enabled ? 1 : 0}" name = "[${var.environment}] Event Hub too many failed requests {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.failed_requests_rate_message, var.message)}" @@ -61,6 +63,7 @@ resource "datadog_monitor" "eventhub_failed_requests" { } resource "datadog_monitor" "eventhub_errors" { + count = "${var.errors_rate_enabled ? 1 : 0}" name = "[${var.environment}] Event Hub too many errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.errors_rate_message, var.message)}" diff --git a/cloud/azure/eventhub/outputs.tf b/cloud/azure/eventhub/outputs.tf index 0d01e65..33f384a 100644 --- a/cloud/azure/eventhub/outputs.tf +++ b/cloud/azure/eventhub/outputs.tf @@ -1,14 +1,14 @@ output "eventhub_status_id" { description = "id for monitor eventhub_status" - value = "${datadog_monitor.eventhub_status.id}" + value = "${datadog_monitor.eventhub_status.*.id}" } output "eventhub_failed_requests_id" { description = "id for monitor eventhub_failed_requests" - value = "${datadog_monitor.eventhub_failed_requests.id}" + value = "${datadog_monitor.eventhub_failed_requests.*.id}" } output "eventhub_errors_id" { description = "id for monitor eventhub_errors" - value = "${datadog_monitor.eventhub_errors.id}" + value = "${datadog_monitor.eventhub_errors.*.id}" } diff --git a/cloud/azure/iothubs/README.md b/cloud/azure/iothubs/README.md index 1dcfa13..34312c1 100644 --- a/cloud/azure/iothubs/README.md +++ b/cloud/azure/iothubs/README.md @@ -35,6 +35,7 @@ Creates DataDog monitors with the following checks: | Name | Description | Type | Default | Required | |------|-------------|:----:|:-----:|:-----:| +| dropped_d2c_telemetry_egress_enabled | Flag to enable IoT Hub dropped d2c telemetry monitor | string | `true` | no | | dropped_d2c_telemetry_egress_extra_tags | Extra tags for IoT Hub dropped d2c telemetry monitor | list | `` | no | | dropped_d2c_telemetry_egress_message | Custom message for IoT Hub dropped d2c telemetry monitor | string | `` | no | | dropped_d2c_telemetry_egress_rate_threshold_critical | D2C Telemetry Dropped limit (critical threshold) | string | `90` | no | @@ -43,48 +44,56 @@ Creates DataDog monitors with the following checks: | dropped_d2c_telemetry_egress_timeframe | Monitor timeframe for IoT Hub dropped d2c telemetry [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 | - | yes | | evaluation_delay | Delay in seconds for the metric evaluation | string | `900` | no | +| failed_c2d_methods_rate_enabled | Flag to enable IoT Hub failed c2d methods monitor | string | `true` | no | | failed_c2d_methods_rate_extra_tags | Extra tags for IoT Hub failed c2d methods monitor | list | `` | no | | failed_c2d_methods_rate_message | Custom message for IoT Hub failed c2d method monitor | string | `` | no | | failed_c2d_methods_rate_silenced | Groups to mute for IoT Hub failed c2d methods monitor | map | `` | no | | failed_c2d_methods_rate_threshold_critical | C2D Methods Failed rate limit (critical threshold) | string | `90` | no | | failed_c2d_methods_rate_threshold_warning | C2D Methods Failed rate limit (warning threshold) | string | `50` | no | | failed_c2d_methods_rate_timeframe | Monitor timeframe for IoT Hub failed c2d method [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | +| failed_c2d_twin_read_rate_enabled | Flag to enable IoT Hub failed c2d twin read monitor | string | `true` | no | | failed_c2d_twin_read_rate_extra_tags | Extra tags for IoT Hub failed c2d twin read monitor | list | `` | no | | failed_c2d_twin_read_rate_message | Custom message for IoT Hub failed c2d twin read monitor | string | `` | no | | failed_c2d_twin_read_rate_silenced | Groups to mute for IoT Hub failed c2d twin read monitor | map | `` | no | | failed_c2d_twin_read_rate_threshold_critical | C2D Twin Read Failed rate limit (critical threshold) | string | `90` | no | | failed_c2d_twin_read_rate_threshold_warning | C2D Twin Read Failed rate limit (warning threshold) | string | `50` | no | | failed_c2d_twin_read_rate_timeframe | Monitor timeframe for IoT Hub failed c2d twin read [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | +| failed_c2d_twin_update_rate_enabled | Flag to enable IoT Hub failed c2d twin update monitor | string | `true` | no | | failed_c2d_twin_update_rate_extra_tags | Extra tags for IoT Hub failed c2d twin update monitor | list | `` | no | | failed_c2d_twin_update_rate_message | Custom message for IoT Hub failed c2d twin update monitor | string | `` | no | | failed_c2d_twin_update_rate_silenced | Groups to mute for IoT Hub failed c2d twin update monitor | map | `` | no | | failed_c2d_twin_update_rate_threshold_critical | C2D Twin Update Failed rate limit (critical threshold) | string | `90` | no | | failed_c2d_twin_update_rate_threshold_warning | C2D Twin Update Failed rate limit (warning threshold) | string | `50` | no | | failed_c2d_twin_update_rate_timeframe | Monitor timeframe for IoT Hub failed c2d twin update [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | +| failed_d2c_twin_read_rate_enabled | Flag to enable IoT Hub failed d2c twin read monitor | string | `true` | no | | failed_d2c_twin_read_rate_extra_tags | Extra tags for IoT Hub failed d2c twin read monitor | list | `` | no | | failed_d2c_twin_read_rate_message | Custom message for IoT Hub failed d2c twin read monitor | string | `` | no | | failed_d2c_twin_read_rate_silenced | Groups to mute for IoT Hub failed d2c twin read monitor | map | `` | no | | failed_d2c_twin_read_rate_threshold_critical | D2C Twin Read Failed rate limit (critical threshold) | string | `90` | no | | failed_d2c_twin_read_rate_threshold_warning | D2C Twin Read Failed rate limit (warning threshold) | string | `50` | no | | failed_d2c_twin_read_rate_timeframe | Monitor timeframe for IoT Hub failed d2c twin read [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | +| failed_d2c_twin_update_rate_enabled | Flag to enable IoT Hub failed d2c twin update monitor | string | `true` | no | | failed_d2c_twin_update_rate_extra_tags | Extra tags for IoT Hub failed d2c twin update monitor | list | `` | no | | failed_d2c_twin_update_rate_message | Custom message for IoT Hub failed d2c twin update monitor | string | `` | no | | failed_d2c_twin_update_rate_silenced | Groups to mute for IoT Hub failed d2c twin update monitor | map | `` | no | | failed_d2c_twin_update_rate_threshold_critical | D2C Twin Update Failed rate limit (critical threshold) | string | `90` | no | | failed_d2c_twin_update_rate_threshold_warning | D2C Twin Update Failed rate limit (warning threshold) | string | `50` | no | | failed_d2c_twin_update_rate_timeframe | Monitor timeframe for IoT Hub failed d2c twin update [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | +| failed_jobs_rate_enabled | Flag to enable IoT Hub failed jobs monitor | string | `true` | no | | failed_jobs_rate_extra_tags | Extra tags for IoT Hub failed jobs monitor | list | `` | no | | failed_jobs_rate_message | Custom message for IoT Hub failed jobs monitor | string | `` | no | | failed_jobs_rate_silenced | Groups to mute for IoT Hub failed jobs monitor | map | `` | no | | failed_jobs_rate_threshold_critical | Jobs Failed rate limit (critical threshold) | string | `90` | no | | failed_jobs_rate_threshold_warning | Jobs Failed rate limit (warning threshold) | string | `50` | no | | failed_jobs_rate_timeframe | Monitor timeframe for IoT Hub failed jobs [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | +| failed_listjobs_rate_enabled | Flag to enable IoT Hub failed list jobs monitor | string | `true` | no | | failed_listjobs_rate_extra_tags | Extra tags for IoT Hub failed list jobs monitor | list | `` | no | | failed_listjobs_rate_message | Custom message for IoT Hub failed list jobs monitor | string | `` | no | | failed_listjobs_rate_silenced | Groups to mute for IoT Hub failed list jobs monitor | map | `` | no | | failed_listjobs_rate_threshold_critical | ListJobs Failed rate limit (critical threshold) | string | `90` | no | | failed_listjobs_rate_threshold_warning | ListJobs Failed rate limit (warning threshold) | string | `50` | no | | failed_listjobs_rate_timeframe | Monitor timeframe for IoT Hub failed list jobs [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | +| failed_queryjobs_rate_enabled | Flag to enable IoT Hub failed query jobs monitor | string | `true` | no | | failed_queryjobs_rate_extra_tags | Extra tags for IoT Hub failed query jobs monitor | list | `` | no | | failed_queryjobs_rate_message | Custom message for IoT Hub failed query jobs monitor | string | `` | no | | failed_queryjobs_rate_silenced | Groups to mute for IoT Hub failed query jobs monitor | map | `` | no | @@ -92,6 +101,7 @@ Creates DataDog monitors with the following checks: | failed_queryjobs_rate_threshold_warning | QueryJobs Failed rate limit (warning threshold) | string | `50` | no | | failed_queryjobs_rate_timeframe | Monitor timeframe for IoT Hub failed query jobs [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | | filter_tags | Tags used for filtering | string | `*` | no | +| invalid_d2c_telemetry_egress_enabled | Flag to enable IoT Hub invalid d2c telemetry monitor | string | `true` | no | | invalid_d2c_telemetry_egress_extra_tags | Extra tags for IoT Hub invalid d2c telemetry monitor | list | `` | no | | invalid_d2c_telemetry_egress_message | Custom message for IoT Hub invalid d2c telemetry monitor | string | `` | no | | invalid_d2c_telemetry_egress_rate_threshold_critical | D2C Telemetry Invalid limit (critical threshold) | string | `90` | no | @@ -100,21 +110,25 @@ Creates DataDog monitors with the following checks: | invalid_d2c_telemetry_egress_timeframe | Monitor timeframe for IoT Hub invalid d2c telemetry [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | | message | Message sent when an alert is triggered | string | - | yes | | new_host_delay | Delay in seconds before monitor new resource | string | `300` | no | +| orphaned_d2c_telemetry_egress_enabled | Flag to enable IoT Hub orphaned d2c telemetry monitor | string | `true` | no | | orphaned_d2c_telemetry_egress_extra_tags | Extra tags for IoT Hub orphaned d2c telemetry monitor | list | `` | no | | orphaned_d2c_telemetry_egress_message | Custom message for IoT Hub orphaned d2c telemetry monitor | string | `` | no | | orphaned_d2c_telemetry_egress_rate_threshold_critical | D2C Telemetry Orphaned limit (critical threshold) | string | `90` | no | | orphaned_d2c_telemetry_egress_rate_threshold_warning | D2C Telemetry Orphaned limit (warning threshold) | string | `50` | no | | orphaned_d2c_telemetry_egress_silenced | Groups to mute for IoT Hub orphaned d2c telemetry monitor | map | `` | no | | orphaned_d2c_telemetry_egress_timeframe | Monitor timeframe for IoT Hub orphaned d2c telemetry [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | +| status_enabled | Flag to enable IoT Hub status monitor | string | `true` | no | | status_extra_tags | Extra tags for IoT Hub status monitor | list | `` | no | | status_message | Custom message for IoT Hub status monitor | string | `` | no | | status_silenced | Groups to mute for IoT Hub status monitor | map | `` | no | | status_time_aggregator | Monitor aggregator for IoT Hub status [available values: min, max, sum or avg] | string | `max` | no | | status_timeframe | Monitor timeframe for IoT Hub status [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | +| too_many_d2c_telemetry_ingress_nosent_enabled | Flag to enable IoT Hub unsent d2c telemetry monitor | string | `true` | no | | too_many_d2c_telemetry_ingress_nosent_extra_tags | Extra tags for IoT Hub unsent d2c telemetry monitor | list | `` | no | | too_many_d2c_telemetry_ingress_nosent_message | Custom message for IoT Hub unsent d2c telemetry monitor | string | `` | no | | too_many_d2c_telemetry_ingress_nosent_silenced | Groups to mute for IoT Hub unsent d2c telemetry monitor | map | `` | no | | too_many_d2c_telemetry_ingress_nosent_timeframe | Monitor timeframe for IoT Hub unsent d2c telemetry [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | +| total_devices_enabled | Flag to enable IoT Hub total devices monitor | string | `true` | no | | total_devices_extra_tags | Extra tags for IoT Hub total devices monitor | list | `` | no | | total_devices_message | Custom message for IoT Hub total devices monitor | string | `` | no | | total_devices_silenced | Groups to mute for IoT Hub total devices monitor | map | `` | no | diff --git a/cloud/azure/iothubs/inputs.tf b/cloud/azure/iothubs/inputs.tf index 54196a1..3dc9e4b 100644 --- a/cloud/azure/iothubs/inputs.tf +++ b/cloud/azure/iothubs/inputs.tf @@ -31,6 +31,12 @@ variable "status_silenced" { default = {} } +variable "status_enabled" { + description = "Flag to enable IoT Hub status monitor" + type = "string" + default = "true" +} + variable "status_extra_tags" { description = "Extra tags for IoT Hub status monitor" type = "list" @@ -61,6 +67,12 @@ variable "total_devices_silenced" { default = {} } +variable "total_devices_enabled" { + description = "Flag to enable IoT Hub total devices monitor" + type = "string" + default = "true" +} + variable "total_devices_extra_tags" { description = "Extra tags for IoT Hub total devices monitor" type = "list" @@ -91,6 +103,12 @@ variable "too_many_d2c_telemetry_ingress_nosent_silenced" { default = {} } +variable "too_many_d2c_telemetry_ingress_nosent_enabled" { + description = "Flag to enable IoT Hub unsent d2c telemetry monitor" + type = "string" + default = "true" +} + variable "too_many_d2c_telemetry_ingress_nosent_extra_tags" { description = "Extra tags for IoT Hub unsent d2c telemetry monitor" type = "list" @@ -115,6 +133,12 @@ variable "failed_jobs_rate_silenced" { default = {} } +variable "failed_jobs_rate_enabled" { + description = "Flag to enable IoT Hub failed jobs monitor" + type = "string" + default = "true" +} + variable "failed_jobs_rate_extra_tags" { description = "Extra tags for IoT Hub failed jobs monitor" type = "list" @@ -149,6 +173,12 @@ variable "failed_listjobs_rate_silenced" { default = {} } +variable "failed_listjobs_rate_enabled" { + description = "Flag to enable IoT Hub failed list jobs monitor" + type = "string" + default = "true" +} + variable "failed_listjobs_rate_extra_tags" { description = "Extra tags for IoT Hub failed list jobs monitor" type = "list" @@ -183,6 +213,12 @@ variable "failed_queryjobs_rate_silenced" { default = {} } +variable "failed_queryjobs_rate_enabled" { + description = "Flag to enable IoT Hub failed query jobs monitor" + type = "string" + default = "true" +} + variable "failed_queryjobs_rate_extra_tags" { description = "Extra tags for IoT Hub failed query jobs monitor" type = "list" @@ -217,6 +253,12 @@ variable "failed_c2d_methods_rate_silenced" { default = {} } +variable "failed_c2d_methods_rate_enabled" { + description = "Flag to enable IoT Hub failed c2d methods monitor" + type = "string" + default = "true" +} + variable "failed_c2d_methods_rate_extra_tags" { description = "Extra tags for IoT Hub failed c2d methods monitor" type = "list" @@ -251,6 +293,12 @@ variable "failed_c2d_twin_read_rate_silenced" { default = {} } +variable "failed_c2d_twin_read_rate_enabled" { + description = "Flag to enable IoT Hub failed c2d twin read monitor" + type = "string" + default = "true" +} + variable "failed_c2d_twin_read_rate_extra_tags" { description = "Extra tags for IoT Hub failed c2d twin read monitor" type = "list" @@ -285,6 +333,12 @@ variable "failed_c2d_twin_update_rate_silenced" { default = {} } +variable "failed_c2d_twin_update_rate_enabled" { + description = "Flag to enable IoT Hub failed c2d twin update monitor" + type = "string" + default = "true" +} + variable "failed_c2d_twin_update_rate_extra_tags" { description = "Extra tags for IoT Hub failed c2d twin update monitor" type = "list" @@ -319,6 +373,12 @@ variable "failed_d2c_twin_read_rate_silenced" { default = {} } +variable "failed_d2c_twin_read_rate_enabled" { + description = "Flag to enable IoT Hub failed d2c twin read monitor" + type = "string" + default = "true" +} + variable "failed_d2c_twin_read_rate_extra_tags" { description = "Extra tags for IoT Hub failed d2c twin read monitor" type = "list" @@ -353,6 +413,12 @@ variable "failed_d2c_twin_update_rate_silenced" { default = {} } +variable "failed_d2c_twin_update_rate_enabled" { + description = "Flag to enable IoT Hub failed d2c twin update monitor" + type = "string" + default = "true" +} + variable "failed_d2c_twin_update_rate_extra_tags" { description = "Extra tags for IoT Hub failed d2c twin update monitor" type = "list" @@ -387,6 +453,12 @@ variable "dropped_d2c_telemetry_egress_silenced" { default = {} } +variable "dropped_d2c_telemetry_egress_enabled" { + description = "Flag to enable IoT Hub dropped d2c telemetry monitor" + type = "string" + default = "true" +} + variable "dropped_d2c_telemetry_egress_extra_tags" { description = "Extra tags for IoT Hub dropped d2c telemetry monitor" type = "list" @@ -421,6 +493,12 @@ variable "orphaned_d2c_telemetry_egress_silenced" { default = {} } +variable "orphaned_d2c_telemetry_egress_enabled" { + description = "Flag to enable IoT Hub orphaned d2c telemetry monitor" + type = "string" + default = "true" +} + variable "orphaned_d2c_telemetry_egress_extra_tags" { description = "Extra tags for IoT Hub orphaned d2c telemetry monitor" type = "list" @@ -455,6 +533,12 @@ variable "invalid_d2c_telemetry_egress_silenced" { default = {} } +variable "invalid_d2c_telemetry_egress_enabled" { + description = "Flag to enable IoT Hub invalid d2c telemetry monitor" + type = "string" + default = "true" +} + variable "invalid_d2c_telemetry_egress_extra_tags" { description = "Extra tags for IoT Hub invalid d2c telemetry monitor" type = "list" diff --git a/cloud/azure/iothubs/monitors-iothubs.tf b/cloud/azure/iothubs/monitors-iothubs.tf index d144213..27cd822 100644 --- a/cloud/azure/iothubs/monitors-iothubs.tf +++ b/cloud/azure/iothubs/monitors-iothubs.tf @@ -1,4 +1,5 @@ resource "datadog_monitor" "too_many_jobs_failed" { + count = "${var.failed_jobs_rate_enabled ? 1 : 0}" name = "[${var.environment}] IOT Hub Too many jobs failed {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.failed_jobs_rate_message, var.message)}" @@ -33,6 +34,7 @@ resource "datadog_monitor" "too_many_jobs_failed" { } resource "datadog_monitor" "too_many_list_jobs_failed" { + count = "${var.failed_listjobs_rate_enabled ? 1 : 0}" name = "[${var.environment}] IOT Hub Too many list_jobs failure {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.failed_listjobs_rate_message, var.message)}" @@ -67,6 +69,7 @@ resource "datadog_monitor" "too_many_list_jobs_failed" { } resource "datadog_monitor" "too_many_query_jobs_failed" { + count = "${var.failed_queryjobs_rate_enabled ? 1 : 0}" name = "[${var.environment}] IOT Hub Too many query_jobs failed {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.failed_queryjobs_rate_message, var.message)}" @@ -101,6 +104,7 @@ resource "datadog_monitor" "too_many_query_jobs_failed" { } resource "datadog_monitor" "status" { + count = "${var.status_enabled ? 1 : 0}" name = "[${var.environment}] IOT Hub is down" message = "${coalesce(var.status_message, var.message)}" @@ -128,6 +132,7 @@ resource "datadog_monitor" "status" { } resource "datadog_monitor" "total_devices" { + count = "${var.total_devices_enabled ? 1 : 0}" name = "[${var.environment}] IOT Hub Total devices is wrong {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" message = "${coalesce(var.total_devices_message, var.message)}" @@ -155,6 +160,7 @@ resource "datadog_monitor" "total_devices" { } resource "datadog_monitor" "too_many_c2d_methods_failed" { + count = "${var.failed_c2d_methods_rate_enabled ? 1 : 0}" name = "[${var.environment}] IOT Hub Too many c2d methods failure {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.failed_c2d_methods_rate_message, var.message)}" @@ -189,6 +195,7 @@ resource "datadog_monitor" "too_many_c2d_methods_failed" { } resource "datadog_monitor" "too_many_c2d_twin_read_failed" { + count = "${var.failed_c2d_twin_read_rate_enabled ? 1 : 0}" name = "[${var.environment}] IOT Hub Too many c2d twin read failure {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.failed_c2d_twin_read_rate_message, var.message)}" @@ -223,6 +230,7 @@ resource "datadog_monitor" "too_many_c2d_twin_read_failed" { } resource "datadog_monitor" "too_many_c2d_twin_update_failed" { + count = "${var.failed_c2d_twin_update_rate_enabled ? 1 : 0}" name = "[${var.environment}] IOT Hub Too many c2d twin update failure {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.failed_c2d_twin_update_rate_message, var.message)}" @@ -257,6 +265,7 @@ resource "datadog_monitor" "too_many_c2d_twin_update_failed" { } resource "datadog_monitor" "too_many_d2c_twin_read_failed" { + count = "${var.failed_d2c_twin_read_rate_enabled ? 1 : 0}" name = "[${var.environment}] IOT Hub Too many d2c twin read failure {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.failed_d2c_twin_read_rate_message, var.message)}" @@ -291,6 +300,7 @@ resource "datadog_monitor" "too_many_d2c_twin_read_failed" { } resource "datadog_monitor" "too_many_d2c_twin_update_failed" { + count = "${var.failed_d2c_twin_update_rate_enabled ? 1 : 0}" name = "[${var.environment}] IOT Hub Too many d2c twin update failure {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.failed_d2c_twin_update_rate_message, var.message)}" @@ -325,6 +335,7 @@ resource "datadog_monitor" "too_many_d2c_twin_update_failed" { } resource "datadog_monitor" "too_many_d2c_telemetry_egress_dropped" { + count = "${var.dropped_d2c_telemetry_egress_enabled ? 1 : 0}" name = "[${var.environment}] IOT Hub Too many d2c telemetry egress dropped {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" message = "${coalesce(var.dropped_d2c_telemetry_egress_message, var.message)}" @@ -362,6 +373,7 @@ resource "datadog_monitor" "too_many_d2c_telemetry_egress_dropped" { } resource "datadog_monitor" "too_many_d2c_telemetry_egress_orphaned" { + count = "${var.orphaned_d2c_telemetry_egress_enabled ? 1 : 0}" name = "[${var.environment}] IOT Hub Too many d2c telemetry egress orphaned {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" message = "${coalesce(var.orphaned_d2c_telemetry_egress_message, var.message)}" @@ -399,6 +411,7 @@ resource "datadog_monitor" "too_many_d2c_telemetry_egress_orphaned" { } resource "datadog_monitor" "too_many_d2c_telemetry_egress_invalid" { + count = "${var.invalid_d2c_telemetry_egress_enabled ? 1 : 0}" name = "[${var.environment}] IOT Hub Too many d2c telemetry egress invalid {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" message = "${coalesce(var.invalid_d2c_telemetry_egress_message, var.message)}" @@ -436,6 +449,7 @@ resource "datadog_monitor" "too_many_d2c_telemetry_egress_invalid" { } resource "datadog_monitor" "too_many_d2c_telemetry_ingress_nosent" { + count = "${var.too_many_d2c_telemetry_ingress_nosent_enabled ? 1 : 0}" name = "[${var.environment}] IOT Hub Too many d2c telemetry ingress not sent {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" message = "${coalesce(var.too_many_d2c_telemetry_ingress_nosent_message, var.message)}" diff --git a/cloud/azure/iothubs/outputs.tf b/cloud/azure/iothubs/outputs.tf index ad135fd..95c7cc0 100644 --- a/cloud/azure/iothubs/outputs.tf +++ b/cloud/azure/iothubs/outputs.tf @@ -1,69 +1,69 @@ output "too_many_jobs_failed_id" { description = "id for monitor too_many_jobs_failed" - value = "${datadog_monitor.too_many_jobs_failed.id}" + value = "${datadog_monitor.too_many_jobs_failed.*.id}" } output "too_many_list_jobs_failed_id" { description = "id for monitor too_many_list_jobs_failed" - value = "${datadog_monitor.too_many_list_jobs_failed.id}" + value = "${datadog_monitor.too_many_list_jobs_failed.*.id}" } output "too_many_query_jobs_failed_id" { description = "id for monitor too_many_query_jobs_failed" - value = "${datadog_monitor.too_many_query_jobs_failed.id}" + value = "${datadog_monitor.too_many_query_jobs_failed.*.id}" } output "status_id" { description = "id for monitor status" - value = "${datadog_monitor.status.id}" + value = "${datadog_monitor.status.*.id}" } output "total_devices_id" { description = "id for monitor total_devices" - value = "${datadog_monitor.total_devices.id}" + value = "${datadog_monitor.total_devices.*.id}" } output "too_many_c2d_methods_failed_id" { description = "id for monitor too_many_c2d_methods_failed" - value = "${datadog_monitor.too_many_c2d_methods_failed.id}" + value = "${datadog_monitor.too_many_c2d_methods_failed.*.id}" } output "too_many_c2d_twin_read_failed_id" { description = "id for monitor too_many_c2d_twin_read_failed" - value = "${datadog_monitor.too_many_c2d_twin_read_failed.id}" + value = "${datadog_monitor.too_many_c2d_twin_read_failed.*.id}" } output "too_many_c2d_twin_update_failed_id" { description = "id for monitor too_many_c2d_twin_update_failed" - value = "${datadog_monitor.too_many_c2d_twin_update_failed.id}" + value = "${datadog_monitor.too_many_c2d_twin_update_failed.*.id}" } output "too_many_d2c_twin_read_failed_id" { description = "id for monitor too_many_d2c_twin_read_failed" - value = "${datadog_monitor.too_many_d2c_twin_read_failed.id}" + value = "${datadog_monitor.too_many_d2c_twin_read_failed.*.id}" } output "too_many_d2c_twin_update_failed_id" { description = "id for monitor too_many_d2c_twin_update_failed" - value = "${datadog_monitor.too_many_d2c_twin_update_failed.id}" + value = "${datadog_monitor.too_many_d2c_twin_update_failed.*.id}" } output "too_many_d2c_telemetry_egress_dropped_id" { description = "id for monitor too_many_d2c_telemetry_egress_dropped" - value = "${datadog_monitor.too_many_d2c_telemetry_egress_dropped.id}" + value = "${datadog_monitor.too_many_d2c_telemetry_egress_dropped.*.id}" } output "too_many_d2c_telemetry_egress_orphaned_id" { description = "id for monitor too_many_d2c_telemetry_egress_orphaned" - value = "${datadog_monitor.too_many_d2c_telemetry_egress_orphaned.id}" + value = "${datadog_monitor.too_many_d2c_telemetry_egress_orphaned.*.id}" } output "too_many_d2c_telemetry_egress_invalid_id" { description = "id for monitor too_many_d2c_telemetry_egress_invalid" - value = "${datadog_monitor.too_many_d2c_telemetry_egress_invalid.id}" + value = "${datadog_monitor.too_many_d2c_telemetry_egress_invalid.*.id}" } output "too_many_d2c_telemetry_ingress_nosent_id" { description = "id for monitor too_many_d2c_telemetry_ingress_nosent" - value = "${datadog_monitor.too_many_d2c_telemetry_ingress_nosent.id}" + value = "${datadog_monitor.too_many_d2c_telemetry_ingress_nosent.*.id}" } diff --git a/cloud/azure/redis/README.md b/cloud/azure/redis/README.md index d8f1922..4c71735 100644 --- a/cloud/azure/redis/README.md +++ b/cloud/azure/redis/README.md @@ -27,6 +27,7 @@ Creates DataDog monitors with the following checks: |------|-------------|:----:|:-----:|:-----:| | environment | Architecture environment | string | - | yes | | evaluation_delay | Delay in seconds for the metric evaluation | string | `900` | no | +| evictedkeys_limit_enabled | Flag to enable Redis evicted keys monitor | string | `true` | no | | evictedkeys_limit_extra_tags | Extra tags for Redis evicted keys monitor | list | `` | no | | evictedkeys_limit_message | Custom message for Redis evicted keys monitor | string | `` | no | | evictedkeys_limit_silenced | Groups to mute for Redis evicted keys monitor | map | `` | no | @@ -38,6 +39,7 @@ Creates DataDog monitors with the following checks: | filter_tags_use_defaults | Use default filter tags convention | string | `true` | no | | message | Message sent when a Redis monitor is triggered | string | - | yes | | new_host_delay | Delay in seconds before monitor new resource | string | `300` | no | +| percent_processor_time_enabled | Flag to enable Redis processor monitor | string | `true` | no | | percent_processor_time_extra_tags | Extra tags for Redis processor monitor | list | `` | no | | percent_processor_time_message | Custom message for Redis processor monitor | string | `` | no | | percent_processor_time_silenced | Groups to mute for Redis processor monitor | map | `` | no | @@ -45,6 +47,7 @@ Creates DataDog monitors with the following checks: | percent_processor_time_threshold_warning | Processor time percent (warning threshold) | string | `60` | no | | percent_processor_time_time_aggregator | Monitor aggregator for Redis processor [available values: min, max or avg] | string | `min` | no | | percent_processor_time_timeframe | Monitor timeframe for Redis processor [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | +| server_load_rate_enabled | Flag to enable Redis server load monitor | string | `true` | no | | server_load_rate_extra_tags | Extra tags for Redis server load monitor | list | `` | no | | server_load_rate_message | Custom message for Redis server load monitor | string | `` | no | | server_load_rate_silenced | Groups to mute for Redis server load monitor | map | `` | no | @@ -52,6 +55,7 @@ Creates DataDog monitors with the following checks: | server_load_rate_threshold_warning | Server CPU load rate (warning threshold) | string | `70` | no | | server_load_rate_time_aggregator | Monitor aggregator for Redis server load [available values: min, max or avg] | string | `min` | no | | server_load_rate_timeframe | Monitor timeframe for Redis server load [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | +| status_enabled | Flag to enable Redis status monitor | string | `true` | no | | status_extra_tags | Extra tags for Redis status monitor | list | `` | no | | status_message | Custom message for Redis status monitor | string | `` | no | | status_silenced | Groups to mute for Redis status monitor | map | `` | no | diff --git a/cloud/azure/redis/inputs.tf b/cloud/azure/redis/inputs.tf index 6f4465e..59caf85 100644 --- a/cloud/azure/redis/inputs.tf +++ b/cloud/azure/redis/inputs.tf @@ -36,6 +36,12 @@ variable "status_silenced" { default = {} } +variable "status_enabled" { + description = "Flag to enable Redis status monitor" + type = "string" + default = "true" +} + variable "status_extra_tags" { description = "Extra tags for Redis status monitor" type = "list" @@ -66,6 +72,12 @@ variable "evictedkeys_limit_silenced" { default = {} } +variable "evictedkeys_limit_enabled" { + description = "Flag to enable Redis evicted keys monitor" + type = "string" + default = "true" +} + variable "evictedkeys_limit_extra_tags" { description = "Extra tags for Redis evicted keys monitor" type = "list" @@ -106,6 +118,12 @@ variable "percent_processor_time_silenced" { default = {} } +variable "percent_processor_time_enabled" { + description = "Flag to enable Redis processor monitor" + type = "string" + default = "true" +} + variable "percent_processor_time_extra_tags" { description = "Extra tags for Redis processor monitor" type = "list" @@ -146,6 +164,12 @@ variable "server_load_rate_silenced" { default = {} } +variable "server_load_rate_enabled" { + description = "Flag to enable Redis server load monitor" + type = "string" + default = "true" +} + variable "server_load_rate_extra_tags" { description = "Extra tags for Redis server load monitor" type = "list" diff --git a/cloud/azure/redis/monitors-azure-redis.tf b/cloud/azure/redis/monitors-azure-redis.tf index 82e8fb5..36e7db9 100644 --- a/cloud/azure/redis/monitors-azure-redis.tf +++ b/cloud/azure/redis/monitors-azure-redis.tf @@ -1,4 +1,5 @@ resource "datadog_monitor" "status" { + count = "${var.status_enabled ? 1 : 0}" name = "[${var.environment}] Redis {{name}} is down" message = "${coalesce(var.status_message, var.message)}" @@ -26,6 +27,7 @@ resource "datadog_monitor" "status" { } resource "datadog_monitor" "evictedkeys" { + count = "${var.evictedkeys_limit_enabled ? 1 : 0}" name = "[${var.environment}] Redis too many evictedkeys {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" message = "${coalesce(var.evictedkeys_limit_message, var.message)}" @@ -58,6 +60,7 @@ EOF } resource "datadog_monitor" "percent_processor_time" { + count = "${var.percent_processor_time_enabled ? 1 : 0}" name = "[${var.environment}] Redis processor time too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.percent_processor_time_message, var.message)}" @@ -90,6 +93,7 @@ EOF } resource "datadog_monitor" "server_load" { + count = "${var.server_load_rate_enabled ? 1 : 0}" name = "[${var.environment}] Redis server load too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.server_load_rate_message, var.message)}" diff --git a/cloud/azure/redis/outputs.tf b/cloud/azure/redis/outputs.tf index dea8098..f3c64a1 100644 --- a/cloud/azure/redis/outputs.tf +++ b/cloud/azure/redis/outputs.tf @@ -1,19 +1,19 @@ output "status_id" { description = "id for monitor status" - value = "${datadog_monitor.status.id}" + value = "${datadog_monitor.status.*.id}" } output "evictedkeys_id" { description = "id for monitor evictedkeys" - value = "${datadog_monitor.evictedkeys.id}" + value = "${datadog_monitor.evictedkeys.*.id}" } output "percent_processor_time_id" { description = "id for monitor percent_processor_time" - value = "${datadog_monitor.percent_processor_time.id}" + value = "${datadog_monitor.percent_processor_time.*.id}" } output "server_load_id" { description = "id for monitor server_load" - value = "${datadog_monitor.server_load.id}" + value = "${datadog_monitor.server_load.*.id}" } diff --git a/cloud/azure/sql-database/README.md b/cloud/azure/sql-database/README.md index 1c09157..bb83dfc 100644 --- a/cloud/azure/sql-database/README.md +++ b/cloud/azure/sql-database/README.md @@ -25,6 +25,7 @@ Creates DataDog monitors with the following checks: | Name | Description | Type | Default | Required | |------|-------------|:----:|:-----:|:-----:| +| cpu_enabled | Flag to enable SQL CPU monitor | string | `true` | no | | cpu_extra_tags | Extra tags for SQL CPU monitor | list | `` | no | | cpu_message | Custom message for SQL CPU monitor | string | `` | no | | cpu_silenced | Groups to mute for SQL CPU monitor | map | `` | no | @@ -32,11 +33,13 @@ Creates DataDog monitors with the following checks: | cpu_threshold_warning | CPU usage in percent (warning threshold) | string | `80` | no | | cpu_time_aggregator | Monitor aggregator for SQL CPU [available values: min, max or avg] | string | `min` | no | | cpu_timeframe | Monitor timeframe for SQL CPU [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_15m` | no | +| deadlock_enabled | Flag to enable SQL Deadlock monitor | string | `true` | no | | deadlock_extra_tags | Extra tags for SQL Deadlock monitor | list | `` | no | | deadlock_message | Custom message for SQL Deadlock monitor | string | `` | no | | deadlock_silenced | Groups to mute for SQL Deadlock monitor | map | `` | no | | deadlock_threshold_critical | Amount of Deadlocks (critical threshold) | string | `1` | no | | deadlock_timeframe | Monitor timeframe for SQL Deadlock [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | +| diskspace_enabled | Flag to enable SQL disk space monitor | string | `true` | no | | diskspace_extra_tags | Extra tags for SQL disk space monitor | list | `` | no | | diskspace_message | Custom message for SQL disk space monitor | string | `` | no | | diskspace_silenced | Groups to mute for SQL disk space monitor | map | `` | no | @@ -44,6 +47,7 @@ Creates DataDog monitors with the following checks: | diskspace_threshold_warning | Disk space used in percent (warning threshold) | string | `80` | no | | diskspace_time_aggregator | Monitor aggregator for SQL disk space [available values: min, max or avg] | string | `max` | no | | diskspace_timeframe | Monitor timeframe for SQL disk space [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_15m` | no | +| dtu_enabled | Flag to enable SQL DTU monitor | string | `true` | no | | dtu_extra_tags | Extra tags for SQL DTU monitor | list | `` | no | | dtu_message | Custom message for SQL DTU monitor | string | `` | no | | dtu_silenced | Groups to mute for SQL DTU monitor | map | `` | no | diff --git a/cloud/azure/sql-database/inputs.tf b/cloud/azure/sql-database/inputs.tf index 7e161f6..27993a4 100644 --- a/cloud/azure/sql-database/inputs.tf +++ b/cloud/azure/sql-database/inputs.tf @@ -36,6 +36,12 @@ variable "cpu_silenced" { default = {} } +variable "cpu_enabled" { + description = "Flag to enable SQL CPU monitor" + type = "string" + default = "true" +} + variable "cpu_extra_tags" { description = "Extra tags for SQL CPU monitor" type = "list" @@ -76,6 +82,12 @@ variable "diskspace_silenced" { default = {} } +variable "diskspace_enabled" { + description = "Flag to enable SQL disk space monitor" + type = "string" + default = "true" +} + variable "diskspace_extra_tags" { description = "Extra tags for SQL disk space monitor" type = "list" @@ -116,6 +128,12 @@ variable "dtu_silenced" { default = {} } +variable "dtu_enabled" { + description = "Flag to enable SQL DTU monitor" + type = "string" + default = "true" +} + variable "dtu_extra_tags" { description = "Extra tags for SQL DTU monitor" type = "list" @@ -156,6 +174,12 @@ variable "deadlock_silenced" { default = {} } +variable "deadlock_enabled" { + description = "Flag to enable SQL Deadlock monitor" + type = "string" + default = "true" +} + variable "deadlock_extra_tags" { description = "Extra tags for SQL Deadlock monitor" type = "list" diff --git a/cloud/azure/sql-database/monitors-sql-database-basics.tf b/cloud/azure/sql-database/monitors-sql-database-basics.tf index b09fa1c..a3cdfe1 100644 --- a/cloud/azure/sql-database/monitors-sql-database-basics.tf +++ b/cloud/azure/sql-database/monitors-sql-database-basics.tf @@ -1,4 +1,5 @@ resource "datadog_monitor" "sql-database_cpu_90_15min" { + count = "${var.cpu_enabled ? 1 : 0}" name = "[${var.environment}] SQL Database CPU too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.cpu_message, var.message)}" @@ -30,6 +31,7 @@ resource "datadog_monitor" "sql-database_cpu_90_15min" { } resource "datadog_monitor" "sql-database_free_space_low" { + count = "${var.diskspace_enabled ? 1 : 0}" name = "[${var.environment}] SQL Database low free space {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.diskspace_message, var.message)}" @@ -62,6 +64,7 @@ resource "datadog_monitor" "sql-database_free_space_low" { } resource "datadog_monitor" "sql-database_dtu_consumption_high" { + count = "${var.dtu_enabled ? 1 : 0}" name = "[${var.environment}] SQL Database DTU Consumption too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.dtu_message, var.message)}" @@ -94,6 +97,7 @@ resource "datadog_monitor" "sql-database_dtu_consumption_high" { } resource "datadog_monitor" "sql-database_deadlocks_count" { + count = "${var.deadlock_enabled ? 1 : 0}" name = "[${var.environment}] SQL Database Deadlocks too high {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" message = "${coalesce(var.deadlock_message, var.message)}" diff --git a/cloud/azure/sql-database/outputs.tf b/cloud/azure/sql-database/outputs.tf index 5a88cac..312506c 100644 --- a/cloud/azure/sql-database/outputs.tf +++ b/cloud/azure/sql-database/outputs.tf @@ -1,19 +1,19 @@ output "sql-database_cpu_90_15min_id" { description = "id for monitor sql-database_cpu_90_15min" - value = "${datadog_monitor.sql-database_cpu_90_15min.id}" + value = "${datadog_monitor.sql-database_cpu_90_15min.*.id}" } output "sql-database_free_space_low_id" { description = "id for monitor sql-database_free_space_low" - value = "${datadog_monitor.sql-database_free_space_low.id}" + value = "${datadog_monitor.sql-database_free_space_low.*.id}" } output "sql-database_dtu_consumption_high_id" { description = "id for monitor sql-database_dtu_consumption_high" - value = "${datadog_monitor.sql-database_dtu_consumption_high.id}" + value = "${datadog_monitor.sql-database_dtu_consumption_high.*.id}" } output "sql-database_deadlocks_count_id" { description = "id for monitor sql-database_deadlocks_count" - value = "${datadog_monitor.sql-database_deadlocks_count.id}" + value = "${datadog_monitor.sql-database_deadlocks_count.*.id}" } diff --git a/cloud/azure/storage/README.md b/cloud/azure/storage/README.md index 5ae66e5..a405f37 100644 --- a/cloud/azure/storage/README.md +++ b/cloud/azure/storage/README.md @@ -30,6 +30,7 @@ Creates DataDog monitors with the following checks: | Name | Description | Type | Default | Required | |------|-------------|:----:|:-----:|:-----:| +| authorization_error_requests_enabled | Flag to enable Storage authorization errors monitor | string | `true` | no | | authorization_error_requests_extra_tags | Extra tags for Storage authorization errors monitor | list | `` | no | | authorization_error_requests_message | Custom message for Storage authorization errors monitor | string | `` | no | | authorization_error_requests_silenced | Groups to mute for Storage authorization errors monitor | map | `` | no | @@ -37,6 +38,7 @@ Creates DataDog monitors with the following checks: | authorization_error_requests_threshold_warning | Warning regarding acceptable percent of authorization error requests for a storage | string | `50` | no | | authorization_error_requests_time_aggregator | Monitor aggregator for Storage authorization errors [available values: min, max or avg] | string | `min` | no | | authorization_error_requests_timeframe | Monitor timeframe for Storage authorization errors [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | +| availability_enabled | Flag to enable Storage availability monitor | string | `true` | no | | availability_extra_tags | Extra tags for Storage availability monitor | list | `` | no | | availability_message | Custom message for Storage availability monitor | string | `` | no | | availability_silenced | Groups to mute for Storage availability monitor | map | `` | no | @@ -44,6 +46,7 @@ Creates DataDog monitors with the following checks: | availability_threshold_warning | Warning regarding acceptable percent of availability for a storage | string | `90` | no | | availability_time_aggregator | Monitor aggregator for Storage availability [available values: min, max or avg] | string | `max` | no | | availability_timeframe | Monitor timeframe for Storage availability [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | +| client_other_error_requests_enabled | Flag to enable Storage other errors monitor | string | `true` | no | | client_other_error_requests_extra_tags | Extra tags for Storage other errors monitor | list | `` | no | | client_other_error_requests_message | Custom message for Storage other errors monitor | string | `` | no | | client_other_error_requests_silenced | Groups to mute for Storage other errors monitor | map | `` | no | @@ -55,6 +58,7 @@ Creates DataDog monitors with the following checks: | evaluation_delay | Delay in seconds for the metric evaluation | string | `900` | no | | filter_tags_custom | Tags used for custom filtering when filter_tags_use_defaults is false | string | `*` | no | | filter_tags_use_defaults | Use default filter tags convention | string | `true` | no | +| latency_enabled | Flag to enable Storage latency monitor | string | `true` | no | | latency_extra_tags | Extra tags for Storage latency monitor | list | `` | no | | latency_message | Custom message for Storage latency monitor | string | `` | no | | latency_silenced | Groups to mute for Storage latency monitor | map | `` | no | @@ -63,6 +67,7 @@ Creates DataDog monitors with the following checks: | latency_time_aggregator | Monitor aggregator for Storage latency [available values: min, max or avg] | string | `min` | no | | latency_timeframe | Monitor timeframe for Storage latency [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | | message | Message sent when a Redis monitor is triggered | string | - | yes | +| network_error_requests_enabled | Flag to enable Storage network errors monitor | string | `true` | no | | network_error_requests_extra_tags | Extra tags for Storage network errors monitor | list | `` | no | | network_error_requests_message | Custom message for Storage network errors monitor | string | `` | no | | network_error_requests_silenced | Groups to mute for Storage network errors monitor | map | `` | no | @@ -71,6 +76,7 @@ Creates DataDog monitors with the following checks: | network_error_requests_time_aggregator | Monitor aggregator for Storage network errors [available values: min, max or avg] | string | `min` | no | | network_error_requests_timeframe | Monitor timeframe for Storage network errors [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | | new_host_delay | Delay in seconds before monitor new resource | string | `300` | no | +| server_other_error_requests_enabled | Flag to enable Storage server other errors monitor | string | `true` | no | | server_other_error_requests_extra_tags | Extra tags for Storage server other errors monitor | list | `` | no | | server_other_error_requests_message | Custom message for Storage server other errors monitor | string | `` | no | | server_other_error_requests_silenced | Groups to mute for Storage server other errors monitor | map | `` | no | @@ -78,6 +84,7 @@ Creates DataDog monitors with the following checks: | server_other_error_requests_threshold_warning | Warning regarding acceptable percent of server other error requests for a storage | string | `50` | no | | server_other_error_requests_time_aggregator | Monitor aggregator for Storage other errors [available values: min, max or avg] | string | `min` | no | | server_other_error_requests_timeframe | Monitor timeframe for Storage server other errors [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | +| successful_requests_enabled | Flag to enable Storage sucessful requests monitor | string | `true` | no | | successful_requests_extra_tags | Extra tags for Storage sucessful requests monitor | list | `` | no | | successful_requests_message | Custom message for Storage sucessful requests monitor | string | `` | no | | successful_requests_silenced | Groups to mute for Storage sucessful requests monitor | map | `` | no | @@ -85,6 +92,7 @@ Creates DataDog monitors with the following checks: | successful_requests_threshold_warning | Warning regarding acceptable percent of successful requests for a storage | string | `30` | no | | successful_requests_time_aggregator | Monitor aggregator for Storage sucessful requests [available values: min, max or avg] | string | `max` | no | | successful_requests_timeframe | Monitor timeframe for Storage sucessful requests [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | +| throttling_error_requests_enabled | Flag to enable Storage throttling error monitor | string | `true` | no | | throttling_error_requests_extra_tags | Extra tags for Storage throttling error monitor | list | `` | no | | throttling_error_requests_message | Custom message for Storage throttling error monitor | string | `` | no | | throttling_error_requests_silenced | Groups to mute for Storage throttling error monitor | map | `` | no | @@ -92,6 +100,7 @@ Creates DataDog monitors with the following checks: | throttling_error_requests_threshold_warning | Warning regarding acceptable percent of throttling error requests for a storage | string | `50` | no | | throttling_error_requests_time_aggregator | Monitor aggregator for Storage throttling errors [available values: min, max or avg] | string | `min` | no | | throttling_error_requests_timeframe | Monitor timeframe for Storage throttling errors [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | +| timeout_error_requests_enabled | Flag to enable Storage timeout monitor | string | `true` | no | | timeout_error_requests_extra_tags | Extra tags for Storage timeout monitor | list | `` | no | | timeout_error_requests_message | Custom message for Storage timeout monitor | string | `` | no | | timeout_error_requests_silenced | Groups to mute for Storage timeout monitor | map | `` | no | diff --git a/cloud/azure/storage/inputs.tf b/cloud/azure/storage/inputs.tf index 5c0e460..be04e5e 100644 --- a/cloud/azure/storage/inputs.tf +++ b/cloud/azure/storage/inputs.tf @@ -36,6 +36,12 @@ variable "availability_silenced" { default = {} } +variable "availability_enabled" { + description = "Flag to enable Storage availability monitor" + type = "string" + default = "true" +} + variable "availability_extra_tags" { description = "Extra tags for Storage availability monitor" type = "list" @@ -76,6 +82,12 @@ variable "successful_requests_silenced" { default = {} } +variable "successful_requests_enabled" { + description = "Flag to enable Storage sucessful requests monitor" + type = "string" + default = "true" +} + variable "successful_requests_extra_tags" { description = "Extra tags for Storage sucessful requests monitor" type = "list" @@ -116,6 +128,12 @@ variable "latency_silenced" { default = {} } +variable "latency_enabled" { + description = "Flag to enable Storage latency monitor" + type = "string" + default = "true" +} + variable "latency_extra_tags" { description = "Extra tags for Storage latency monitor" type = "list" @@ -156,6 +174,12 @@ variable "timeout_error_requests_silenced" { default = {} } +variable "timeout_error_requests_enabled" { + description = "Flag to enable Storage timeout monitor" + type = "string" + default = "true" +} + variable "timeout_error_requests_extra_tags" { description = "Extra tags for Storage timeout monitor" type = "list" @@ -196,6 +220,12 @@ variable "network_error_requests_silenced" { default = {} } +variable "network_error_requests_enabled" { + description = "Flag to enable Storage network errors monitor" + type = "string" + default = "true" +} + variable "network_error_requests_extra_tags" { description = "Extra tags for Storage network errors monitor" type = "list" @@ -236,6 +266,12 @@ variable "throttling_error_requests_silenced" { default = {} } +variable "throttling_error_requests_enabled" { + description = "Flag to enable Storage throttling error monitor" + type = "string" + default = "true" +} + variable "throttling_error_requests_extra_tags" { description = "Extra tags for Storage throttling error monitor" type = "list" @@ -276,6 +312,12 @@ variable "server_other_error_requests_silenced" { default = {} } +variable "server_other_error_requests_enabled" { + description = "Flag to enable Storage server other errors monitor" + type = "string" + default = "true" +} + variable "server_other_error_requests_extra_tags" { description = "Extra tags for Storage server other errors monitor" type = "list" @@ -316,6 +358,12 @@ variable "client_other_error_requests_silenced" { default = {} } +variable "client_other_error_requests_enabled" { + description = "Flag to enable Storage other errors monitor" + type = "string" + default = "true" +} + variable "client_other_error_requests_extra_tags" { description = "Extra tags for Storage other errors monitor" type = "list" @@ -356,6 +404,12 @@ variable "authorization_error_requests_silenced" { default = {} } +variable "authorization_error_requests_enabled" { + description = "Flag to enable Storage authorization errors monitor" + type = "string" + default = "true" +} + variable "authorization_error_requests_extra_tags" { description = "Extra tags for Storage authorization errors monitor" type = "list" diff --git a/cloud/azure/storage/monitors-azure-storage.tf b/cloud/azure/storage/monitors-azure-storage.tf index 20a02c3..0244849 100644 --- a/cloud/azure/storage/monitors-azure-storage.tf +++ b/cloud/azure/storage/monitors-azure-storage.tf @@ -1,4 +1,5 @@ resource "datadog_monitor" "availability" { + count = "${var.availability_enabled ? 1 : 0}" name = "[${var.environment}] Azure Storage is down" message = "${coalesce(var.availability_message, var.message)}" @@ -30,6 +31,7 @@ EOF } resource "datadog_monitor" "successful_requests" { + count = "${var.successful_requests_enabled ? 1 : 0}" name = "[${var.environment}] Azure Storage too few successful requests {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.successful_requests_message, var.message)}" @@ -61,6 +63,7 @@ EOF } resource "datadog_monitor" "latency" { + count = "${var.latency_enabled ? 1 : 0}" name = "[${var.environment}] Azure Storage too high end to end latency {{#is_alert}}{{{comparator}}} {{threshold}}ms ({{value}}ms){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}ms ({{value}}ms){{/is_warning}}" message = "${coalesce(var.latency_message, var.message)}" @@ -92,6 +95,7 @@ EOF } resource "datadog_monitor" "timeout_error_requests" { + count = "${var.timeout_error_requests_enabled ? 1 : 0}" name = "[${var.environment}] Azure Storage too many timeout errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.timeout_error_requests_message, var.message)}" @@ -123,6 +127,7 @@ EOF } resource "datadog_monitor" "network_error_requests" { + count = "${var.network_error_requests_enabled ? 1 : 0}" name = "[${var.environment}] Azure Storage too many network errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.network_error_requests_message, var.message)}" @@ -154,6 +159,7 @@ EOF } resource "datadog_monitor" "throttling_error_requests" { + count = "${var.throttling_error_requests_enabled ? 1 : 0}" name = "[${var.environment}] Azure Storage too many throttling errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.throttling_error_requests_message, var.message)}" @@ -185,6 +191,7 @@ EOF } resource "datadog_monitor" "server_other_error_requests" { + count = "${var.server_other_error_requests_enabled ? 1 : 0}" name = "[${var.environment}] Azure Storage too many server_other errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.server_other_error_requests_message, var.message)}" @@ -216,6 +223,7 @@ EOF } resource "datadog_monitor" "client_other_error_requests" { + count = "${var.client_other_error_requests_enabled ? 1 : 0}" name = "[${var.environment}] Azure Storage too many client_other errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.client_other_error_requests_message, var.message)}" @@ -247,6 +255,7 @@ EOF } resource "datadog_monitor" "authorization_error_requests" { + count = "${var.authorization_error_requests_enabled ? 1 : 0}" name = "[${var.environment}] Azure Storage too many authorization errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.authorization_error_requests_message, var.message)}" diff --git a/cloud/azure/storage/outputs.tf b/cloud/azure/storage/outputs.tf index cf465b3..261c8f1 100644 --- a/cloud/azure/storage/outputs.tf +++ b/cloud/azure/storage/outputs.tf @@ -1,44 +1,44 @@ output "availability_id" { description = "id for monitor availability" - value = "${datadog_monitor.availability.id}" + value = "${datadog_monitor.availability.*.id}" } output "successful_requests_id" { description = "id for monitor successful_requests" - value = "${datadog_monitor.successful_requests.id}" + value = "${datadog_monitor.successful_requests.*.id}" } output "latency_id" { description = "id for monitor latency" - value = "${datadog_monitor.latency.id}" + value = "${datadog_monitor.latency.*.id}" } output "timeout_error_requests_id" { description = "id for monitor timeout_error_requests" - value = "${datadog_monitor.timeout_error_requests.id}" + value = "${datadog_monitor.timeout_error_requests.*.id}" } output "network_error_requests_id" { description = "id for monitor network_error_requests" - value = "${datadog_monitor.network_error_requests.id}" + value = "${datadog_monitor.network_error_requests.*.id}" } output "throttling_error_requests_id" { description = "id for monitor throttling_error_requests" - value = "${datadog_monitor.throttling_error_requests.id}" + value = "${datadog_monitor.throttling_error_requests.*.id}" } output "server_other_error_requests_id" { description = "id for monitor server_other_error_requests" - value = "${datadog_monitor.server_other_error_requests.id}" + value = "${datadog_monitor.server_other_error_requests.*.id}" } output "client_other_error_requests_id" { description = "id for monitor client_other_error_requests" - value = "${datadog_monitor.client_other_error_requests.id}" + value = "${datadog_monitor.client_other_error_requests.*.id}" } output "authorization_error_requests_id" { description = "id for monitor authorization_error_requests" - value = "${datadog_monitor.authorization_error_requests.id}" + value = "${datadog_monitor.authorization_error_requests.*.id}" } diff --git a/cloud/azure/stream-analytics/README.md b/cloud/azure/stream-analytics/README.md index bbec40a..56dbe21 100644 --- a/cloud/azure/stream-analytics/README.md +++ b/cloud/azure/stream-analytics/README.md @@ -26,6 +26,7 @@ Creates DataDog monitors with the following checks: | Name | Description | Type | Default | Required | |------|-------------|:----:|:-----:|:-----:| +| conversion_errors_enabled | Flag to enable Stream Analytics conversion errors monitor | string | `true` | no | | conversion_errors_extra_tags | Extra tags for Stream Analytics conversion errors monitor | list | `` | no | | conversion_errors_message | Custom message for Stream Analytics conversion errors monitor | string | `` | no | | conversion_errors_silenced | Groups to mute for Stream Analytics conversion errors monitor | map | `` | no | @@ -35,6 +36,7 @@ Creates DataDog monitors with the following checks: | conversion_errors_timeframe | Monitor timeframe for Stream Analytics conversion errors [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 | - | yes | | evaluation_delay | Delay in seconds for the metric evaluation | string | `900` | no | +| failed_function_requests_enabled | Flag to enable Stream Analytics failed requests monitor | string | `true` | no | | failed_function_requests_extra_tags | Extra tags for Stream Analytics failed requests monitor | list | `` | no | | failed_function_requests_message | Custom message for Stream Analytics failed requests monitor | string | `` | no | | failed_function_requests_silenced | Groups to mute for Stream Analytics failed requests monitor | map | `` | no | @@ -45,6 +47,7 @@ Creates DataDog monitors with the following checks: | filter_tags_use_defaults | Use default filter tags convention | string | `true` | no | | message | Message sent when a Redis monitor is triggered | string | - | yes | | new_host_delay | Delay in seconds before monitor new resource | string | `300` | no | +| runtime_errors_enabled | Flag to enable Stream Analytics runtime errors monitor | string | `true` | no | | runtime_errors_extra_tags | Extra tags for Stream Analytics runtime errors monitor | list | `` | no | | runtime_errors_message | Custom message for Stream Analytics runtime errors monitor | string | `` | no | | runtime_errors_silenced | Groups to mute for Stream Analytics runtime errors monitor | map | `` | no | @@ -52,11 +55,13 @@ Creates DataDog monitors with the following checks: | runtime_errors_threshold_warning | Runtime errors limit (warning threshold) | string | `0` | no | | runtime_errors_time_aggregator | Monitor aggregator for Stream Analytics runtime errors [available values: min, max or avg] | string | `min` | no | | runtime_errors_timeframe | Monitor timeframe for Stream Analytics runtime errors [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | +| status_enabled | Flag to enable Stream Analytics status monitor | string | `true` | no | | status_extra_tags | Extra tags for Stream Analytics status monitor | list | `` | no | | status_message | Custom message for Stream Analytics status monitor | string | `` | no | | status_silenced | Groups to mute for Stream Analytics status monitor | map | `` | no | | status_time_aggregator | Monitor aggregator for Stream Analytics status [available values: min, max or avg] | string | `max` | no | | status_timeframe | Monitor timeframe for Stream Analytics status [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | +| su_utilization_enabled | Flag to enable Stream Analytics utilization monitor | string | `true` | no | | su_utilization_extra_tags | Extra tags for Stream Analytics utilization monitor | list | `` | no | | su_utilization_message | Custom message for Stream Analytics utilization monitor | string | `` | no | | su_utilization_silenced | Groups to mute for Stream Analytics utilization monitor | map | `` | no | diff --git a/cloud/azure/stream-analytics/inputs.tf b/cloud/azure/stream-analytics/inputs.tf index d11a34d..677d0a3 100644 --- a/cloud/azure/stream-analytics/inputs.tf +++ b/cloud/azure/stream-analytics/inputs.tf @@ -36,6 +36,12 @@ variable "status_silenced" { default = {} } +variable "status_enabled" { + description = "Flag to enable Stream Analytics status monitor" + type = "string" + default = "true" +} + variable "status_extra_tags" { description = "Extra tags for Stream Analytics status monitor" type = "list" @@ -66,6 +72,12 @@ variable "su_utilization_silenced" { default = {} } +variable "su_utilization_enabled" { + description = "Flag to enable Stream Analytics utilization monitor" + type = "string" + default = "true" +} + variable "su_utilization_extra_tags" { description = "Extra tags for Stream Analytics utilization monitor" type = "list" @@ -106,6 +118,12 @@ variable "failed_function_requests_silenced" { default = {} } +variable "failed_function_requests_enabled" { + description = "Flag to enable Stream Analytics failed requests monitor" + type = "string" + default = "true" +} + variable "failed_function_requests_extra_tags" { description = "Extra tags for Stream Analytics failed requests monitor" type = "list" @@ -140,6 +158,12 @@ variable "conversion_errors_silenced" { default = {} } +variable "conversion_errors_enabled" { + description = "Flag to enable Stream Analytics conversion errors monitor" + type = "string" + default = "true" +} + variable "conversion_errors_extra_tags" { description = "Extra tags for Stream Analytics conversion errors monitor" type = "list" @@ -180,6 +204,12 @@ variable "runtime_errors_silenced" { default = {} } +variable "runtime_errors_enabled" { + description = "Flag to enable Stream Analytics runtime errors monitor" + type = "string" + default = "true" +} + variable "runtime_errors_extra_tags" { description = "Extra tags for Stream Analytics runtime errors monitor" type = "list" diff --git a/cloud/azure/stream-analytics/monitors-stream-analytics.tf b/cloud/azure/stream-analytics/monitors-stream-analytics.tf index 00fa248..4ea2efa 100644 --- a/cloud/azure/stream-analytics/monitors-stream-analytics.tf +++ b/cloud/azure/stream-analytics/monitors-stream-analytics.tf @@ -1,4 +1,5 @@ resource "datadog_monitor" "status" { + count = "${var.status_enabled ? 1 : 0}" name = "[${var.environment}] Stream Analytics is down" message = "${coalesce(var.status_message, var.message)}" @@ -26,6 +27,7 @@ resource "datadog_monitor" "status" { } resource "datadog_monitor" "su_utilization" { + count = "${var.su_utilization_enabled ? 1 : 0}" name = "[${var.environment}] Stream Analytics streaming units utilization too high {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" message = "${coalesce(var.su_utilization_message, var.message)}" @@ -58,6 +60,7 @@ resource "datadog_monitor" "su_utilization" { } resource "datadog_monitor" "failed_function_requests" { + count = "${var.failed_function_requests_enabled ? 1 : 0}" name = "[${var.environment}] Stream Analytics too many failed requests {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.failed_function_requests_message, var.message)}" @@ -91,6 +94,7 @@ resource "datadog_monitor" "failed_function_requests" { } resource "datadog_monitor" "conversion_errors" { + count = "${var.conversion_errors_enabled ? 1 : 0}" name = "[${var.environment}] Stream Analytics too many conversion errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.conversion_errors_message, var.message)}" @@ -123,6 +127,7 @@ resource "datadog_monitor" "conversion_errors" { } resource "datadog_monitor" "runtime_errors" { + count = "${var.runtime_errors_enabled ? 1 : 0}" name = "[${var.environment}] Stream Analytics too many runtime errors {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" message = "${coalesce(var.runtime_errors_message, var.message)}" diff --git a/cloud/azure/stream-analytics/outputs.tf b/cloud/azure/stream-analytics/outputs.tf index 189f1bf..e0367f7 100644 --- a/cloud/azure/stream-analytics/outputs.tf +++ b/cloud/azure/stream-analytics/outputs.tf @@ -1,24 +1,24 @@ output "status_id" { description = "id for monitor status" - value = "${datadog_monitor.status.id}" + value = "${datadog_monitor.status.*.id}" } output "su_utilization_id" { description = "id for monitor su_utilization" - value = "${datadog_monitor.su_utilization.id}" + value = "${datadog_monitor.su_utilization.*.id}" } output "failed_function_requests_id" { description = "id for monitor failed_function_requests" - value = "${datadog_monitor.failed_function_requests.id}" + value = "${datadog_monitor.failed_function_requests.*.id}" } output "conversion_errors_id" { description = "id for monitor conversion_errors" - value = "${datadog_monitor.conversion_errors.id}" + value = "${datadog_monitor.conversion_errors.*.id}" } output "runtime_errors_id" { description = "id for monitor runtime_errors" - value = "${datadog_monitor.runtime_errors.id}" + value = "${datadog_monitor.runtime_errors.*.id}" } diff --git a/database/mongodb/README.md b/database/mongodb/README.md index 01653ac..4775df8 100644 --- a/database/mongodb/README.md +++ b/database/mongodb/README.md @@ -34,21 +34,25 @@ Creates DataDog monitors with the following checks: | mongodb_lag_critical | Critical replication lag in s | string | `5` | no | | mongodb_lag_warning | Warn replication lag in s | string | `2` | no | | mongodb_primary_aggregator | Monitor aggregator for MongoDB primary state [available values: min, max] | string | `max` | no | +| mongodb_primary_enabled | Flag to enable MongoDB primary state monitor | string | `true` | no | | mongodb_primary_extra_tags | Extra tags for MongoDB primary state monitor | list | `` | no | | mongodb_primary_message | Custom message for MongoDB primary monitor | string | `` | no | | mongodb_primary_silenced | Groups to mute for MongoDB primary state monitor | map | `` | no | | mongodb_primary_timeframe | Monitor timeframe for MongoDB wrong state for primary node [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_1m` | no | | mongodb_replication_aggregator | Monitor aggregator for MongoDB replication lag [available values: min, max, sum or avg] | string | `avg` | no | +| mongodb_replication_enabled | Flag to enable MongoDB replication lag monitor | string | `true` | no | | mongodb_replication_extra_tags | Extra tags for MongoDB replication lag monitor | list | `` | no | | mongodb_replication_message | Custom message for MongoDB replication monitor | string | `` | no | | mongodb_replication_silenced | Groups to mute for MongoDB replication lag monitor | map | `` | no | | mongodb_replication_timeframe | Monitor timeframe for MongoDB replication lag [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_1m` | no | | mongodb_secondary_aggregator | Monitor aggregator for MongoDB secondary state [available values: min, max] | string | `max` | no | +| mongodb_secondary_enabled | Flag to enable MongoDB secondary state monitor | string | `true` | no | | mongodb_secondary_extra_tags | Extra tags for MongoDB secondary state monitor | list | `` | no | | mongodb_secondary_message | Custom message for MongoDB secondary monitor | string | `` | no | | mongodb_secondary_silenced | Groups to mute for MongoDB secondary state monitor | map | `` | no | | mongodb_secondary_timeframe | Monitor timeframe for MongoDB wrong state for secondaries nodes [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | | mongodb_server_count_aggregator | Monitor aggregator for MongoDB server count [available values: min, max] | string | `min` | no | +| mongodb_server_count_enabled | Flag to enable MongoDB server count monitor | string | `true` | no | | mongodb_server_count_message | Custom message for MongoDB server count | string | `` | no | | mongodb_server_count_silenced | Groups to mute for MongoDB server count monitor | map | `` | no | | mongodb_server_count_timeframe | Monitor timeframe for MongoDB wrong server count [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_15m` | no | diff --git a/database/mongodb/inputs.tf b/database/mongodb/inputs.tf index e8d45e4..0da4322 100644 --- a/database/mongodb/inputs.tf +++ b/database/mongodb/inputs.tf @@ -74,6 +74,12 @@ variable "mongodb_primary_silenced" { default = {} } +variable "mongodb_primary_enabled" { + description = "Flag to enable MongoDB primary state monitor" + type = "string" + default = "true" +} + variable "mongodb_primary_extra_tags" { description = "Extra tags for MongoDB primary state monitor" type = "list" @@ -86,6 +92,12 @@ variable "mongodb_secondary_silenced" { default = {} } +variable "mongodb_secondary_enabled" { + description = "Flag to enable MongoDB secondary state monitor" + type = "string" + default = "true" +} + variable "mongodb_secondary_extra_tags" { description = "Extra tags for MongoDB secondary state monitor" type = "list" @@ -98,12 +110,24 @@ variable "mongodb_server_count_silenced" { default = {} } +variable "mongodb_server_count_enabled" { + description = "Flag to enable MongoDB server count monitor" + type = "string" + default = "true" +} + variable "mongodb_replication_silenced" { description = "Groups to mute for MongoDB replication lag monitor" type = "map" default = {} } +variable "mongodb_replication_enabled" { + description = "Flag to enable MongoDB replication lag monitor" + type = "string" + default = "true" +} + variable "mongodb_replication_extra_tags" { description = "Extra tags for MongoDB replication lag monitor" type = "list" diff --git a/database/mongodb/monitors-mongo.tf b/database/mongodb/monitors-mongo.tf index 8f52da0..9d897f0 100644 --- a/database/mongodb/monitors-mongo.tf +++ b/database/mongodb/monitors-mongo.tf @@ -1,4 +1,5 @@ resource "datadog_monitor" "mongodb_primary" { + count = "${var.mongodb_primary_enabled ? 1 : 0}" name = "[${var.environment}] MongoDB primary state" message = "${coalesce(var.mongodb_primary_message, var.message)}" @@ -24,6 +25,7 @@ resource "datadog_monitor" "mongodb_primary" { } resource "datadog_monitor" "mongodb_secondary" { + count = "${var.mongodb_secondary_enabled ? 1 : 0}" name = "[${var.environment}] MongoDB secondary missing" message = "${coalesce(var.mongodb_secondary_message, var.message)}" @@ -56,6 +58,7 @@ resource "datadog_monitor" "mongodb_secondary" { } resource "datadog_monitor" "mongodb_server_count" { + count = "${var.mongodb_server_count_enabled ? 1 : 0}" name = "[${var.environment}] MongoDB too much servers or wrong monitoring config" message = "${coalesce(var.mongodb_server_count_message, var.message)}" @@ -87,6 +90,7 @@ resource "datadog_monitor" "mongodb_server_count" { } resource "datadog_monitor" "mongodb_replication" { + count = "${var.mongodb_replication_enabled ? 1 : 0}" name = "[${var.environment}] MongoDB replication lag" message = "${coalesce(var.mongodb_replication_message, var.message)}" diff --git a/database/mongodb/outputs.tf b/database/mongodb/outputs.tf index 8355291..4fb112b 100644 --- a/database/mongodb/outputs.tf +++ b/database/mongodb/outputs.tf @@ -1,19 +1,19 @@ output "mongodb_primary_id" { description = "id for monitor mongodb_primary" - value = "${datadog_monitor.mongodb_primary.id}" + value = "${datadog_monitor.mongodb_primary.*.id}" } output "mongodb_secondary_id" { description = "id for monitor mongodb_secondary" - value = "${datadog_monitor.mongodb_secondary.id}" + value = "${datadog_monitor.mongodb_secondary.*.id}" } output "mongodb_server_count_id" { description = "id for monitor mongodb_server_count" - value = "${datadog_monitor.mongodb_server_count.id}" + value = "${datadog_monitor.mongodb_server_count.*.id}" } output "mongodb_replication_id" { description = "id for monitor mongodb_replication" - value = "${datadog_monitor.mongodb_replication.id}" + value = "${datadog_monitor.mongodb_replication.*.id}" } diff --git a/database/redis/README.md b/database/redis/README.md index 1aa52c8..59046ce 100644 --- a/database/redis/README.md +++ b/database/redis/README.md @@ -31,6 +31,7 @@ Creates DataDog monitors with the following checks: | Name | Description | Type | Default | Required | |------|-------------|:----:|:-----:|:-----:| +| blocked_clients_enabled | Flag to enable Redis Blocked clients monitor | string | `true` | no | | blocked_clients_extra_tags | Extra tags for Redis Blocked clients monitor | list | `` | no | | blocked_clients_message | Custom message for Redis Blocked clients monitor | string | `` | no | | blocked_clients_silenced | Groups to mute for Redis Blocked clients monitor | map | `` | no | @@ -40,6 +41,7 @@ Creates DataDog monitors with the following checks: | blocked_clients_timeframe | Monitor timeframe for Redis Blocked clients [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 | - | yes | | evaluation_delay | Delay in seconds for the metric evaluation | string | `15` | no | +| evictedkeys_change_enabled | Flag to enable Redis evicted keys monitor | string | `true` | no | | evictedkeys_change_extra_tags | Extra tags for Redis evicted keys monitor | list | `` | no | | evictedkeys_change_message | Custom message for Redis evicted keys monitor | string | `` | no | | evictedkeys_change_silenced | Groups to mute for Redis evicted keys monitor | map | `` | no | @@ -47,6 +49,7 @@ Creates DataDog monitors with the following checks: | evictedkeys_change_threshold_warning | Evicted keys change (warning threshold) | string | `20` | no | | evictedkeys_change_time_aggregator | Monitor aggregator for Redis evicted keys [available values: min, max or avg] | string | `avg` | no | | evictedkeys_change_timeframe | Monitor timeframe for Redis evicted keys [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | +| expirations_rate_enabled | Flag to enable Redis keys expirations monitor | string | `true` | no | | expirations_rate_extra_tags | Extra tags for Redis keys expirations monitor | list | `` | no | | expirations_rate_message | Custom message for Redis keys expirations monitor | string | `` | no | | expirations_rate_silenced | Groups to mute for Redis keys expirations monitor | map | `` | no | @@ -56,6 +59,7 @@ Creates DataDog monitors with the following checks: | expirations_rate_timeframe | Monitor timeframe for Redis keys expirations [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | | filter_tags_custom | Tags used for custom filtering when filter_tags_use_defaults is false | string | `*` | no | | filter_tags_use_defaults | Use default filter tags convention | string | `true` | no | +| hitrate_enabled | Flag to enable Redis hitrate monitor | string | `true` | no | | hitrate_extra_tags | Extra tags for Redis hitrate monitor | list | `` | no | | hitrate_message | Custom message for Redis hitrate monitor | string | `` | no | | hitrate_silenced | Groups to mute for Redis hitrate monitor | map | `` | no | @@ -63,6 +67,7 @@ Creates DataDog monitors with the following checks: | hitrate_threshold_warning | hitrate limit (warning threshold) | string | `30` | no | | hitrate_time_aggregator | Monitor aggregator for Redis hitrate [available values: min, max or avg] | string | `max` | no | | hitrate_timeframe | Monitor timeframe for Redis hitrate [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | +| keyspace_enabled | Flag to enable Redis keyspace monitor | string | `true` | no | | keyspace_extra_tags | Extra tags for Redis keyspace monitor | list | `` | no | | keyspace_message | Custom message for Redis keyspace monitor | string | `` | no | | keyspace_silenced | Groups to mute for Redis keyspace monitor | map | `` | no | @@ -70,6 +75,7 @@ Creates DataDog monitors with the following checks: | keyspace_threshold_warning | Keyspace no changement (warning threshold) | string | `1` | no | | keyspace_time_aggregator | Monitor aggregator for Redis keyspace [available values: min, max or avg] | string | `min` | no | | keyspace_timeframe | Monitor timeframe for Redis keyspace [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | +| latency_enabled | Flag to enable Redis latency monitor | string | `true` | no | | latency_extra_tags | Extra tags for Redis latency monitor | list | `` | no | | latency_message | Custom message for Redis latency monitor | string | `` | no | | latency_silenced | Groups to mute for Redis latency monitor | map | `` | no | @@ -77,6 +83,7 @@ Creates DataDog monitors with the following checks: | latency_threshold_warning | latency limit (warning threshold) | string | `50` | no | | latency_time_aggregator | Monitor aggregator for Redis latency [available values: min, max or avg] | string | `min` | no | | latency_timeframe | Monitor timeframe for Redis latency [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | +| mem_frag_enabled | Flag to enable Redis memory RAM fragmentation monitor | string | `true` | no | | mem_frag_extra_tags | Extra tags for Redis memory RAM fragmentation monitor | list | `` | no | | mem_frag_message | Custom message for Redis memory RAM fragmentation monitor | string | `` | no | | mem_frag_silenced | Groups to mute for Redis memory RAM fragmentation monitor | map | `` | no | @@ -84,6 +91,7 @@ Creates DataDog monitors with the following checks: | mem_frag_threshold_warning | memory RAM fragmentation limit (warning threshold) | string | `130` | no | | mem_frag_time_aggregator | Monitor aggregator for Redis memory RAM fragmentation [available values: min, max or avg] | string | `min` | no | | mem_frag_timeframe | Monitor timeframe for Redis memory RAM fragmentation [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | +| mem_used_enabled | Flag to enable Redis RAM memory used monitor | string | `true` | no | | mem_used_extra_tags | Extra tags for Redis RAM memory used monitor | list | `` | no | | mem_used_message | Custom message for Redis RAM memory used monitor | string | `` | no | | mem_used_silenced | Groups to mute for Redis RAM memory used monitor | map | `` | no | @@ -93,10 +101,11 @@ Creates DataDog monitors with the following checks: | mem_used_timeframe | Monitor timeframe for Redis RAM memory used [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | | message | Message sent when a Redis monitor is triggered | string | - | yes | | new_host_delay | Delay in seconds for the metric evaluation | string | `300` | no | +| not_responding_enabled | Flag to enable Redis does not respond monitor | string | `true` | no | | not_responding_extra_tags | Extra tags for Redis does not respond monitor | list | `` | no | | not_responding_message | Custom message for Redis does not respond monitor | string | `` | no | | not_responding_silenced | Groups to mute for Redis does not respond monitor | map | `` | no | -| redis_silenced | Groups to mute for Redis monitors | map | `` | no | +| rejected_con_enabled | Flag to enable Redis rejected connections errors monitor | string | `true` | no | | rejected_con_extra_tags | Extra tags for Redis rejected connections errors monitor | list | `` | no | | rejected_con_message | Custom message for Redis rejected connections errors monitor | string | `` | no | | rejected_con_silenced | Groups to mute for Redis rejected connections errors monitor | map | `` | no | diff --git a/database/redis/inputs.tf b/database/redis/inputs.tf index e651acf..9cbda7d 100644 --- a/database/redis/inputs.tf +++ b/database/redis/inputs.tf @@ -30,11 +30,6 @@ variable "filter_tags_custom" { } # Redis specific variables -variable "redis_silenced" { - description = "Groups to mute for Redis monitors" - type = "map" - default = {} -} variable "evictedkeys_change_silenced" { description = "Groups to mute for Redis evicted keys monitor" @@ -42,6 +37,12 @@ variable "evictedkeys_change_silenced" { default = {} } +variable "evictedkeys_change_enabled" { + description = "Flag to enable Redis evicted keys monitor" + type = "string" + default = "true" +} + variable "evictedkeys_change_message" { description = "Custom message for Redis evicted keys monitor" type = "string" @@ -82,6 +83,12 @@ variable "expirations_rate_silenced" { default = {} } +variable "expirations_rate_enabled" { + description = "Flag to enable Redis keys expirations monitor" + type = "string" + default = "true" +} + variable "expirations_rate_message" { description = "Custom message for Redis keys expirations monitor" type = "string" @@ -122,6 +129,12 @@ variable "blocked_clients_silenced" { default = {} } +variable "blocked_clients_enabled" { + description = "Flag to enable Redis Blocked clients monitor" + type = "string" + default = "true" +} + variable "blocked_clients_message" { description = "Custom message for Redis Blocked clients monitor" type = "string" @@ -165,6 +178,12 @@ variable "keyspace_silenced" { } } +variable "keyspace_enabled" { + description = "Flag to enable Redis keyspace monitor" + type = "string" + default = "true" +} + variable "keyspace_message" { description = "Custom message for Redis keyspace monitor" type = "string" @@ -205,6 +224,12 @@ variable "mem_used_silenced" { default = {} } +variable "mem_used_enabled" { + description = "Flag to enable Redis RAM memory used monitor" + type = "string" + default = "true" +} + variable "mem_used_message" { description = "Custom message for Redis RAM memory used monitor" type = "string" @@ -245,6 +270,12 @@ variable "mem_frag_silenced" { default = {} } +variable "mem_frag_enabled" { + description = "Flag to enable Redis memory RAM fragmentation monitor" + type = "string" + default = "true" +} + variable "mem_frag_message" { description = "Custom message for Redis memory RAM fragmentation monitor" type = "string" @@ -285,6 +316,12 @@ variable "rejected_con_silenced" { default = {} } +variable "rejected_con_enabled" { + description = "Flag to enable Redis rejected connections errors monitor" + type = "string" + default = "true" +} + variable "rejected_con_message" { description = "Custom message for Redis rejected connections errors monitor" type = "string" @@ -325,6 +362,12 @@ variable "latency_silenced" { default = {} } +variable "latency_enabled" { + description = "Flag to enable Redis latency monitor" + type = "string" + default = "true" +} + variable "latency_message" { description = "Custom message for Redis latency monitor" type = "string" @@ -365,6 +408,12 @@ variable "hitrate_silenced" { default = {} } +variable "hitrate_enabled" { + description = "Flag to enable Redis hitrate monitor" + type = "string" + default = "true" +} + variable "hitrate_message" { description = "Custom message for Redis hitrate monitor" type = "string" @@ -408,6 +457,12 @@ variable "not_responding_silenced" { default = {} } +variable "not_responding_enabled" { + description = "Flag to enable Redis does not respond monitor" + type = "string" + default = "true" +} + variable "not_responding_message" { description = "Custom message for Redis does not respond monitor" type = "string" diff --git a/database/redis/monitors-redis.tf b/database/redis/monitors-redis.tf index 2821fdc..00c90f2 100644 --- a/database/redis/monitors-redis.tf +++ b/database/redis/monitors-redis.tf @@ -1,4 +1,5 @@ resource "datadog_monitor" "evicted_keys" { + count = "${var.evictedkeys_change_enabled ? 1 : 0}" name = "[${var.environment}] Redis evicted keys {{#is_alert}}{{{comparator}}} {{threshold}}% (+{{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% (+{{value}}%){{/is_warning}}" message = "${coalesce(var.evictedkeys_change_message, var.message)}" @@ -31,6 +32,7 @@ EOL } resource "datadog_monitor" "expirations" { + count = "${var.expirations_rate_enabled ? 1 : 0}" name = "[${var.environment}] Redis expired keys {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.expirations_rate_message, var.message)}" @@ -63,6 +65,7 @@ EOL } resource "datadog_monitor" "blocked_clients" { + count = "${var.blocked_clients_enabled ? 1 : 0}" name = "[${var.environment}] Redis blocked clients {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.blocked_clients_message, var.message)}" @@ -96,6 +99,7 @@ EOL } resource "datadog_monitor" "keyspace_full" { + count = "${var.keyspace_enabled ? 1 : 0}" name = "[${var.environment}] Redis keyspace seems full (no changes since ${var.keyspace_timeframe})" message = "${coalesce(var.keyspace_message, var.message)}" @@ -128,6 +132,7 @@ EOL } resource "datadog_monitor" "memory_used" { + count = "${var.mem_used_enabled ? 1 : 0}" name = "[${var.environment}] Redis memory used {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.mem_used_message, var.message)}" @@ -161,6 +166,7 @@ EOL } resource "datadog_monitor" "memory_frag" { + count = "${var.mem_frag_enabled ? 1 : 0}" name = "[${var.environment}] Redis memory fragmented {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.mem_frag_message, var.message)}" @@ -193,6 +199,7 @@ EOL } resource "datadog_monitor" "rejected_connections" { + count = "${var.rejected_con_enabled ? 1 : 0}" name = "[${var.environment}] Redis rejected connections {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" message = "${coalesce(var.rejected_con_message, var.message)}" @@ -225,6 +232,7 @@ EOL } resource "datadog_monitor" "latency" { + count = "${var.latency_enabled ? 1 : 0}" name = "[${var.environment}] Redis latency {{#is_alert}}{{{comparator}}} {{threshold}}ms ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}ms ({{value}}){{/is_warning}}" message = "${coalesce(var.latency_message, var.message)}" @@ -257,6 +265,7 @@ EOL } resource "datadog_monitor" "hitrate" { + count = "${var.hitrate_enabled ? 1 : 0}" name = "[${var.environment}] Redis hitrate {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.hitrate_message, var.message)}" @@ -294,6 +303,7 @@ EOL # Service Check # resource "datadog_monitor" "not_responding" { + count = "${var.not_responding_enabled ? 1 : 0}" name = "[${var.environment}] Redis does not respond" message = "${coalesce(var.not_responding_message, var.message)}" diff --git a/database/redis/outputs.tf b/database/redis/outputs.tf index ab94440..92c4ead 100644 --- a/database/redis/outputs.tf +++ b/database/redis/outputs.tf @@ -1,49 +1,49 @@ output "evicted_keys_id" { description = "id for monitor evicted_keys" - value = "${datadog_monitor.evicted_keys.id}" + value = "${datadog_monitor.evicted_keys.*.id}" } output "expirations_id" { description = "id for monitor expirations" - value = "${datadog_monitor.expirations.id}" + value = "${datadog_monitor.expirations.*.id}" } output "blocked_clients_id" { description = "id for monitor blocked_clients" - value = "${datadog_monitor.blocked_clients.id}" + value = "${datadog_monitor.blocked_clients.*.id}" } output "keyspace_full_id" { description = "id for monitor keyspace_full" - value = "${datadog_monitor.keyspace_full.id}" + value = "${datadog_monitor.keyspace_full.*.id}" } output "memory_used_id" { description = "id for monitor memory_used" - value = "${datadog_monitor.memory_used.id}" + value = "${datadog_monitor.memory_used.*.id}" } output "memory_frag_id" { description = "id for monitor memory_frag" - value = "${datadog_monitor.memory_frag.id}" + value = "${datadog_monitor.memory_frag.*.id}" } output "rejected_connections_id" { description = "id for monitor rejected_connections" - value = "${datadog_monitor.rejected_connections.id}" + value = "${datadog_monitor.rejected_connections.*.id}" } output "latency_id" { description = "id for monitor latency" - value = "${datadog_monitor.latency.id}" + value = "${datadog_monitor.latency.*.id}" } output "hitrate_id" { description = "id for monitor hitrate" - value = "${datadog_monitor.hitrate.id}" + value = "${datadog_monitor.hitrate.*.id}" } output "not_responding_id" { description = "id for monitor not_responding" - value = "${datadog_monitor.not_responding.id}" + value = "${datadog_monitor.not_responding.*.id}" } diff --git a/middleware/apache/README.md b/middleware/apache/README.md index 5889438..37f9ccd 100644 --- a/middleware/apache/README.md +++ b/middleware/apache/README.md @@ -22,6 +22,7 @@ Creates DataDog monitors with the following checks: | Name | Description | Type | Default | Required | |------|-------------|:----:|:-----:|:-----:| +| apache_connect_enabled | Flag to enable Apache status monitor | string | `true` | no | | apache_connect_extra_tags | Extra tags for Apache process monitor | list | `` | no | | apache_connect_message | Custom message for Apache status monitor | string | `` | no | | apache_connect_silenced | Groups to mute for Apache status monitor | map | `` | no | diff --git a/middleware/apache/inputs.tf b/middleware/apache/inputs.tf index 59ab8fb..0a65c92 100644 --- a/middleware/apache/inputs.tf +++ b/middleware/apache/inputs.tf @@ -37,6 +37,12 @@ variable "apache_connect_silenced" { default = {} } +variable "apache_connect_enabled" { + description = "Flag to enable Apache status monitor" + type = "string" + default = "true" +} + variable "apache_connect_extra_tags" { description = "Extra tags for Apache process monitor" type = "list" diff --git a/middleware/apache/monitors-apache.tf b/middleware/apache/monitors-apache.tf index eab994d..1d8a857 100644 --- a/middleware/apache/monitors-apache.tf +++ b/middleware/apache/monitors-apache.tf @@ -1,4 +1,5 @@ resource "datadog_monitor" "datadog_apache_process" { + count = "${var.apache_connect_enabled ? 1 : 0}" name = "[${var.environment}] Apache vhost status does not respond" message = "${coalesce(var.apache_connect_message, var.message)}" diff --git a/middleware/apache/outputs.tf b/middleware/apache/outputs.tf index 888204e..1d5c06c 100644 --- a/middleware/apache/outputs.tf +++ b/middleware/apache/outputs.tf @@ -1,4 +1,4 @@ output "datadog_apache_process_id" { description = "id for monitor datadog_apache_process" - value = "${datadog_monitor.datadog_apache_process.id}" + value = "${datadog_monitor.datadog_apache_process.*.id}" } diff --git a/middleware/nginx/README.md b/middleware/nginx/README.md index 8cb6bf2..6b59e94 100644 --- a/middleware/nginx/README.md +++ b/middleware/nginx/README.md @@ -28,6 +28,7 @@ Creates DataDog monitors with the following checks: | filter_tags_use_defaults | Use default filter tags convention | string | `true` | no | | message | Message sent when an alert is triggered | string | - | yes | | new_host_delay | Delay in seconds before monitor new resource | string | `300` | no | +| nginx_connect_enabled | Flag to enable Nginx status monitor | string | `true` | no | | nginx_connect_extra_tags | Extra tags for Nginx process monitor | list | `` | no | | nginx_connect_message | Custom message for Nginx status monitor | string | `` | no | | nginx_connect_silenced | Groups to mute for Nginx status monitor | map | `` | no | diff --git a/middleware/nginx/inputs.tf b/middleware/nginx/inputs.tf index 4c76c37..a8680d6 100644 --- a/middleware/nginx/inputs.tf +++ b/middleware/nginx/inputs.tf @@ -37,6 +37,12 @@ variable "nginx_connect_silenced" { default = {} } +variable "nginx_connect_enabled" { + description = "Flag to enable Nginx status monitor" + type = "string" + default = "true" +} + variable "nginx_connect_extra_tags" { description = "Extra tags for Nginx process monitor" type = "list" diff --git a/middleware/nginx/monitors-nginx.tf b/middleware/nginx/monitors-nginx.tf index 136a1d5..8776db7 100644 --- a/middleware/nginx/monitors-nginx.tf +++ b/middleware/nginx/monitors-nginx.tf @@ -1,4 +1,5 @@ resource "datadog_monitor" "datadog_nginx_process" { + count = "${var.nginx_connect_enabled ? 1 : 0}" name = "[${var.environment}] Nginx vhost status does not respond" message = "${coalesce(var.nginx_connect_message, var.message)}" diff --git a/middleware/nginx/outputs.tf b/middleware/nginx/outputs.tf index 10aae9e..f533cec 100644 --- a/middleware/nginx/outputs.tf +++ b/middleware/nginx/outputs.tf @@ -1,4 +1,4 @@ output "datadog_nginx_process_id" { description = "id for monitor datadog_nginx_process" - value = "${datadog_monitor.datadog_nginx_process.id}" + value = "${datadog_monitor.datadog_nginx_process.*.id}" } diff --git a/middleware/php-fpm/README.md b/middleware/php-fpm/README.md index 439c93d..d280c84 100644 --- a/middleware/php-fpm/README.md +++ b/middleware/php-fpm/README.md @@ -29,6 +29,7 @@ Creates DataDog monitors with the following checks: | filter_tags_use_defaults | Use default filter tags convention | string | `true` | no | | message | Message sent when an alert is triggered | string | - | yes | | new_host_delay | Delay in seconds before monitor new resource | string | `300` | no | +| php_fpm_busy_enabled | Flag to enable PHP FPM busy worker monitor | string | `true` | no | | php_fpm_busy_extra_tags | Extra tags for PHP FPM busy worker monitor | list | `` | no | | php_fpm_busy_message | Custom message for PHP FPM busy worker monitor | string | `` | no | | php_fpm_busy_silenced | Groups to mute for PHP FPM busy worker monitor | map | `` | no | @@ -36,6 +37,7 @@ Creates DataDog monitors with the following checks: | php_fpm_busy_threshold_warning | php fpm busy warning threshold | string | `0.8` | no | | php_fpm_busy_time_aggregator | Monitor aggregator for PHP FPM busy worker [available values: min, max or avg] | string | `avg` | no | | php_fpm_busy_timeframe | Monitor timeframe for PHP FPM busy worker [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_10m` | no | +| php_fpm_connect_enabled | Flag to enable PHP FPM process monitor | string | `true` | no | | php_fpm_connect_extra_tags | Extra tags for PHP FPM process monitor | list | `` | no | | php_fpm_connect_message | Custom message for PHP FPM process monitor | string | `` | no | | php_fpm_connect_silenced | Groups to mute for PHP FPM process monitor | map | `` | no | diff --git a/middleware/php-fpm/inputs.tf b/middleware/php-fpm/inputs.tf index 2c0d8e6..0650e83 100644 --- a/middleware/php-fpm/inputs.tf +++ b/middleware/php-fpm/inputs.tf @@ -37,6 +37,12 @@ variable "php_fpm_busy_silenced" { default = {} } +variable "php_fpm_busy_enabled" { + description = "Flag to enable PHP FPM busy worker monitor" + type = "string" + default = "true" +} + variable "php_fpm_busy_extra_tags" { description = "Extra tags for PHP FPM busy worker monitor" type = "list" @@ -77,6 +83,12 @@ variable "php_fpm_connect_silenced" { default = {} } +variable "php_fpm_connect_enabled" { + description = "Flag to enable PHP FPM process monitor" + type = "string" + default = "true" +} + variable "php_fpm_connect_extra_tags" { description = "Extra tags for PHP FPM process monitor" type = "list" diff --git a/middleware/php-fpm/monitors-fpm.tf b/middleware/php-fpm/monitors-fpm.tf index cc7ff6f..0b1e0a1 100644 --- a/middleware/php-fpm/monitors-fpm.tf +++ b/middleware/php-fpm/monitors-fpm.tf @@ -1,4 +1,5 @@ resource "datadog_monitor" "datadog_php_fpm_connect_idle" { + count = "${var.php_fpm_busy_enabled ? 1 : 0}" name = "[${var.environment}] Php-fpm busy worker {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.php_fpm_busy_message, var.message)}" @@ -32,6 +33,7 @@ resource "datadog_monitor" "datadog_php_fpm_connect_idle" { } resource "datadog_monitor" "datadog_fpm_process" { + count = "${var.php_fpm_connect_enabled ? 1 : 0}" name = "[${var.environment}] Php-fpm ping url does not respond" message = "${coalesce(var.php_fpm_connect_message, var.message)}" diff --git a/middleware/php-fpm/outputs.tf b/middleware/php-fpm/outputs.tf index 675858d..53cdd1a 100644 --- a/middleware/php-fpm/outputs.tf +++ b/middleware/php-fpm/outputs.tf @@ -1,9 +1,9 @@ output "datadog_php_fpm_connect_idle_id" { description = "id for monitor datadog_php_fpm_connect_idle" - value = "${datadog_monitor.datadog_php_fpm_connect_idle.id}" + value = "${datadog_monitor.datadog_php_fpm_connect_idle.*.id}" } output "datadog_fpm_process_id" { description = "id for monitor datadog_fpm_process" - value = "${datadog_monitor.datadog_fpm_process.id}" + value = "${datadog_monitor.datadog_fpm_process.*.id}" } diff --git a/scripts/01_update_output.sh b/scripts/01_update_output.sh index 70ee7e5..7033e05 100755 --- a/scripts/01_update_output.sh +++ b/scripts/01_update_output.sh @@ -12,7 +12,7 @@ for path in $(find "$(get_scope $1)" -path ./incubator -prune -o -name 'monitors cat >> outputs.tf <` | no | | cpu_high_message | Custom message for CPU high monitor | string | `` | no | | cpu_high_silenced | Groups to mute for CPU high monitor | map | `` | no | @@ -35,6 +36,7 @@ Creates DataDog monitors with the following checks: | cpu_high_threshold_warning | CPU high warning threshold | string | `85` | no | | cpu_high_time_aggregator | Monitor aggregator for CPU high [available values: min, max or avg] | string | `min` | no | | cpu_high_timeframe | Monitor timeframe for CPU high [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_10m` | no | +| cpu_load_enabled | Flag to enable CPU load ratio monitor | string | `true` | no | | cpu_load_extra_tags | Extra tags for CPU load ratio monitor | list | `` | no | | cpu_load_message | Custom message for CPU load ratio monitor | string | `` | no | | cpu_load_silenced | Groups to mute for CPU load ratio monitor | map | `` | no | @@ -46,6 +48,7 @@ Creates DataDog monitors with the following checks: | evaluation_delay | Delay in seconds for the metric evaluation | string | `15` | no | | filter_tags_custom | Tags used for custom filtering when filter_tags_use_defaults is false | string | `*` | no | | filter_tags_use_defaults | Use default filter tags convention | string | `true` | no | +| free_disk_inodes_enabled | Flag to enable Free disk inodes monitor | string | `true` | no | | free_disk_inodes_extra_tags | Extra tags for Free disk inodes monitor | list | `` | no | | free_disk_inodes_message | Custom message for Free disk inodes monitor | string | `` | no | | free_disk_inodes_silenced | Groups to mute for Free disk inodes monitor | map | `` | no | @@ -53,9 +56,11 @@ Creates DataDog monitors with the following checks: | free_disk_inodes_threshold_warning | Free disk space warning threshold | string | `10` | no | | free_disk_inodes_time_aggregator | Monitor aggregator for Free disk inodes [available values: min, max or avg] | string | `min` | no | | free_disk_inodes_timeframe | Monitor timeframe for Free disk inodes [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | +| free_disk_space_enabled | Flag to enable Free diskspace monitor | string | `true` | no | | free_disk_space_extra_tags | Extra tags for Free diskspace monitor | list | `` | no | | free_disk_space_forecast_algorithm | Algorithm for the Free diskspace Forecast monitor [available values: `linear` or `seasonal`] | string | `linear` | no | | free_disk_space_forecast_deviations | Deviations for the Free diskspace Forecast monitor [available values: `1`, `2`, `3`, `4` or `5`] | string | `1` | no | +| free_disk_space_forecast_enabled | Flag to enable Free diskspace forecast monitor | string | `true` | no | | free_disk_space_forecast_extra_tags | Extra tags for Free diskspace forecast monitor | list | `` | no | | free_disk_space_forecast_interval | Interval for the Free diskspace Forecast monitor [available values: `30m`, `60m` or `120m`] | string | `60m` | no | | free_disk_space_forecast_linear_history | History for the Free diskspace Forecast monitor [available values: `12h`, `#d` (1, 2, or 3), `#w` (1, or 2) or `#mo` (1, 2 or 3)] | string | `1w` | no | @@ -73,6 +78,7 @@ Creates DataDog monitors with the following checks: | free_disk_space_threshold_warning | Free disk space warning threshold | string | `20` | no | | free_disk_space_time_aggregator | Monitor aggregator for Free diskspace [available values: min, max or avg] | string | `min` | no | | free_disk_space_timeframe | Monitor timeframe for Free diskspace [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | +| free_memory_enabled | Flag to enable Free memory monitor | string | `true` | no | | free_memory_extra_tags | Extra tags for Free memory monitor | list | `` | no | | free_memory_message | Custom message for Free memory monitor | string | - | yes | | free_memory_silenced | Groups to mute for Free memory monitor | map | `` | no | @@ -82,6 +88,7 @@ Creates DataDog monitors with the following checks: | free_memory_timeframe | Monitor timeframe for Free memory [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | | message | Message sent when an alert is triggered | string | - | yes | | new_host_delay | Delay in seconds before monitor new resource | string | `300` | no | +| unreachable_enabled | Flag to enable Host unreachable monitor | string | `true` | no | | unreachable_extra_tags | Extra tags for Host unreachable monitor | list | `` | no | | unreachable_message | Custom message for Host unreachable monitor | string | `` | no | | unreachable_no_data_timeframe | Timeframe for Host unreachable monitor to alert on no data | string | `2` | no | diff --git a/system/generic/inputs.tf b/system/generic/inputs.tf index 20fd531..3971434 100644 --- a/system/generic/inputs.tf +++ b/system/generic/inputs.tf @@ -37,6 +37,12 @@ variable "unreachable_silenced" { default = {} } +variable "unreachable_enabled" { + description = "Flag to enable Host unreachable monitor" + type = "string" + default = "true" +} + variable "unreachable_extra_tags" { description = "Extra tags for Host unreachable monitor" type = "list" @@ -61,6 +67,12 @@ variable "cpu_high_silenced" { default = {} } +variable "cpu_high_enabled" { + description = "Flag to enable CPU high monitor" + type = "string" + default = "true" +} + variable "cpu_high_extra_tags" { description = "Extra tags for CPU high monitor" type = "list" @@ -101,6 +113,12 @@ variable "cpu_load_silenced" { default = {} } +variable "cpu_load_enabled" { + description = "Flag to enable CPU load ratio monitor" + type = "string" + default = "true" +} + variable "cpu_load_extra_tags" { description = "Extra tags for CPU load ratio monitor" type = "list" @@ -141,6 +159,12 @@ variable "free_disk_space_silenced" { default = {} } +variable "free_disk_space_enabled" { + description = "Flag to enable Free diskspace monitor" + type = "string" + default = "true" +} + variable "free_disk_space_extra_tags" { description = "Extra tags for Free diskspace monitor" type = "list" @@ -181,6 +205,12 @@ variable "free_disk_space_forecast_silenced" { default = {} } +variable "free_disk_space_forecast_enabled" { + description = "Flag to enable Free diskspace forecast monitor" + type = "string" + default = "true" +} + variable "free_disk_space_forecast_extra_tags" { description = "Extra tags for Free diskspace forecast monitor" type = "list" @@ -257,6 +287,12 @@ variable "free_disk_inodes_silenced" { default = {} } +variable "free_disk_inodes_enabled" { + description = "Flag to enable Free disk inodes monitor" + type = "string" + default = "true" +} + variable "free_disk_inodes_extra_tags" { description = "Extra tags for Free disk inodes monitor" type = "list" @@ -297,6 +333,12 @@ variable "free_memory_silenced" { default = {} } +variable "free_memory_enabled" { + description = "Flag to enable Free memory monitor" + type = "string" + default = "true" +} + variable "free_memory_extra_tags" { description = "Extra tags for Free memory monitor" type = "list" diff --git a/system/generic/monitors-system.tf b/system/generic/monitors-system.tf index ecbe419..d5991c5 100644 --- a/system/generic/monitors-system.tf +++ b/system/generic/monitors-system.tf @@ -1,4 +1,5 @@ resource "datadog_monitor" "datadog_host_unreachable" { + count = "${var.unreachable_enabled ? 1 : 0}" name = "[${var.environment}] Host unreachable" message = "${coalesce(var.unreachable_message, var.message)}" @@ -27,6 +28,7 @@ resource "datadog_monitor" "datadog_host_unreachable" { } resource "datadog_monitor" "datadog_cpu_too_high" { + count = "${var.cpu_high_enabled ? 1 : 0}" name = "[${var.environment}] CPU usage {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.cpu_high_message, var.message)}" @@ -58,6 +60,7 @@ resource "datadog_monitor" "datadog_cpu_too_high" { } resource "datadog_monitor" "datadog_load_too_high" { + count = "${var.cpu_load_enabled ? 1 : 0}" name = "[${var.environment}] CPU load 5 {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.cpu_load_message, var.message)}" @@ -90,6 +93,7 @@ resource "datadog_monitor" "datadog_load_too_high" { } resource "datadog_monitor" "datadog_free_disk_space_too_low" { + count = "${var.free_disk_space_enabled ? 1 : 0}" name = "[${var.environment}] Free disk space {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.free_disk_space_message, var.message)}" @@ -122,6 +126,7 @@ resource "datadog_monitor" "datadog_free_disk_space_too_low" { } resource "datadog_monitor" "datadog_free_disk_space_forecast" { + count = "${var.free_disk_space_forecast_enabled ? 1 : 0}" name = "[${var.environment}] Disk Space could reach {{#is_alert}}{{threshold}}%{{/is_alert}} in a near future" message = "${coalesce(var.free_disk_space_forecast_message, var.message)}" @@ -161,6 +166,7 @@ resource "datadog_monitor" "datadog_free_disk_space_forecast" { } resource "datadog_monitor" "datadog_free_disk_space_inodes_too_low" { + count = "${var.free_disk_inodes_enabled ? 1 : 0}" name = "[${var.environment}] Free disk inodes {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.free_disk_inodes_message, var.message)}" @@ -193,6 +199,7 @@ resource "datadog_monitor" "datadog_free_disk_space_inodes_too_low" { } resource "datadog_monitor" "datadog_free_memory" { + count = "${var.free_memory_enabled ? 1 : 0}" name = "[${var.environment}] Free memory {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${var.free_memory_message}" diff --git a/system/generic/outputs.tf b/system/generic/outputs.tf index e870cda..b25c2bf 100644 --- a/system/generic/outputs.tf +++ b/system/generic/outputs.tf @@ -1,34 +1,34 @@ output "datadog_host_unreachable_id" { description = "id for monitor datadog_host_unreachable" - value = "${datadog_monitor.datadog_host_unreachable.id}" + value = "${datadog_monitor.datadog_host_unreachable.*.id}" } output "datadog_cpu_too_high_id" { description = "id for monitor datadog_cpu_too_high" - value = "${datadog_monitor.datadog_cpu_too_high.id}" + value = "${datadog_monitor.datadog_cpu_too_high.*.id}" } output "datadog_load_too_high_id" { description = "id for monitor datadog_load_too_high" - value = "${datadog_monitor.datadog_load_too_high.id}" + value = "${datadog_monitor.datadog_load_too_high.*.id}" } output "datadog_free_disk_space_too_low_id" { description = "id for monitor datadog_free_disk_space_too_low" - value = "${datadog_monitor.datadog_free_disk_space_too_low.id}" + value = "${datadog_monitor.datadog_free_disk_space_too_low.*.id}" } output "datadog_free_disk_space_forecast_id" { description = "id for monitor datadog_free_disk_space_forecast" - value = "${datadog_monitor.datadog_free_disk_space_forecast.id}" + value = "${datadog_monitor.datadog_free_disk_space_forecast.*.id}" } output "datadog_free_disk_space_inodes_too_low_id" { description = "id for monitor datadog_free_disk_space_inodes_too_low" - value = "${datadog_monitor.datadog_free_disk_space_inodes_too_low.id}" + value = "${datadog_monitor.datadog_free_disk_space_inodes_too_low.*.id}" } output "datadog_free_memory_id" { description = "id for monitor datadog_free_memory" - value = "${datadog_monitor.datadog_free_memory.id}" + value = "${datadog_monitor.datadog_free_memory.*.id}" }