diff --git a/cloud/azure/iothubs/README.md b/cloud/azure/iothubs/README.md index 362e226..339b357 100644 --- a/cloud/azure/iothubs/README.md +++ b/cloud/azure/iothubs/README.md @@ -1,5 +1,5 @@ Azure IOT Hubs DataDog monitors -============================ +=============================== How to use this module ---------------------- @@ -39,36 +39,37 @@ Inputs | Name | Description | Type | Default | Required | |------|-------------|:----:|:-----:|:-----:| -| c2d_methods_failed_threshold_critical | C2D Methods Failed rate limit (critical threshold) | string | `10` | no | -| c2d_methods_failed_threshold_warning | C2D Methods Failed rate limit (warning threshold) | string | `0` | no | -| c2d_twin_read_failed_threshold_critical | C2D Twin Read Failed rate limit (critical threshold) | string | `10` | no | -| c2d_twin_read_failed_threshold_warning | C2D Twin Read Failed rate limit (warning threshold) | string | `0` | no | -| c2d_twin_update_failed_threshold_critical | C2D Twin Update Failed rate limit (critical threshold) | string | `10` | no | -| c2d_twin_update_failed_threshold_warning | C2D Twin Update Failed rate limit (warning threshold) | string | `0` | no | -| d2c_telemetry_egress_dropped_threshold_critical | D2C Telemetry Dropped Failed limit (critical threshold) | string | `1000` | no | -| d2c_telemetry_egress_dropped_threshold_warning | D2C Telemetry Dropped Failed limit (warning threshold) | string | `500` | no | -| d2c_telemetry_egress_fallback_threshold_critical | D2C Telemetry Fallback Failed limit (critical threshold) | string | `1000` | no | -| d2c_telemetry_egress_fallback_threshold_warning | D2C Telemetry Fallback Failed limit (warning threshold) | string | `500` | no | -| d2c_telemetry_egress_invalid_threshold_critical | D2C Telemetry Invalid Failed limit (critical threshold) | string | `1000` | no | -| d2c_telemetry_egress_invalid_threshold_warning | D2C Telemetry Invalid Failed limit (warning threshold) | string | `500` | no | -| d2c_telemetry_egress_orphaned_threshold_critical | D2C Telemetry Orphaned Failed limit (critical threshold) | string | `1000` | no | -| d2c_telemetry_egress_orphaned_threshold_warning | D2C Telemetry Orphaned Failed limit (warning threshold) | string | `500` | no | -| d2c_twin_read_failed_threshold_critical | D2C Twin Read Failed rate limit (critical threshold) | string | `10` | no | -| d2c_twin_read_failed_threshold_warning | D2C Twin Read Failed rate limit (warning threshold) | string | `0` | no | -| d2c_twin_update_failed_threshold_critical | D2C Twin Update Failed rate limit (critical threshold) | string | `10` | no | -| d2c_twin_update_failed_threshold_warning | D2C Twin Update Failed rate limit (warning threshold) | string | `0` | no | | delay | Delay in seconds for the metric evaluation | string | `600` | no | +| dropped_d2c_telemetry_egress_threshold_critical | D2C Telemetry Dropped limit (critical threshold) | string | `1000` | no | +| dropped_d2c_telemetry_egress_threshold_warning | D2C Telemetry Dropped limit (warning threshold) | string | `500` | no | | environment | Architecture Environment | string | - | yes | -| jobs_failed_threshold_critical | Jobs Failed rate limit (critical threshold) | string | `10` | no | -| jobs_failed_threshold_warning | Jobs Failed rate limit (warning threshold) | string | `0` | no | -| listjobs_failed_threshold_critical | ListJobs Failed rate limit (critical threshold) | string | `10` | no | -| listjobs_failed_threshold_warning | ListJobs Failed rate limit (warning threshold) | string | `0` | no | +| failed_c2d_methods_rate_threshold_critical | C2D Methods Failed rate limit (critical threshold) | string | `10` | no | +| failed_c2d_methods_rate_threshold_warning | C2D Methods Failed rate limit (warning threshold) | string | `0` | no | +| failed_c2d_twin_read_rate_threshold_critical | C2D Twin Read Failed rate limit (critical threshold) | string | `10` | no | +| failed_c2d_twin_read_rate_threshold_warning | C2D Twin Read Failed rate limit (warning threshold) | string | `0` | no | +| failed_c2d_twin_update_rate_threshold_critical | C2D Twin Update Failed rate limit (critical threshold) | string | `10` | no | +| failed_c2d_twin_update_rate_threshold_warning | C2D Twin Update Failed rate limit (warning threshold) | string | `0` | no | +| failed_d2c_twin_read_rate_threshold_critical | D2C Twin Read Failed rate limit (critical threshold) | string | `10` | no | +| failed_d2c_twin_read_rate_threshold_warning | D2C Twin Read Failed rate limit (warning threshold) | string | `0` | no | +| failed_d2c_twin_update_rate_threshold_critical | D2C Twin Update Failed rate limit (critical threshold) | string | `10` | no | +| failed_d2c_twin_update_rate_threshold_warning | D2C Twin Update Failed rate limit (warning threshold) | string | `0` | no | +| failed_jobs_rate_threshold_critical | Jobs Failed rate limit (critical threshold) | string | `10` | no | +| failed_jobs_rate_threshold_warning | Jobs Failed rate limit (warning threshold) | string | `0` | no | +| failed_listjobs_rate_threshold_critical | ListJobs Failed rate limit (critical threshold) | string | `10` | no | +| failed_listjobs_rate_threshold_warning | ListJobs Failed rate limit (warning threshold) | string | `0` | no | +| failed_queryjobs_rate_threshold_critical | QueryJobs Failed rate limit (critical threshold) | string | `10` | no | +| failed_queryjobs_rate_threshold_warning | QueryJobs Failed rate limit (warning threshold) | string | `0` | no | +| fallback_d2c_telemetry_egress_threshold_critical | D2C Telemetry Fallback limit (critical threshold) | string | `1000` | no | +| fallback_d2c_telemetry_egress_threshold_warning | D2C Telemetry Fallback limit (warning threshold) | string | `500` | no | +| invalid_d2c_telemetry_egress_threshold_critical | D2C Telemetry Invalid limit (critical threshold) | string | `1000` | no | +| invalid_d2c_telemetry_egress_threshold_warning | D2C Telemetry Invalid limit (warning threshold) | string | `500` | no | | message | Message sent when an alert is triggered | string | - | yes | -| provider | What is the monitored provider | string | azure | no | -| queryjobs_failed_threshold_critical | QueryJobs Failed rate limit (critical threshold) | string | `10` | no | -| queryjobs_failed_threshold_warning | QueryJobs Failed rate limit (warning threshold) | string | `0` | no | -| service | What is the monitored service | string | storage | no | -| subscription_id | Subscription ID used to tag monitors | string | - | yes | +| orphaned_d2c_telemetry_egress_threshold_critical | D2C Telemetry Orphaned limit (critical threshold) | string | `1000` | no | +| orphaned_d2c_telemetry_egress_threshold_warning | D2C Telemetry Orphaned limit (warning threshold) | string | `500` | no | +| provider | Cloud provider which the monitor and its based metric depend on | string | `azure` | no | +| service | Service monitored by this set of monitors | string | `storage` | no | +| subscription_id | Azure account id used as filter for monitors | string | - | yes | +| use_filter_tags | Filter the data with service tags if true | string | `true` | no | Related documentation --------------------- diff --git a/cloud/azure/iothubs/inputs.tf b/cloud/azure/iothubs/inputs.tf index 1efabc3..01c77fb 100644 --- a/cloud/azure/iothubs/inputs.tf +++ b/cloud/azure/iothubs/inputs.tf @@ -6,24 +6,25 @@ variable "environment" { variable "subscription_id" { description = "Azure account id used as filter for monitors" - type = "string" + type = "string" } variable "provider" { description = "Cloud provider which the monitor and its based metric depend on" - type = "string" - default = "azure" + type = "string" + default = "azure" } variable "service" { description = "Service monitored by this set of monitors" - type = "string" - default = "storage" + type = "string" + default = "storage" +} # Global DataDog variable "delay" { description = "Delay in seconds for the metric evaluation" - default = 600 + default = 600 } variable "message" { @@ -36,122 +37,122 @@ variable "use_filter_tags" { } # Azure IOT hubs specific -variable "jobs_failed_threshold_warning" { +variable "failed_jobs_rate_threshold_warning" { description = "Jobs Failed rate limit (warning threshold)" - default = 0 + default = 0 } -variable "jobs_failed_threshold_critical" { +variable "failed_jobs_rate_threshold_critical" { description = "Jobs Failed rate limit (critical threshold)" - default = 10 + default = 10 } -variable "listjobs_failed_threshold_warning" { +variable "failed_listjobs_rate_threshold_warning" { description = "ListJobs Failed rate limit (warning threshold)" - default = 0 + default = 0 } -variable "listjobs_failed_threshold_critical" { +variable "failed_listjobs_rate_threshold_critical" { description = "ListJobs Failed rate limit (critical threshold)" - default = 10 + default = 10 } -variable "queryjobs_failed_threshold_warning" { +variable "failed_queryjobs_rate_threshold_warning" { description = "QueryJobs Failed rate limit (warning threshold)" - default = 0 + default = 0 } -variable "queryjobs_failed_threshold_critical" { +variable "failed_queryjobs_rate_threshold_critical" { description = "QueryJobs Failed rate limit (critical threshold)" - default = 10 + default = 10 } -variable "c2d_methods_failed_threshold_warning" { +variable "failed_c2d_methods_rate_threshold_warning" { description = "C2D Methods Failed rate limit (warning threshold)" - default = 0 + default = 0 } -variable "c2d_methods_failed_threshold_critical" { +variable "failed_c2d_methods_rate_threshold_critical" { description = "C2D Methods Failed rate limit (critical threshold)" - default = 10 + default = 10 } -variable "c2d_twin_read_failed_threshold_warning" { +variable "failed_c2d_twin_read_rate_threshold_warning" { description = "C2D Twin Read Failed rate limit (warning threshold)" - default = 0 + default = 0 } -variable "c2d_twin_read_failed_threshold_critical" { +variable "failed_c2d_twin_read_rate_threshold_critical" { description = "C2D Twin Read Failed rate limit (critical threshold)" - default = 10 + default = 10 } -variable "c2d_twin_update_failed_threshold_warning" { +variable "failed_c2d_twin_update_rate_threshold_warning" { description = "C2D Twin Update Failed rate limit (warning threshold)" - default = 0 + default = 0 } -variable "c2d_twin_update_failed_threshold_critical" { +variable "failed_c2d_twin_update_rate_threshold_critical" { description = "C2D Twin Update Failed rate limit (critical threshold)" - default = 10 + default = 10 } -variable "d2c_twin_read_failed_threshold_warning" { +variable "failed_d2c_twin_read_rate_threshold_warning" { description = "D2C Twin Read Failed rate limit (warning threshold)" - default = 0 + default = 0 } -variable "d2c_twin_read_failed_threshold_critical" { +variable "failed_d2c_twin_read_rate_threshold_critical" { description = "D2C Twin Read Failed rate limit (critical threshold)" - default = 10 + default = 10 } -variable "d2c_twin_update_failed_threshold_warning" { +variable "failed_d2c_twin_update_rate_threshold_warning" { description = "D2C Twin Update Failed rate limit (warning threshold)" - default = 0 + default = 0 } -variable "d2c_twin_update_failed_threshold_critical" { +variable "failed_d2c_twin_update_rate_threshold_critical" { description = "D2C Twin Update Failed rate limit (critical threshold)" - default = 10 + default = 10 } -variable "d2c_telemetry_egress_dropped_threshold_warning" { - description = "D2C Telemetry Dropped Failed limit (warning threshold)" - default = 500 +variable "dropped_d2c_telemetry_egress_threshold_warning" { + description = "D2C Telemetry Dropped limit (warning threshold)" + default = 500 } -variable "d2c_telemetry_egress_dropped_threshold_critical" { - description = "D2C Telemetry Dropped Failed limit (critical threshold)" - default = 1000 +variable "dropped_d2c_telemetry_egress_threshold_critical" { + description = "D2C Telemetry Dropped limit (critical threshold)" + default = 1000 } -variable "d2c_telemetry_egress_orphaned_threshold_warning" { - description = "D2C Telemetry Orphaned Failed limit (warning threshold)" - default = 500 +variable "orphaned_d2c_telemetry_egress_threshold_warning" { + description = "D2C Telemetry Orphaned limit (warning threshold)" + default = 500 } -variable "d2c_telemetry_egress_orphaned_threshold_critical" { - description = "D2C Telemetry Orphaned Failed limit (critical threshold)" - default = 1000 +variable "orphaned_d2c_telemetry_egress_threshold_critical" { + description = "D2C Telemetry Orphaned limit (critical threshold)" + default = 1000 } -variable "d2c_telemetry_egress_invalid_threshold_warning" { - description = "D2C Telemetry Invalid Failed limit (warning threshold)" - default = 500 +variable "invalid_d2c_telemetry_egress_threshold_warning" { + description = "D2C Telemetry Invalid limit (warning threshold)" + default = 500 } -variable "d2c_telemetry_egress_invalid_threshold_critical" { - description = "D2C Telemetry Invalid Failed limit (critical threshold)" - default = 1000 +variable "invalid_d2c_telemetry_egress_threshold_critical" { + description = "D2C Telemetry Invalid limit (critical threshold)" + default = 1000 } -variable "d2c_telemetry_egress_fallback_threshold_warning" { - description = "D2C Telemetry Fallback Failed limit (warning threshold)" - default = 500 +variable "fallback_d2c_telemetry_egress_threshold_warning" { + description = "D2C Telemetry Fallback limit (warning threshold)" + default = 500 } -variable "d2c_telemetry_egress_fallback_threshold_critical" { - description = "D2C Telemetry Fallback Failed limit (critical threshold)" - default = 1000 +variable "fallback_d2c_telemetry_egress_threshold_critical" { + description = "D2C Telemetry Fallback limit (critical threshold)" + default = 1000 } diff --git a/cloud/azure/iothubs/monitors-iothubs.tf b/cloud/azure/iothubs/monitors-iothubs.tf index 4398f5f..d7fb7e3 100644 --- a/cloud/azure/iothubs/monitors-iothubs.tf +++ b/cloud/azure/iothubs/monitors-iothubs.tf @@ -15,13 +15,14 @@ resource "datadog_monitor" "too_many_jobs_failed" { avg:azure.devices_iothubs.jobs.failed{${data.template_file.filter.rendered}} by {name,resource_group}.as_count() / ( avg:azure.devices_iothubs.jobs.failed{${data.template_file.filter.rendered}} by {name,resource_group}.as_count() + avg:azure.devices_iothubs.jobs.completed{${data.template_file.filter.rendered}} by {name,resource_group}.as_count() ) - ) * 100 > ${var.jobs_failed_threshold_critical} + ) * 100 > ${var.failed_jobs_rate_threshold_critical} EOF - type = "query alert" + + type = "query alert" thresholds { - warning = "${var.jobs_failed_threshold_warning}" - critical = "${var.jobs_failed_threshold_critical}" + warning = "${var.failed_jobs_rate_threshold_warning}" + critical = "${var.failed_jobs_rate_threshold_critical}" } notify_no_data = false @@ -35,7 +36,7 @@ resource "datadog_monitor" "too_many_jobs_failed" { new_host_delay = "${var.delay}" no_data_timeframe = 20 - tags = ["env:${var.environment}","resource:${var.service}","team:${var.provider}"] + tags = ["env:${var.environment}", "resource:${var.service}", "team:${var.provider}"] } resource "datadog_monitor" "too_many_list_jobs_failed" { @@ -47,13 +48,14 @@ resource "datadog_monitor" "too_many_list_jobs_failed" { avg:azure.devices_iothubs.jobs.list_jobs.failure{${data.template_file.filter.rendered}} by {resource_group,name}.as_count() / ( avg:azure.devices_iothubs.jobs.list_jobs.success{${data.template_file.filter.rendered}} by {resource_group,name}.as_count() + avg:azure.devices_iothubs.jobs.list_jobs.failure{${data.template_file.filter.rendered}} by {resource_group,name}.as_count() ) - ) * 100 > ${var.listjobs_failed_threshold_critical} + ) * 100 > ${var.failed_listjobs_rate_threshold_critical} EOF - type = "query alert" + + type = "query alert" thresholds { - warning = "${var.listjobs_failed_threshold_warning}" - critical = "${var.listjobs_failed_threshold_critical}" + warning = "${var.failed_listjobs_rate_threshold_warning}" + critical = "${var.failed_listjobs_rate_threshold_critical}" } notify_no_data = false @@ -67,7 +69,7 @@ resource "datadog_monitor" "too_many_list_jobs_failed" { new_host_delay = "${var.delay}" no_data_timeframe = 20 - tags = ["env:${var.environment}","resource:${var.service}","team:${var.provider}"] + tags = ["env:${var.environment}", "resource:${var.service}", "team:${var.provider}"] } resource "datadog_monitor" "too_many_query_jobs_failed" { @@ -79,13 +81,14 @@ resource "datadog_monitor" "too_many_query_jobs_failed" { avg:azure.devices_iothubs.jobs.query_jobs.failure{${data.template_file.filter.rendered}} by {resource_group,name}.as_count() / ( avg:azure.devices_iothubs.jobs.query_jobs.success{${data.template_file.filter.rendered}} by {resource_group,name}.as_count() + avg:azure.devices_iothubs.jobs.query_jobs.failure{${data.template_file.filter.rendered}} by {resource_group,name}.as_count() ) - ) * 100 > ${var.queryjobs_failed_threshold_critical} + ) * 100 > ${var.failed_queryjobs_rate_threshold_critical} EOF - type = "query alert" + + type = "query alert" thresholds { - warning = "${var.queryjobs_failed_threshold_warning}" - critical = "${var.queryjobs_failed_threshold_critical}" + warning = "${var.failed_queryjobs_rate_threshold_warning}" + critical = "${var.failed_queryjobs_rate_threshold_critical}" } notify_no_data = false @@ -99,7 +102,7 @@ resource "datadog_monitor" "too_many_query_jobs_failed" { new_host_delay = "${var.delay}" no_data_timeframe = 20 - tags = ["env:${var.environment}","resource:${var.service}","team:${var.provider}"] + tags = ["env:${var.environment}", "resource:${var.service}", "team:${var.provider}"] } resource "datadog_monitor" "status" { @@ -109,7 +112,8 @@ resource "datadog_monitor" "status" { query = < ${var.c2d_methods_failed_threshold_critical} + ) * 100 > ${var.failed_c2d_methods_rate_threshold_critical} EOF - type = "query alert" + + type = "query alert" thresholds { - warning = "${var.c2d_methods_failed_threshold_warning}" - critical = "${var.c2d_methods_failed_threshold_critical}" + warning = "${var.failed_c2d_methods_rate_threshold_warning}" + critical = "${var.failed_c2d_methods_rate_threshold_critical}" } notify_no_data = false @@ -177,7 +183,7 @@ resource "datadog_monitor" "too_many_c2d_methods_failed" { new_host_delay = "${var.delay}" no_data_timeframe = 20 - tags = ["env:${var.environment}","resource:${var.service}","team:${var.provider}"] + tags = ["env:${var.environment}", "resource:${var.service}", "team:${var.provider}"] } resource "datadog_monitor" "too_many_c2d_twin_read_failed" { @@ -189,13 +195,14 @@ resource "datadog_monitor" "too_many_c2d_twin_read_failed" { avg:azure.devices_iothubs.c2d.twin.read.failure{${data.template_file.filter.rendered}} by {name,resource_group}.as_count() / ( avg:azure.devices_iothubs.c2d.twin.read.failure{${data.template_file.filter.rendered}} by {name,resource_group}.as_count() + avg:azure.devices_iothubs.c2d.twin.read.success{${data.template_file.filter.rendered}} by {name,resource_group}.as_count() ) - ) * 100 > ${var.c2d_twin_read_failed_threshold_critical} + ) * 100 > ${var.failed_c2d_twin_read_rate_threshold_critical} EOF - type = "query alert" + + type = "query alert" thresholds { - warning = "${var.c2d_twin_read_failed_threshold_warning}" - critical = "${var.c2d_twin_read_failed_threshold_critical}" + warning = "${var.failed_c2d_twin_read_rate_threshold_warning}" + critical = "${var.failed_c2d_twin_read_rate_threshold_critical}" } notify_no_data = false @@ -209,7 +216,7 @@ resource "datadog_monitor" "too_many_c2d_twin_read_failed" { new_host_delay = "${var.delay}" no_data_timeframe = 20 - tags = ["env:${var.environment}","resource:${var.service}","team:${var.provider}"] + tags = ["env:${var.environment}", "resource:${var.service}", "team:${var.provider}"] } resource "datadog_monitor" "too_many_c2d_twin_update_failed" { @@ -221,13 +228,14 @@ resource "datadog_monitor" "too_many_c2d_twin_update_failed" { avg:azure.devices_iothubs.c2d.twin.update.failure{${data.template_file.filter.rendered}} by {name,resource_group}.as_count() / ( avg:azure.devices_iothubs.c2d.twin.update.failure{${data.template_file.filter.rendered}} by {name,resource_group}.as_count() + avg:azure.devices_iothubs.c2d.twin.update.success{${data.template_file.filter.rendered}} by {name,resource_group}.as_count() ) - ) * 100 > ${var.c2d_twin_update_failed_threshold_critical} + ) * 100 > ${var.failed_c2d_twin_update_rate_threshold_critical} EOF - type = "query alert" + + type = "query alert" thresholds { - warning = "${var.c2d_twin_update_failed_threshold_warning}" - critical = "${var.c2d_twin_update_failed_threshold_critical}" + warning = "${var.failed_c2d_twin_update_rate_threshold_warning}" + critical = "${var.failed_c2d_twin_update_rate_threshold_critical}" } notify_no_data = false @@ -241,7 +249,7 @@ resource "datadog_monitor" "too_many_c2d_twin_update_failed" { new_host_delay = "${var.delay}" no_data_timeframe = 20 - tags = ["env:${var.environment}","resource:${var.service}","team:${var.provider}"] + tags = ["env:${var.environment}", "resource:${var.service}", "team:${var.provider}"] } resource "datadog_monitor" "too_many_d2c_twin_read_failed" { @@ -253,13 +261,14 @@ resource "datadog_monitor" "too_many_d2c_twin_read_failed" { avg:azure.devices_iothubs.d2c.twin.read.failure{${data.template_file.filter.rendered}} by {name,resource_group}.as_count() / ( avg:azure.devices_iothubs.d2c.twin.read.failure{${data.template_file.filter.rendered}} by {name,resource_group}.as_count() + avg:azure.devices_iothubs.d2c.twin.read.success{${data.template_file.filter.rendered}} by {name,resource_group}.as_count() ) - ) * 100 > ${var.d2c_twin_read_failed_threshold_critical} + ) * 100 > ${var.failed_d2c_twin_read_rate_threshold_critical} EOF - type = "query alert" + + type = "query alert" thresholds { - warning = "${var.d2c_twin_read_failed_threshold_warning}" - critical = "${var.d2c_twin_read_failed_threshold_critical}" + warning = "${var.failed_d2c_twin_read_rate_threshold_warning}" + critical = "${var.failed_d2c_twin_read_rate_threshold_critical}" } notify_no_data = false @@ -273,7 +282,7 @@ resource "datadog_monitor" "too_many_d2c_twin_read_failed" { new_host_delay = "${var.delay}" no_data_timeframe = 20 - tags = ["env:${var.environment}","resource:${var.service}","team:${var.provider}"] + tags = ["env:${var.environment}", "resource:${var.service}", "team:${var.provider}"] } resource "datadog_monitor" "too_many_d2c_twin_update_failed" { @@ -285,13 +294,14 @@ resource "datadog_monitor" "too_many_d2c_twin_update_failed" { avg:azure.devices_iothubs.d2c.twin.update.failure{${data.template_file.filter.rendered}} by {name,resource_group}.as_count() / ( avg:azure.devices_iothubs.d2c.twin.update.failure{${data.template_file.filter.rendered}} by {name,resource_group}.as_count() + avg:azure.devices_iothubs.d2c.twin.update.success{${data.template_file.filter.rendered}} by {name,resource_group}.as_count() ) - ) * 100 > ${var.d2c_twin_update_failed_threshold_critical} + ) * 100 > ${var.failed_d2c_twin_update_rate_threshold_critical} EOF - type = "query alert" + + type = "query alert" thresholds { - warning = "${var.d2c_twin_update_failed_threshold_warning}" - critical = "${var.d2c_twin_update_failed_threshold_critical}" + warning = "${var.failed_d2c_twin_update_rate_threshold_warning}" + critical = "${var.failed_d2c_twin_update_rate_threshold_critical}" } notify_no_data = false @@ -305,7 +315,7 @@ resource "datadog_monitor" "too_many_d2c_twin_update_failed" { new_host_delay = "${var.delay}" no_data_timeframe = 20 - tags = ["env:${var.environment}","resource:${var.service}","team:${var.provider}"] + tags = ["env:${var.environment}", "resource:${var.service}", "team:${var.provider}"] } resource "datadog_monitor" "too_many_d2c_telemetry_egress_dropped" { @@ -315,13 +325,14 @@ resource "datadog_monitor" "too_many_d2c_telemetry_egress_dropped" { query = < ${var.d2c_telemetry_egress_dropped_threshold_critical} + ) > ${var.dropped_d2c_telemetry_egress_threshold_critical} EOF - type = "query alert" + + type = "query alert" thresholds { - warning = "${var.d2c_telemetry_egress_dropped_threshold_warning}" - critical = "${var.d2c_telemetry_egress_dropped_threshold_critical}" + warning = "${var.dropped_d2c_telemetry_egress_threshold_warning}" + critical = "${var.dropped_d2c_telemetry_egress_threshold_critical}" } notify_no_data = false @@ -335,7 +346,7 @@ resource "datadog_monitor" "too_many_d2c_telemetry_egress_dropped" { new_host_delay = "${var.delay}" no_data_timeframe = 20 - tags = ["env:${var.environment}","resource:${var.service}","team:${var.provider}"] + tags = ["env:${var.environment}", "resource:${var.service}", "team:${var.provider}"] } resource "datadog_monitor" "too_many_d2c_telemetry_egress_orphaned" { @@ -345,13 +356,14 @@ resource "datadog_monitor" "too_many_d2c_telemetry_egress_orphaned" { query = < ${var.d2c_telemetry_egress_orphaned_threshold_critical} + ) > ${var.orphaned_d2c_telemetry_egress_threshold_critical} EOF - type = "query alert" + + type = "query alert" thresholds { - warning = "${var.d2c_telemetry_egress_orphaned_threshold_warning}" - critical = "${var.d2c_telemetry_egress_orphaned_threshold_critical}" + warning = "${var.orphaned_d2c_telemetry_egress_threshold_warning}" + critical = "${var.orphaned_d2c_telemetry_egress_threshold_critical}" } notify_no_data = false @@ -365,7 +377,7 @@ resource "datadog_monitor" "too_many_d2c_telemetry_egress_orphaned" { new_host_delay = "${var.delay}" no_data_timeframe = 20 - tags = ["env:${var.environment}","resource:${var.service}","team:${var.provider}"] + tags = ["env:${var.environment}", "resource:${var.service}", "team:${var.provider}"] } resource "datadog_monitor" "too_many_d2c_telemetry_egress_invalid" { @@ -375,13 +387,14 @@ resource "datadog_monitor" "too_many_d2c_telemetry_egress_invalid" { query = < ${var.d2c_telemetry_egress_invalid_threshold_critical} + ) > ${var.invalid_d2c_telemetry_egress_threshold_critical} EOF - type = "query alert" + + type = "query alert" thresholds { - warning = "${var.d2c_telemetry_egress_invalid_threshold_warning}" - critical = "${var.d2c_telemetry_egress_invalid_threshold_critical}" + warning = "${var.invalid_d2c_telemetry_egress_threshold_warning}" + critical = "${var.invalid_d2c_telemetry_egress_threshold_critical}" } notify_no_data = false @@ -395,7 +408,7 @@ resource "datadog_monitor" "too_many_d2c_telemetry_egress_invalid" { new_host_delay = "${var.delay}" no_data_timeframe = 20 - tags = ["env:${var.environment}","resource:${var.service}","team:${var.provider}"] + tags = ["env:${var.environment}", "resource:${var.service}", "team:${var.provider}"] } resource "datadog_monitor" "too_many_d2c_telemetry_egress_fallback" { @@ -405,13 +418,14 @@ resource "datadog_monitor" "too_many_d2c_telemetry_egress_fallback" { query = < ${var.d2c_telemetry_egress_fallback_threshold_critical} + ) > ${var.fallback_d2c_telemetry_egress_threshold_critical} EOF - type = "query alert" + + type = "query alert" thresholds { - warning = "${var.d2c_telemetry_egress_fallback_threshold_warning}" - critical = "${var.d2c_telemetry_egress_fallback_threshold_critical}" + warning = "${var.fallback_d2c_telemetry_egress_threshold_warning}" + critical = "${var.fallback_d2c_telemetry_egress_threshold_critical}" } notify_no_data = false @@ -425,7 +439,7 @@ resource "datadog_monitor" "too_many_d2c_telemetry_egress_fallback" { new_host_delay = "${var.delay}" no_data_timeframe = 20 - tags = ["env:${var.environment}","resource:${var.service}","team:${var.provider}"] + tags = ["env:${var.environment}", "resource:${var.service}", "team:${var.provider}"] } resource "datadog_monitor" "too_many_d2c_telemetry_ingress_nosent" { @@ -438,7 +452,8 @@ resource "datadog_monitor" "too_many_d2c_telemetry_ingress_nosent" { avg:azure.devices_iothubs.d2c.telemetry.ingress.success{${data.template_file.filter.rendered}} by {name,resource_group}.as_count() ) > 0 EOF - type = "query alert" + + type = "query alert" notify_no_data = false evaluation_delay = "${var.delay}" @@ -451,5 +466,5 @@ resource "datadog_monitor" "too_many_d2c_telemetry_ingress_nosent" { new_host_delay = "${var.delay}" no_data_timeframe = 20 - tags = ["env:${var.environment}","resource:${var.service}","team:${var.provider}"] + tags = ["env:${var.environment}", "resource:${var.service}", "team:${var.provider}"] }