diff --git a/cloud/azure/iothubs/README.md b/cloud/azure/iothubs/README.md index e98298b..8103a55 100644 --- a/cloud/azure/iothubs/README.md +++ b/cloud/azure/iothubs/README.md @@ -128,7 +128,8 @@ Creates DataDog monitors with the following checks: | 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(string) | `[]` | 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\_threshold\_critical | D2C Telemetry ingress not sent limit (critical threshold) | string | `"0.3"` | no | +| too\_many\_d2c\_telemetry\_ingress\_nosent\_rate\_threshold\_critical | D2C Telemetry ingress not sent limit (critical threshold) | string | `"20"` | no | +| too\_many\_d2c\_telemetry\_ingress\_nosent\_rate\_threshold\_warning | D2C Telemetry ingress not sent limit (warning threshold) | string | `"10"` | 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(string) | `[]` | no | diff --git a/cloud/azure/iothubs/inputs.tf b/cloud/azure/iothubs/inputs.tf index 4c813a8..5bff36d 100644 --- a/cloud/azure/iothubs/inputs.tf +++ b/cloud/azure/iothubs/inputs.tf @@ -565,7 +565,12 @@ variable "invalid_d2c_telemetry_egress_rate_threshold_critical" { default = 90 } -variable "too_many_d2c_telemetry_ingress_nosent_threshold_critical" { +variable "too_many_d2c_telemetry_ingress_nosent_rate_threshold_critical" { description = "D2C Telemetry ingress not sent limit (critical threshold)" - default = 0.3 + default = 20 +} + +variable "too_many_d2c_telemetry_ingress_nosent_rate_threshold_warning" { + description = "D2C Telemetry ingress not sent limit (warning threshold)" + default = 10 } diff --git a/cloud/azure/iothubs/monitors-iothubs.tf b/cloud/azure/iothubs/monitors-iothubs.tf index 2dcb1a0..f744dbb 100644 --- a/cloud/azure/iothubs/monitors-iothubs.tf +++ b/cloud/azure/iothubs/monitors-iothubs.tf @@ -478,12 +478,16 @@ resource "datadog_monitor" "too_many_d2c_telemetry_ingress_nosent" { #For this monitor, the avg is needed to smooth the -1 and +1 that we meet regularly. With just a tiny diff like -1 / + 1, if we put 0.3 it should not ring anymore. But there is a bigger difference (exemple 20) The average will be strongly raised and an alert will be triggered. query = < ${var.too_many_d2c_telemetry_ingress_nosent_threshold_critical} + 100-(default(avg:zure.devices_iothubs.d2c.telemetry.ingress.success${module.filter-tags.query_alert} by {resource_group,region,name}.as_rate() / + avg:azure.devices_iothubs.d2c.telemetry.ingress.all_protocol${module.filter-tags.query_alert} by {resource_group,region,name}.as_rate(),1) + * 100) > ${var.too_many_d2c_telemetry_ingress_nosent_rate_threshold_critical} EOQ + thresholds = { + warning = var.too_many_d2c_telemetry_ingress_nosent_rate_threshold_warning + critical = var.too_many_d2c_telemetry_ingress_nosent_rate_threshold_critical + } + evaluation_delay = var.evaluation_delay new_host_delay = var.new_host_delay notify_no_data = false