MON-191 - Azure monitors updated with customizable aggregator

This commit is contained in:
Alexandre Gaillet 2018-04-27 18:26:56 +02:00 committed by Quentin Manfroi
parent 966a9b5f54
commit b213bde8a5
24 changed files with 479 additions and 136 deletions

View File

@ -29,6 +29,7 @@ Inputs
|------|-------------|:----:|:-----:|:-----:| |------|-------------|:----:|:-----:|:-----:|
| delay | Delay in seconds for the metric evaluation | string | `900` | no | | delay | Delay in seconds for the metric evaluation | string | `900` | no |
| environment | Architecture environment | string | - | yes | | environment | Architecture environment | string | - | yes |
| failed_requests_aggregator | Monitor aggregator for API Management failed requests [available values: min, max, sum or avg] | string | `sum` | no |
| failed_requests_message | Custom message for API Management failed requests monitor | string | `` | 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 | `<map>` | no | | failed_requests_silenced | Groups to mute for API Management failed requests monitor | map | `<map>` | no |
| failed_requests_threshold_critical | Maximum acceptable percent of failed requests | string | `90` | no | | failed_requests_threshold_critical | Maximum acceptable percent of failed requests | string | `90` | no |
@ -37,19 +38,23 @@ Inputs
| filter_tags_custom | Tags used for custom filtering when filter_tags_use_defaults is false | string | `*` | 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 | | filter_tags_use_defaults | Use default filter tags convention | string | `true` | no |
| message | Message sent when a Redis monitor is triggered | string | - | yes | | message | Message sent when a Redis monitor is triggered | string | - | yes |
| other_requests_aggregator | Monitor aggregator for API Management other requests [available values: min, max, sum or avg] | string | `sum` | no |
| other_requests_message | Custom message for API Management other requests monitor | string | `` | 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 | `<map>` | no | | other_requests_silenced | Groups to mute for API Management other requests monitor | map | `<map>` | no |
| other_requests_threshold_critical | Maximum acceptable percent of other requests | string | `90` | 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_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 | | 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_aggregator | Monitor aggregator for API Management status [available values: min, max, sum or avg] | string | `avg` | no |
| status_message | Custom message for API Management status monitor | string | `` | no | | status_message | Custom message for API Management status monitor | string | `` | no |
| status_silenced | Groups to mute for API Management status monitor | map | `<map>` | no | | status_silenced | Groups to mute for API Management status monitor | map | `<map>` | 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 | | 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_aggregator | Monitor aggregator for API Management successful requests [available values: min, max, sum or avg] | string | `sum` | no |
| successful_requests_message | Custom message for API Management successful requests monitor | string | `` | 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 | `<map>` | no | | successful_requests_silenced | Groups to mute for API Management successful requests monitor | map | `<map>` | no |
| successful_requests_threshold_critical | Minimum acceptable percent of successful requests | string | `10` | 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_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 | | 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_aggregator | Monitor aggregator for API Management unauthorized requests [available values: min, max, sum or avg] | string | `sum` | no |
| unauthorized_requests_message | Custom message for API Management unauthorized requests monitor | string | `` | 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 | `<map>` | no | | unauthorized_requests_silenced | Groups to mute for API Management unauthorized requests monitor | map | `<map>` | no |
| unauthorized_requests_threshold_critical | Maximum acceptable percent of unauthorized requests | string | `90` | no | | unauthorized_requests_threshold_critical | Maximum acceptable percent of unauthorized requests | string | `90` | no |

View File

@ -37,6 +37,12 @@ variable "status_message" {
default = "" default = ""
} }
variable "status_aggregator" {
description = "Monitor aggregator for API Management status [available values: min, max, sum or avg]"
type = "string"
default = "avg"
}
variable "status_timeframe" { variable "status_timeframe" {
description = "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`]" description = "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`]"
type = "string" type = "string"
@ -55,6 +61,12 @@ variable "failed_requests_message" {
default = "" default = ""
} }
variable "failed_requests_aggregator" {
description = "Monitor aggregator for API Management failed requests [available values: min, max, sum or avg]"
type = "string"
default = "sum"
}
variable "failed_requests_timeframe" { variable "failed_requests_timeframe" {
description = "Monitor timeframe for API Management failed requests [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]" description = "Monitor timeframe for API Management failed requests [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]"
type = "string" type = "string"
@ -83,6 +95,12 @@ variable "other_requests_message" {
default = "" default = ""
} }
variable "other_requests_aggregator" {
description = "Monitor aggregator for API Management other requests [available values: min, max, sum or avg]"
type = "string"
default = "sum"
}
variable "other_requests_timeframe" { variable "other_requests_timeframe" {
description = "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`]" description = "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`]"
type = "string" type = "string"
@ -111,6 +129,12 @@ variable "unauthorized_requests_message" {
default = "" default = ""
} }
variable "unauthorized_requests_aggregator" {
description = "Monitor aggregator for API Management unauthorized requests [available values: min, max, sum or avg]"
type = "string"
default = "sum"
}
variable "unauthorized_requests_timeframe" { variable "unauthorized_requests_timeframe" {
description = "Monitor timeframe for API Management unauthorized requests [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]" description = "Monitor timeframe for API Management unauthorized requests [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]"
type = "string" type = "string"
@ -139,6 +163,12 @@ variable "successful_requests_message" {
default = "" default = ""
} }
variable "successful_requests_aggregator" {
description = "Monitor aggregator for API Management successful requests [available values: min, max, sum or avg]"
type = "string"
default = "sum"
}
variable "successful_requests_timeframe" { variable "successful_requests_timeframe" {
description = "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`]" description = "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`]"
type = "string" type = "string"

View File

@ -13,8 +13,8 @@ resource "datadog_monitor" "apimgt_status" {
message = "${coalesce(var.status_message, var.message)}" message = "${coalesce(var.status_message, var.message)}"
query = <<EOF query = <<EOF
avg(${var.status_timeframe}):avg:azure.apimanagement_service.status{${data.template_file.filter.rendered}} by {resource_group,region,name} < 1 ${var.status_aggregator}(${var.status_timeframe}):avg:azure.apimanagement_service.status{${data.template_file.filter.rendered}} by {resource_group,region,name} < 1
EOF EOF
type = "metric alert" type = "metric alert"
@ -42,11 +42,11 @@ resource "datadog_monitor" "apimgt_failed_requests" {
message = "${coalesce(var.failed_requests_message, var.message)}" message = "${coalesce(var.failed_requests_message, var.message)}"
query = <<EOF query = <<EOF
sum(${var.failed_requests_timeframe}): ( ${var.failed_requests_aggregator}(${var.failed_requests_timeframe}): (
avg:azure.apimanagement_service.failed_requests{${data.template_file.filter.rendered}} by {resource_group,region,name}.as_count() / ${var.failed_requests_aggregator}:azure.apimanagement_service.failed_requests{${data.template_file.filter.rendered}} by {resource_group,region,name}.as_count() /
avg:azure.apimanagement_service.total_requests{${data.template_file.filter.rendered}} by {resource_group,region,name}.as_count() * 100 ${var.failed_requests_aggregator}:azure.apimanagement_service.total_requests{${data.template_file.filter.rendered}} by {resource_group,region,name}.as_count() * 100
) > ${var.failed_requests_threshold_critical} ) > ${var.failed_requests_threshold_critical}
EOF EOF
thresholds { thresholds {
critical = "${var.failed_requests_threshold_critical}" critical = "${var.failed_requests_threshold_critical}"
@ -74,11 +74,11 @@ resource "datadog_monitor" "apimgt_other_requests" {
message = "${coalesce(var.other_requests_message, var.message)}" message = "${coalesce(var.other_requests_message, var.message)}"
query = <<EOF query = <<EOF
sum(${var.other_requests_timeframe}): ( ${var.other_requests_aggregator}(${var.other_requests_timeframe}): (
avg:azure.apimanagement_service.other_requests{${data.template_file.filter.rendered}} by {resource_group,region,name}.as_count() / ${var.other_requests_aggregator}:azure.apimanagement_service.other_requests{${data.template_file.filter.rendered}} by {resource_group,region,name}.as_count() /
avg:azure.apimanagement_service.total_requests{${data.template_file.filter.rendered}} by {resource_group,region,name}.as_count() * 100 ${var.other_requests_aggregator}:azure.apimanagement_service.total_requests{${data.template_file.filter.rendered}} by {resource_group,region,name}.as_count() * 100
) > ${var.other_requests_threshold_critical} ) > ${var.other_requests_threshold_critical}
EOF EOF
thresholds { thresholds {
critical = "${var.other_requests_threshold_critical}" critical = "${var.other_requests_threshold_critical}"
@ -106,11 +106,11 @@ resource "datadog_monitor" "apimgt_unauthorized_requests" {
message = "${coalesce(var.unauthorized_requests_message, var.message)}" message = "${coalesce(var.unauthorized_requests_message, var.message)}"
query = <<EOF query = <<EOF
sum(${var.unauthorized_requests_timeframe}): ( ${var.unauthorized_requests_aggregator}(${var.unauthorized_requests_timeframe}): (
avg:azure.apimanagement_service.unauthorized_requests{${data.template_file.filter.rendered}} by {resource_group,region,name}.as_count() / ${var.unauthorized_requests_aggregator}:azure.apimanagement_service.unauthorized_requests{${data.template_file.filter.rendered}} by {resource_group,region,name}.as_count() /
avg:azure.apimanagement_service.total_requests{${data.template_file.filter.rendered}} by {resource_group,region,name}.as_count() * 100 ${var.unauthorized_requests_aggregator}:azure.apimanagement_service.total_requests{${data.template_file.filter.rendered}} by {resource_group,region,name}.as_count() * 100
) > ${var.unauthorized_requests_threshold_critical} ) > ${var.unauthorized_requests_threshold_critical}
EOF EOF
thresholds { thresholds {
critical = "${var.unauthorized_requests_threshold_critical}" critical = "${var.unauthorized_requests_threshold_critical}"
@ -138,11 +138,11 @@ resource "datadog_monitor" "apimgt_successful_requests" {
message = "${coalesce(var.successful_requests_message, var.message)}" message = "${coalesce(var.successful_requests_message, var.message)}"
query = <<EOF query = <<EOF
sum(${var.successful_requests_timeframe}): ( ${var.successful_requests_aggregator}(${var.successful_requests_timeframe}): (
avg:azure.apimanagement_service.successful_requests{${data.template_file.filter.rendered}} by {resource_group,region,name}.as_count() / ${var.successful_requests_aggregator}:azure.apimanagement_service.successful_requests{${data.template_file.filter.rendered}} by {resource_group,region,name}.as_count() /
avg:azure.apimanagement_service.total_requests{${data.template_file.filter.rendered}} by {resource_group,region,name}.as_count() * 100 ${var.successful_requests_aggregator}:azure.apimanagement_service.total_requests{${data.template_file.filter.rendered}} by {resource_group,region,name}.as_count() * 100
) < ${var.successful_requests_threshold_critical} ) < ${var.successful_requests_threshold_critical}
EOF EOF
thresholds { thresholds {
critical = "${var.successful_requests_threshold_critical}" critical = "${var.successful_requests_threshold_critical}"

View File

@ -32,27 +32,32 @@ Inputs
| environment | Architecture environment | string | - | yes | | environment | Architecture environment | string | - | yes |
| filter_tags_custom | Tags used for custom filtering when filter_tags_use_defaults is false | string | `*` | 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 | | filter_tags_use_defaults | Use default filter tags convention | string | `true` | no |
| http_4xx_requests_aggregator | Monitor aggregator for App Services 4xx requests [available values: min, max, sum or avg] | string | `sum` | no |
| http_4xx_requests_message | Custom message for App Services 4xx requests monitor | string | `` | 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 | `<map>` | no | | http_4xx_requests_silenced | Groups to mute for App Services 4xx requests monitor | map | `<map>` | no |
| http_4xx_requests_threshold_critical | Maximum critical acceptable percent of 4xx errors | string | `90` | 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_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_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_aggregator | Monitor aggregator for App Services 5xx requests [available values: min, max, sum or avg] | string | `sum` | no |
| http_5xx_requests_message | Custom message for App Services 5xx requests monitor | string | `` | 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 | `<map>` | no | | http_5xx_requests_silenced | Groups to mute for App Services 5xx requests monitor | map | `<map>` | no |
| http_5xx_requests_threshold_critical | Maximum critical acceptable percent of 5xx errors | string | `90` | 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_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_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_aggregator | Monitor aggregator for App Services successful requests [available values: min, max, sum or avg] | string | `sum` | no |
| http_successful_requests_message | Custom message for App Services successful requests monitor | string | `` | 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 | `<map>` | no | | http_successful_requests_silenced | Groups to mute for App Services successful requests monitor | map | `<map>` | no |
| http_successful_requests_threshold_critical | Minimum critical acceptable percent of 2xx & 3xx requests | string | `10` | 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_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 | | 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_aggregator | Monitor aggregator for App Services memory usage [available values: min, max, sum or avg] | string | `avg` | no |
| memory_usage_message | Custom message for App Services memory usage monitor | string | `` | 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 | `<map>` | no | | memory_usage_silenced | Groups to mute for App Services memory usage monitor | map | `<map>` | no |
| memory_usage_threshold_critical | Alerting threshold in Mib | string | `1073741824` | no | | memory_usage_threshold_critical | Alerting threshold in Mib | string | `1073741824` | no |
| memory_usage_threshold_warning | Warning threshold in MiB | string | `536870912` | no | | memory_usage_threshold_warning | Warning threshold in MiB | string | `536870912` | no |
| 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 | | 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 | | message | Message sent when a monitor is triggered | string | - | yes |
| response_time_aggregator | Monitor aggregator for App Services response time [available values: min, max, sum or avg] | string | `min` | no |
| response_time_message | Custom message for App Services response time monitor | string | `` | 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 | `<map>` | no | | response_time_silenced | Groups to mute for App Services response time monitor | map | `<map>` | no |
| response_time_threshold_critical | Alerting threshold for response time in seconds | string | `10` | no | | response_time_threshold_critical | Alerting threshold for response time in seconds | string | `10` | no |

View File

@ -35,6 +35,12 @@ variable "response_time_message" {
default = "" default = ""
} }
variable "response_time_aggregator" {
description = "Monitor aggregator for App Services response time [available values: min, max, sum or avg]"
type = "string"
default = "min"
}
variable "response_time_timeframe" { variable "response_time_timeframe" {
description = "Monitor timeframe for App Services response time [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]" description = "Monitor timeframe for App Services response time [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]"
type = "string" type = "string"
@ -63,6 +69,12 @@ variable "memory_usage_message" {
default = "" default = ""
} }
variable "memory_usage_aggregator" {
description = "Monitor aggregator for App Services memory usage [available values: min, max, sum or avg]"
type = "string"
default = "avg"
}
variable "memory_usage_timeframe" { variable "memory_usage_timeframe" {
description = "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`]" description = "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`]"
type = "string" type = "string"
@ -91,6 +103,12 @@ variable "http_4xx_requests_message" {
default = "" default = ""
} }
variable "http_4xx_requests_aggregator" {
description = "Monitor aggregator for App Services 4xx requests [available values: min, max, sum or avg]"
type = "string"
default = "sum"
}
variable "http_4xx_requests_timeframe" { variable "http_4xx_requests_timeframe" {
description = "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`]" description = "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`]"
type = "string" type = "string"
@ -119,6 +137,12 @@ variable "http_5xx_requests_message" {
default = "" default = ""
} }
variable "http_5xx_requests_aggregator" {
description = "Monitor aggregator for App Services 5xx requests [available values: min, max, sum or avg]"
type = "string"
default = "sum"
}
variable "http_5xx_requests_timeframe" { variable "http_5xx_requests_timeframe" {
description = "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`]" description = "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`]"
type = "string" type = "string"
@ -147,6 +171,12 @@ variable "http_successful_requests_message" {
default = "" default = ""
} }
variable "http_successful_requests_aggregator" {
description = "Monitor aggregator for App Services successful requests [available values: min, max, sum or avg]"
type = "string"
default = "sum"
}
variable "http_successful_requests_timeframe" { variable "http_successful_requests_timeframe" {
description = "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`]" description = "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`]"
type = "string" type = "string"

View File

@ -13,8 +13,8 @@ resource "datadog_monitor" "appservices_response_time" {
message = "${coalesce(var.response_time_message, var.message)}" message = "${coalesce(var.response_time_message, var.message)}"
query = <<EOF query = <<EOF
min(last_5m): ( ${var.response_time_aggregator}(last_5m): (
avg:azure.app_services.average_response_time{${data.template_file.filter.rendered}} by {resource_group,region,name} ${var.response_time_aggregator}:azure.app_services.average_response_time{${data.template_file.filter.rendered}} by {resource_group,region,name}
) > ${var.response_time_threshold_critical} ) > ${var.response_time_threshold_critical}
EOF EOF
@ -44,8 +44,8 @@ resource "datadog_monitor" "appservices_memory_usage_count" {
message = "${coalesce(var.memory_usage_message, var.message)}" message = "${coalesce(var.memory_usage_message, var.message)}"
query = <<EOF query = <<EOF
avg(${var.memory_usage_timeframe}): ( ${var.memory_usage_aggregator}(${var.memory_usage_timeframe}): (
avg:azure.app_services.memory_working_set{${data.template_file.filter.rendered}} by {resource_group,region,name} ${var.memory_usage_aggregator}:azure.app_services.memory_working_set{${data.template_file.filter.rendered}} by {resource_group,region,name}
) > ${var.memory_usage_threshold_critical} ) > ${var.memory_usage_threshold_critical}
EOF EOF
@ -75,9 +75,9 @@ resource "datadog_monitor" "appservices_http_5xx_errors_count" {
message = "${coalesce(var.http_5xx_requests_message, var.message)}" message = "${coalesce(var.http_5xx_requests_message, var.message)}"
query = <<EOF query = <<EOF
sum(${var.http_5xx_requests_timeframe}): ( ${var.http_5xx_requests_aggregator}(${var.http_5xx_requests_timeframe}): (
avg:azure.app_services.http5xx{${data.template_file.filter.rendered}} by {resource_group,region,name}.as_count() / ${var.http_5xx_requests_aggregator}:azure.app_services.http5xx{${data.template_file.filter.rendered}} by {resource_group,region,name}.as_count() /
avg:azure.app_services.requests{${data.template_file.filter.rendered}} by {resource_group,region,name}.as_count() ${var.http_5xx_requests_aggregator}:azure.app_services.requests{${data.template_file.filter.rendered}} by {resource_group,region,name}.as_count()
) * 100 > ${var.http_5xx_requests_threshold_critical} ) * 100 > ${var.http_5xx_requests_threshold_critical}
EOF EOF
@ -107,9 +107,9 @@ resource "datadog_monitor" "appservices_http_4xx_errors_count" {
message = "${coalesce(var.http_4xx_requests_message, var.message)}" message = "${coalesce(var.http_4xx_requests_message, var.message)}"
query = <<EOF query = <<EOF
sum(${var.http_4xx_requests_timeframe}): ( ${var.http_4xx_requests_aggregator}(${var.http_4xx_requests_timeframe}): (
avg:azure.app_services.http4xx{${data.template_file.filter.rendered}} by {resource_group,region,name}.as_count() / ${var.http_4xx_requests_aggregator}:azure.app_services.http4xx{${data.template_file.filter.rendered}} by {resource_group,region,name}.as_count() /
avg:azure.app_services.requests{${data.template_file.filter.rendered}} by {resource_group,region,name}.as_count() ${var.http_4xx_requests_aggregator}:azure.app_services.requests{${data.template_file.filter.rendered}} by {resource_group,region,name}.as_count()
) * 100 > ${var.http_4xx_requests_threshold_critical} ) * 100 > ${var.http_4xx_requests_threshold_critical}
EOF EOF
@ -139,10 +139,10 @@ resource "datadog_monitor" "appservices_http_success_status_rate" {
message = "${coalesce(var.http_successful_requests_message, var.message)}" message = "${coalesce(var.http_successful_requests_message, var.message)}"
query = <<EOF query = <<EOF
sum(${var.http_successful_requests_timeframe}): ( ${var.http_successful_requests_aggregator}(${var.http_successful_requests_timeframe}): (
(avg:azure.app_services.http2xx{${data.template_file.filter.rendered}} by {resource_group,region,name}.as_count() + (${var.http_successful_requests_aggregator}:azure.app_services.http2xx{${data.template_file.filter.rendered}} by {resource_group,region,name}.as_count() +
avg:azure.app_services.http3xx{${data.template_file.filter.rendered}} by {resource_group,region,name}.as_count()) / ${var.http_successful_requests_aggregator}:azure.app_services.http3xx{${data.template_file.filter.rendered}} by {resource_group,region,name}.as_count()) /
avg:azure.app_services.requests{${data.template_file.filter.rendered}} by {resource_group,region,name}.as_count() ${var.http_successful_requests_aggregator}:azure.app_services.requests{${data.template_file.filter.rendered}} by {resource_group,region,name}.as_count()
) * 100 < ${var.http_successful_requests_threshold_critical} ) * 100 < ${var.http_successful_requests_threshold_critical}
EOF EOF

View File

@ -28,11 +28,13 @@ Inputs
|------|-------------|:----:|:-----:|:-----:| |------|-------------|:----:|:-----:|:-----:|
| delay | Delay in seconds for the metric evaluation | string | `900` | no | | delay | Delay in seconds for the metric evaluation | string | `900` | no |
| environment | Architecture environment | string | - | yes | | environment | Architecture environment | string | - | yes |
| errors_rate_aggregator | Monitor aggregator for Event Hub errors [available values: min, max, sum or avg] | string | `sum` | no |
| errors_rate_message | Custom message for Event Hub errors monitor | string | `` | 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 | `<map>` | no | | errors_rate_silenced | Groups to mute for Event Hub errors monitor | map | `<map>` | no |
| errors_rate_thresold_critical | Errors ratio (percentage) to trigger the critical alert | string | `90` | no | | errors_rate_thresold_critical | Errors ratio (percentage) to trigger the critical alert | string | `90` | no |
| errors_rate_thresold_warning | Errors ratio (percentage) to trigger a warning alert | string | `50` | no | | 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 | | 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 |
| failed_requests_rate_aggregator | Monitor aggregator for Event Hub failed requests [available values: min, max, sum or avg] | string | `sum` | no |
| failed_requests_rate_message | Custom message for Event Hub failed requests monitor | string | `` | 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 | `<map>` | no | | failed_requests_rate_silenced | Groups to mute for Event Hub failed requests monitor | map | `<map>` | no |
| failed_requests_rate_thresold_critical | Failed requests ratio (percentage) to trigger the critical alert | string | `90` | no | | failed_requests_rate_thresold_critical | Failed requests ratio (percentage) to trigger the critical alert | string | `90` | no |
@ -41,6 +43,7 @@ Inputs
| filter_tags_custom | Tags used for custom filtering when filter_tags_use_defaults is false | string | `*` | 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 | | filter_tags_use_defaults | Use default filter tags convention | string | `true` | no |
| message | Message sent when an alert is triggered | string | - | yes | | message | Message sent when an alert is triggered | string | - | yes |
| status_aggregator | Monitor aggregator for Event Hub status [available values: min, max, sum or avg] | string | `avg` | no |
| status_message | Custom message for Event Hub status monitor | string | `` | no | | status_message | Custom message for Event Hub status monitor | string | `` | no |
| status_silenced | Groups to mute for Event Hub status monitor | map | `<map>` | no | | status_silenced | Groups to mute for Event Hub status monitor | map | `<map>` | no |
| status_timeframe | Monitor timeframe for Event 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 | | status_timeframe | Monitor timeframe for Event 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 |

View File

@ -37,6 +37,12 @@ variable "status_message" {
default = "" default = ""
} }
variable "status_aggregator" {
description = "Monitor aggregator for Event Hub status [available values: min, max, sum or avg]"
type = "string"
default = "avg"
}
variable "status_timeframe" { variable "status_timeframe" {
description = "Monitor timeframe for Event Hub status [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]" description = "Monitor timeframe for Event Hub status [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]"
type = "string" type = "string"
@ -55,6 +61,12 @@ variable "failed_requests_rate_message" {
default = "" default = ""
} }
variable "failed_requests_rate_aggregator" {
description = "Monitor aggregator for Event Hub failed requests [available values: min, max, sum or avg]"
type = "string"
default = "sum"
}
variable "failed_requests_rate_timeframe" { variable "failed_requests_rate_timeframe" {
description = "Monitor timeframe for Event Hub failed requests [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]" description = "Monitor timeframe for Event Hub failed requests [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]"
type = "string" type = "string"
@ -83,6 +95,12 @@ variable "errors_rate_message" {
default = "" default = ""
} }
variable "errors_rate_aggregator" {
description = "Monitor aggregator for Event Hub errors [available values: min, max, sum or avg]"
type = "string"
default = "sum"
}
variable "errors_rate_timeframe" { variable "errors_rate_timeframe" {
description = "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`]" description = "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`]"
type = "string" type = "string"

View File

@ -11,8 +11,8 @@ resource "datadog_monitor" "eventhub_status" {
message = "${coalesce(var.status_message, var.message)}" message = "${coalesce(var.status_message, var.message)}"
query = <<EOF query = <<EOF
avg(${var.status_timeframe}): avg:azure.eventhub_namespaces.status{${data.template_file.filter.rendered}} by {resource_group,region,name} != 1 ${var.status_aggregator}(${var.status_timeframe}): avg:azure.eventhub_namespaces.status{${data.template_file.filter.rendered}} by {resource_group,region,name} != 1
EOF EOF
type = "metric alert" type = "metric alert"
@ -36,13 +36,13 @@ resource "datadog_monitor" "eventhub_failed_requests" {
message = "${coalesce(var.failed_requests_rate_message, var.message)}" message = "${coalesce(var.failed_requests_rate_message, var.message)}"
query = <<EOF query = <<EOF
sum(${var.failed_requests_rate_timeframe}): ( ${var.failed_requests_rate_aggregator}(${var.failed_requests_rate_timeframe}): (
default( default(
avg:azure.eventhub_namespaces.failed_requests{${data.template_file.filter.rendered}} by {resource_group,region,name}.as_count() / ${var.failed_requests_rate_aggregator}:azure.eventhub_namespaces.failed_requests{${data.template_file.filter.rendered}} by {resource_group,region,name}.as_count() /
avg:azure.eventhub_namespaces.incoming_requests{${data.template_file.filter.rendered}} by {resource_group,region,name}.as_count(), ${var.failed_requests_rate_aggregator}:azure.eventhub_namespaces.incoming_requests{${data.template_file.filter.rendered}} by {resource_group,region,name}.as_count(),
0) * 100 0) * 100
) > ${var.failed_requests_rate_thresold_critical} ) > ${var.failed_requests_rate_thresold_critical}
EOF EOF
type = "metric alert" type = "metric alert"
@ -71,18 +71,18 @@ resource "datadog_monitor" "eventhub_errors" {
message = "${coalesce(var.errors_rate_message, var.message)}" message = "${coalesce(var.errors_rate_message, var.message)}"
query = <<EOF query = <<EOF
sum(${var.errors_rate_timeframe}): ( ${var.errors_rate_aggregator}(${var.errors_rate_timeframe}): (
default( default(
( (
avg:azure.eventhub_namespaces.internal_server_errors{${data.template_file.filter.rendered}} by {resource_group,region,name}.as_count() + ${var.errors_rate_aggregator}:azure.eventhub_namespaces.internal_server_errors{${data.template_file.filter.rendered}} by {resource_group,region,name}.as_count() +
avg:azure.eventhub_namespaces.server_busy_errors{${data.template_file.filter.rendered}} by {resource_group,region,name}.as_count() + ${var.errors_rate_aggregator}:azure.eventhub_namespaces.server_busy_errors{${data.template_file.filter.rendered}} by {resource_group,region,name}.as_count() +
avg:azure.eventhub_namespaces.other_errors{${data.template_file.filter.rendered}} by {resource_group,region,name}.as_count() ${var.errors_rate_aggregator}:azure.eventhub_namespaces.other_errors{${data.template_file.filter.rendered}} by {resource_group,region,name}.as_count()
) / ( ) / (
avg:eventhub_namespaces.incoming_requests{${data.template_file.filter.rendered}} by {resource_group,region,name}.as_count() ${var.errors_rate_aggregator}:eventhub_namespaces.incoming_requests{${data.template_file.filter.rendered}} by {resource_group,region,name}.as_count()
), ),
0) * 100 0) * 100
) > ${var.errors_rate_thresold_critical} ) > ${var.errors_rate_thresold_critical}
EOF EOF
type = "metric alert" type = "metric alert"

View File

@ -39,70 +39,84 @@ Inputs
| Name | Description | Type | Default | Required | | Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:| |------|-------------|:----:|:-----:|:-----:|
| delay | Delay in seconds for the metric evaluation | string | `900` | no | | delay | Delay in seconds for the metric evaluation | string | `900` | no |
| dropped_d2c_telemetry_egress_aggregator | Monitor aggregator for IoT Hub failed d2c telemetry [available values: min, max, sum or avg] | string | `sum` | no |
| dropped_d2c_telemetry_egress_message | Custom message for IoT Hub dropped d2c telemetry monitor | string | `` | 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 | | dropped_d2c_telemetry_egress_rate_threshold_critical | D2C Telemetry Dropped limit (critical threshold) | string | `90` | no |
| dropped_d2c_telemetry_egress_rate_threshold_warning | D2C Telemetry Dropped limit (warning threshold) | string | `50` | no | | dropped_d2c_telemetry_egress_rate_threshold_warning | D2C Telemetry Dropped limit (warning threshold) | string | `50` | no |
| dropped_d2c_telemetry_egress_silenced | Groups to mute for IoT Hub dropped d2c telemetry monitor | map | `<map>` | no | | dropped_d2c_telemetry_egress_silenced | Groups to mute for IoT Hub dropped d2c telemetry monitor | map | `<map>` | no |
| 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 | | 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 | | environment | Architecture Environment | string | - | yes |
| failed_c2d_methods_rate_aggregator | Monitor aggregator for IoT Hub failed c2d method [available values: min, max, sum or avg] | string | `sum` | no |
| failed_c2d_methods_rate_message | Custom message for IoT Hub failed c2d method monitor | string | `` | 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 | `<map>` | no | | failed_c2d_methods_rate_silenced | Groups to mute for IoT Hub failed c2d methods monitor | map | `<map>` | no |
| failed_c2d_methods_rate_threshold_critical | C2D Methods Failed rate limit (critical threshold) | string | `90` | 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_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_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_aggregator | Monitor aggregator for IoT Hub failed c2d twin read [available values: min, max, sum or avg] | string | `sum` | no |
| failed_c2d_twin_read_rate_message | Custom message for IoT Hub failed c2d twin read monitor | string | `` | 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 | `<map>` | no | | failed_c2d_twin_read_rate_silenced | Groups to mute for IoT Hub failed c2d twin read monitor | map | `<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_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_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_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_aggregator | Monitor aggregator for IoT Hub failed c2d twin update [available values: min, max, sum or avg] | string | `sum` | no |
| failed_c2d_twin_update_rate_message | Custom message for IoT Hub failed c2d twin update monitor | string | `` | 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 | `<map>` | no | | failed_c2d_twin_update_rate_silenced | Groups to mute for IoT Hub failed c2d twin update monitor | map | `<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_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_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_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_aggregator | Monitor aggregator for IoT Hub failed d2c twin read [available values: min, max, sum or avg] | string | `sum` | no |
| failed_d2c_twin_read_rate_message | Custom message for IoT Hub failed d2c twin read monitor | string | `` | 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 | `<map>` | no | | failed_d2c_twin_read_rate_silenced | Groups to mute for IoT Hub failed d2c twin read monitor | map | `<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_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_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_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_aggregator | Monitor aggregator for IoT Hub failed d2c twin update [available values: min, max, sum or avg] | string | `sum` | no |
| failed_d2c_twin_update_rate_message | Custom message for IoT Hub failed d2c twin update monitor | string | `` | 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 | `<map>` | no | | failed_d2c_twin_update_rate_silenced | Groups to mute for IoT Hub failed d2c twin update monitor | map | `<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_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_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_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_aggregator | Monitor aggregator for IoT Hub failed jobs [available values: min, max, sum or avg] | string | `sum` | no |
| failed_jobs_rate_message | Custom message for IoT Hub failed jobs monitor | string | `` | 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 | `<map>` | no | | failed_jobs_rate_silenced | Groups to mute for IoT Hub failed jobs monitor | map | `<map>` | no |
| failed_jobs_rate_threshold_critical | Jobs Failed rate limit (critical threshold) | string | `90` | 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_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_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_aggregator | Monitor aggregator for IoT Hub failed listjobs jobs [available values: min, max, sum or avg] | string | `sum` | no |
| failed_listjobs_rate_message | Custom message for IoT Hub failed list jobs monitor | string | `` | 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 | `<map>` | no | | failed_listjobs_rate_silenced | Groups to mute for IoT Hub failed list jobs monitor | map | `<map>` | no |
| failed_listjobs_rate_threshold_critical | ListJobs Failed rate limit (critical threshold) | string | `90` | 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_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_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_aggregator | Monitor aggregator for IoT Hub failed query jobs [available values: min, max, sum or avg] | string | `sum` | no |
| failed_queryjobs_rate_message | Custom message for IoT Hub failed query jobs monitor | string | `` | 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 | `<map>` | no | | failed_queryjobs_rate_silenced | Groups to mute for IoT Hub failed query jobs monitor | map | `<map>` | no |
| failed_queryjobs_rate_threshold_critical | QueryJobs Failed rate limit (critical threshold) | string | `90` | no | | failed_queryjobs_rate_threshold_critical | QueryJobs Failed rate limit (critical threshold) | string | `90` | no |
| failed_queryjobs_rate_threshold_warning | QueryJobs Failed rate limit (warning threshold) | string | `50` | no | | 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 | | 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 | | filter_tags | Tags used for filtering | string | `*` | no |
| invalid_d2c_telemetry_egress_aggregator | Monitor aggregator for IoT Hub invalid d2c telemetry [available values: min, max, sum or avg] | string | `sum` | no |
| invalid_d2c_telemetry_egress_message | Custom message for IoT Hub invalid d2c telemetry monitor | string | `` | 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 | | invalid_d2c_telemetry_egress_rate_threshold_critical | D2C Telemetry Invalid limit (critical threshold) | string | `90` | no |
| invalid_d2c_telemetry_egress_rate_threshold_warning | D2C Telemetry Invalid limit (warning threshold) | string | `50` | no | | invalid_d2c_telemetry_egress_rate_threshold_warning | D2C Telemetry Invalid limit (warning threshold) | string | `50` | no |
| invalid_d2c_telemetry_egress_silenced | Groups to mute for IoT Hub invalid d2c telemetry monitor | map | `<map>` | no | | invalid_d2c_telemetry_egress_silenced | Groups to mute for IoT Hub invalid d2c telemetry monitor | map | `<map>` | no |
| 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 | | 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 | | message | Message sent when an alert is triggered | string | - | yes |
| orphaned_d2c_telemetry_egress_aggregator | Monitor aggregator for IoT Hub orphaned d2c telemetry [available values: min, max, sum or avg] | string | `sum` | no |
| orphaned_d2c_telemetry_egress_message | Custom message for IoT Hub orphaned d2c telemetry monitor | string | `` | 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_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_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 | `<map>` | no | | orphaned_d2c_telemetry_egress_silenced | Groups to mute for IoT Hub orphaned d2c telemetry monitor | map | `<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 | | 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_aggregator | Monitor aggregator for IoT Hub status [available values: min, max, sum or avg] | string | `avg` | no |
| status_message | Custom message for IoT Hub status monitor | string | `` | no | | status_message | Custom message for IoT Hub status monitor | string | `` | no |
| status_silenced | Groups to mute for IoT Hub status monitor | map | `<map>` | no | | status_silenced | Groups to mute for IoT Hub status monitor | map | `<map>` | 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 | | 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_aggregator | Monitor aggregator for IoT Hub unsent d2c telemetry [available values: min, max, sum or avg] | string | `sum` | 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_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 | `<map>` | no | | too_many_d2c_telemetry_ingress_nosent_silenced | Groups to mute for IoT Hub unsent d2c telemetry monitor | map | `<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 | | 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_aggregator | Monitor aggregator for IoT Hub total devices [available values: min, max, sum or avg] | string | `avg` | no |
| total_devices_message | Custom message for IoT Hub total devices monitor | string | `` | 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 | `<map>` | no | | total_devices_silenced | Groups to mute for IoT Hub total devices monitor | map | `<map>` | no |
| total_devices_timeframe | Monitor timeframe for IoT Hub total devices [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_timeframe | Monitor timeframe for IoT Hub total devices [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no |

View File

@ -32,6 +32,12 @@ variable "status_message" {
default = "" default = ""
} }
variable "status_aggregator" {
description = "Monitor aggregator for IoT Hub status [available values: min, max, sum or avg]"
type = "string"
default = "avg"
}
variable "status_timeframe" { variable "status_timeframe" {
description = "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`]" description = "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`]"
type = "string" type = "string"
@ -50,6 +56,12 @@ variable "total_devices_message" {
default = "" default = ""
} }
variable "total_devices_aggregator" {
description = "Monitor aggregator for IoT Hub total devices [available values: min, max, sum or avg]"
type = "string"
default = "avg"
}
variable "total_devices_timeframe" { variable "total_devices_timeframe" {
description = "Monitor timeframe for IoT Hub total devices [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]" description = "Monitor timeframe for IoT Hub total devices [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]"
type = "string" type = "string"
@ -68,6 +80,12 @@ variable "too_many_d2c_telemetry_ingress_nosent_message" {
default = "" default = ""
} }
variable "too_many_d2c_telemetry_ingress_nosent_aggregator" {
description = "Monitor aggregator for IoT Hub unsent d2c telemetry [available values: min, max, sum or avg]"
type = "string"
default = "sum"
}
variable "too_many_d2c_telemetry_ingress_nosent_timeframe" { variable "too_many_d2c_telemetry_ingress_nosent_timeframe" {
description = "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`]" description = "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`]"
type = "string" type = "string"
@ -86,6 +104,12 @@ variable "failed_jobs_rate_message" {
default = "" default = ""
} }
variable "failed_jobs_rate_aggregator" {
description = "Monitor aggregator for IoT Hub failed jobs [available values: min, max, sum or avg]"
type = "string"
default = "sum"
}
variable "failed_jobs_rate_timeframe" { variable "failed_jobs_rate_timeframe" {
description = "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`]" description = "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`]"
type = "string" type = "string"
@ -114,6 +138,12 @@ variable "failed_listjobs_rate_message" {
default = "" default = ""
} }
variable "failed_listjobs_rate_aggregator" {
description = "Monitor aggregator for IoT Hub failed listjobs jobs [available values: min, max, sum or avg]"
type = "string"
default = "sum"
}
variable "failed_listjobs_rate_timeframe" { variable "failed_listjobs_rate_timeframe" {
description = "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`]" description = "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`]"
type = "string" type = "string"
@ -142,6 +172,12 @@ variable "failed_queryjobs_rate_message" {
default = "" default = ""
} }
variable "failed_queryjobs_rate_aggregator" {
description = "Monitor aggregator for IoT Hub failed query jobs [available values: min, max, sum or avg]"
type = "string"
default = "sum"
}
variable "failed_queryjobs_rate_timeframe" { variable "failed_queryjobs_rate_timeframe" {
description = "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`]" description = "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`]"
type = "string" type = "string"
@ -170,6 +206,12 @@ variable "failed_c2d_methods_rate_message" {
default = "" default = ""
} }
variable "failed_c2d_methods_rate_aggregator" {
description = "Monitor aggregator for IoT Hub failed c2d method [available values: min, max, sum or avg]"
type = "string"
default = "sum"
}
variable "failed_c2d_methods_rate_timeframe" { variable "failed_c2d_methods_rate_timeframe" {
description = "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`]" description = "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`]"
type = "string" type = "string"
@ -198,6 +240,12 @@ variable "failed_c2d_twin_read_rate_message" {
default = "" default = ""
} }
variable "failed_c2d_twin_read_rate_aggregator" {
description = "Monitor aggregator for IoT Hub failed c2d twin read [available values: min, max, sum or avg]"
type = "string"
default = "sum"
}
variable "failed_c2d_twin_read_rate_timeframe" { variable "failed_c2d_twin_read_rate_timeframe" {
description = "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`]" description = "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`]"
type = "string" type = "string"
@ -226,6 +274,12 @@ variable "failed_c2d_twin_update_rate_message" {
default = "" default = ""
} }
variable "failed_c2d_twin_update_rate_aggregator" {
description = "Monitor aggregator for IoT Hub failed c2d twin update [available values: min, max, sum or avg]"
type = "string"
default = "sum"
}
variable "failed_c2d_twin_update_rate_timeframe" { variable "failed_c2d_twin_update_rate_timeframe" {
description = "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`]" description = "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`]"
type = "string" type = "string"
@ -254,6 +308,12 @@ variable "failed_d2c_twin_read_rate_message" {
default = "" default = ""
} }
variable "failed_d2c_twin_read_rate_aggregator" {
description = "Monitor aggregator for IoT Hub failed d2c twin read [available values: min, max, sum or avg]"
type = "string"
default = "sum"
}
variable "failed_d2c_twin_read_rate_timeframe" { variable "failed_d2c_twin_read_rate_timeframe" {
description = "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`]" description = "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`]"
type = "string" type = "string"
@ -282,6 +342,12 @@ variable "failed_d2c_twin_update_rate_message" {
default = "" default = ""
} }
variable "failed_d2c_twin_update_rate_aggregator" {
description = "Monitor aggregator for IoT Hub failed d2c twin update [available values: min, max, sum or avg]"
type = "string"
default = "sum"
}
variable "failed_d2c_twin_update_rate_timeframe" { variable "failed_d2c_twin_update_rate_timeframe" {
description = "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`]" description = "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`]"
type = "string" type = "string"
@ -310,6 +376,12 @@ variable "dropped_d2c_telemetry_egress_message" {
default = "" default = ""
} }
variable "dropped_d2c_telemetry_egress_aggregator" {
description = "Monitor aggregator for IoT Hub failed d2c telemetry [available values: min, max, sum or avg]"
type = "string"
default = "sum"
}
variable "dropped_d2c_telemetry_egress_timeframe" { variable "dropped_d2c_telemetry_egress_timeframe" {
description = "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`]" description = "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`]"
type = "string" type = "string"
@ -338,6 +410,12 @@ variable "orphaned_d2c_telemetry_egress_message" {
default = "" default = ""
} }
variable "orphaned_d2c_telemetry_egress_aggregator" {
description = "Monitor aggregator for IoT Hub orphaned d2c telemetry [available values: min, max, sum or avg]"
type = "string"
default = "sum"
}
variable "orphaned_d2c_telemetry_egress_timeframe" { variable "orphaned_d2c_telemetry_egress_timeframe" {
description = "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`]" description = "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`]"
type = "string" type = "string"
@ -366,6 +444,12 @@ variable "invalid_d2c_telemetry_egress_message" {
default = "" default = ""
} }
variable "invalid_d2c_telemetry_egress_aggregator" {
description = "Monitor aggregator for IoT Hub invalid d2c telemetry [available values: min, max, sum or avg]"
type = "string"
default = "sum"
}
variable "invalid_d2c_telemetry_egress_timeframe" { variable "invalid_d2c_telemetry_egress_timeframe" {
description = "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`]" description = "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`]"
type = "string" type = "string"

View File

@ -3,10 +3,10 @@ resource "datadog_monitor" "too_many_jobs_failed" {
message = "${coalesce(var.failed_jobs_rate_message, var.message)}" message = "${coalesce(var.failed_jobs_rate_message, var.message)}"
query = <<EOF query = <<EOF
sum(${var.failed_jobs_rate_timeframe}):( ${var.failed_jobs_rate_aggregator}(${var.failed_jobs_rate_timeframe}):(
avg:azure.devices_iothubs.jobs.failed{${var.filter_tags}} by {resource_group,region,name}.as_count() / ${var.failed_jobs_rate_aggregator}:azure.devices_iothubs.jobs.failed{${var.filter_tags}} by {resource_group,region,name}.as_count() /
( avg:azure.devices_iothubs.jobs.failed{${var.filter_tags}} by {resource_group,region,name}.as_count() + ( ${var.failed_jobs_rate_aggregator}:azure.devices_iothubs.jobs.failed{${var.filter_tags}} by {resource_group,region,name}.as_count() +
avg:azure.devices_iothubs.jobs.completed{${var.filter_tags}} by {resource_group,region,name}.as_count() ) ${var.failed_jobs_rate_aggregator}:azure.devices_iothubs.jobs.completed{${var.filter_tags}} by {resource_group,region,name}.as_count() )
) * 100 > ${var.failed_jobs_rate_threshold_critical} ) * 100 > ${var.failed_jobs_rate_threshold_critical}
EOF EOF
@ -37,10 +37,10 @@ resource "datadog_monitor" "too_many_list_jobs_failed" {
message = "${coalesce(var.failed_listjobs_rate_message, var.message)}" message = "${coalesce(var.failed_listjobs_rate_message, var.message)}"
query = <<EOF query = <<EOF
sum(${var.failed_listjobs_rate_timeframe}):( ${var.failed_listjobs_rate_aggregator}(${var.failed_listjobs_rate_timeframe}):(
avg:azure.devices_iothubs.jobs.list_jobs.failure{${var.filter_tags}} by {resource_group,name}.as_count() / ${var.failed_listjobs_rate_aggregator}:azure.devices_iothubs.jobs.list_jobs.failure{${var.filter_tags}} by {resource_group,name}.as_count() /
( avg:azure.devices_iothubs.jobs.list_jobs.success{${var.filter_tags}} by {resource_group,name}.as_count() + ( ${var.failed_listjobs_rate_aggregator}:azure.devices_iothubs.jobs.list_jobs.success{${var.filter_tags}} by {resource_group,name}.as_count() +
avg:azure.devices_iothubs.jobs.list_jobs.failure{${var.filter_tags}} by {resource_group,name}.as_count() ) ${var.failed_listjobs_rate_aggregator}:azure.devices_iothubs.jobs.list_jobs.failure{${var.filter_tags}} by {resource_group,name}.as_count() )
) * 100 > ${var.failed_listjobs_rate_threshold_critical} ) * 100 > ${var.failed_listjobs_rate_threshold_critical}
EOF EOF
@ -71,10 +71,10 @@ resource "datadog_monitor" "too_many_query_jobs_failed" {
message = "${coalesce(var.failed_queryjobs_rate_message, var.message)}" message = "${coalesce(var.failed_queryjobs_rate_message, var.message)}"
query = <<EOF query = <<EOF
sum(${var.failed_queryjobs_rate_timeframe}):( ${var.failed_queryjobs_rate_aggregator}(${var.failed_queryjobs_rate_timeframe}):(
avg:azure.devices_iothubs.jobs.query_jobs.failure{${var.filter_tags}} by {resource_group,name}.as_count() / ${var.failed_queryjobs_rate_aggregator}:azure.devices_iothubs.jobs.query_jobs.failure{${var.filter_tags}} by {resource_group,name}.as_count() /
( avg:azure.devices_iothubs.jobs.query_jobs.success{${var.filter_tags}} by {resource_group,name}.as_count() + ( ${var.failed_queryjobs_rate_aggregator}:azure.devices_iothubs.jobs.query_jobs.success{${var.filter_tags}} by {resource_group,name}.as_count() +
avg:azure.devices_iothubs.jobs.query_jobs.failure{${var.filter_tags}} by {resource_group,name}.as_count() ) ${var.failed_queryjobs_rate_aggregator}:azure.devices_iothubs.jobs.query_jobs.failure{${var.filter_tags}} by {resource_group,name}.as_count() )
) * 100 > ${var.failed_queryjobs_rate_threshold_critical} ) * 100 > ${var.failed_queryjobs_rate_threshold_critical}
EOF EOF
@ -105,7 +105,7 @@ resource "datadog_monitor" "status" {
message = "${coalesce(var.status_message, var.message)}" message = "${coalesce(var.status_message, var.message)}"
query = <<EOF query = <<EOF
avg(${var.status_timeframe}):avg:azure.devices_iothubs.status{${var.filter_tags}} by {resource_group,region,name} < 1 ${var.status_aggregator}(${var.status_timeframe}):avg:azure.devices_iothubs.status{${var.filter_tags}} by {resource_group,region,name} < 1
EOF EOF
type = "metric alert" type = "metric alert"
@ -130,7 +130,7 @@ resource "datadog_monitor" "total_devices" {
message = "${coalesce(var.total_devices_message, var.message)}" message = "${coalesce(var.total_devices_message, var.message)}"
query = <<EOF query = <<EOF
avg(${var.total_devices_timeframe}):avg:azure.devices_iothubs.devices.total_devices{${var.filter_tags}} by {resource_group,region,name} == 0 ${var.total_devices_aggregator}(${var.total_devices_timeframe}):avg:azure.devices_iothubs.devices.total_devices{${var.filter_tags}} by {resource_group,region,name} == 0
EOF EOF
type = "metric alert" type = "metric alert"
@ -155,10 +155,10 @@ resource "datadog_monitor" "too_many_c2d_methods_failed" {
message = "${coalesce(var.failed_c2d_methods_rate_message, var.message)}" message = "${coalesce(var.failed_c2d_methods_rate_message, var.message)}"
query = <<EOF query = <<EOF
sum(${var.failed_c2d_methods_rate_timeframe}):( ${var.failed_c2d_methods_rate_aggregator}(${var.failed_c2d_methods_rate_timeframe}):(
avg:azure.devices_iothubs.c2d.methods.failure{${var.filter_tags}} by {resource_group,region,name}.as_count() / ${var.failed_c2d_methods_rate_aggregator}:azure.devices_iothubs.c2d.methods.failure{${var.filter_tags}} by {resource_group,region,name}.as_count() /
( avg:azure.devices_iothubs.c2d.methods.failure{${var.filter_tags}} by {resource_group,region,name}.as_count() + ( ${var.failed_c2d_methods_rate_aggregator}:azure.devices_iothubs.c2d.methods.failure{${var.filter_tags}} by {resource_group,region,name}.as_count() +
avg:azure.devices_iothubs.c2d.methods.success{${var.filter_tags}} by {resource_group,region,name}.as_count() ) ${var.failed_c2d_methods_rate_aggregator}:azure.devices_iothubs.c2d.methods.success{${var.filter_tags}} by {resource_group,region,name}.as_count() )
) * 100 > ${var.failed_c2d_methods_rate_threshold_critical} ) * 100 > ${var.failed_c2d_methods_rate_threshold_critical}
EOF EOF
@ -189,10 +189,10 @@ resource "datadog_monitor" "too_many_c2d_twin_read_failed" {
message = "${coalesce(var.failed_c2d_twin_read_rate_message, var.message)}" message = "${coalesce(var.failed_c2d_twin_read_rate_message, var.message)}"
query = <<EOF query = <<EOF
sum(${var.failed_c2d_twin_read_rate_timeframe}):( ${var.failed_c2d_twin_read_rate_aggregator}(${var.failed_c2d_twin_read_rate_timeframe}):(
avg:azure.devices_iothubs.c2d.twin.read.failure{${var.filter_tags}} by {resource_group,region,name}.as_count() / ${var.failed_c2d_twin_read_rate_aggregator}:azure.devices_iothubs.c2d.twin.read.failure{${var.filter_tags}} by {resource_group,region,name}.as_count() /
( avg:azure.devices_iothubs.c2d.twin.read.failure{${var.filter_tags}} by {resource_group,region,name}.as_count() + ( ${var.failed_c2d_twin_read_rate_aggregator}:azure.devices_iothubs.c2d.twin.read.failure{${var.filter_tags}} by {resource_group,region,name}.as_count() +
avg:azure.devices_iothubs.c2d.twin.read.success{${var.filter_tags}} by {resource_group,region,name}.as_count() ) ${var.failed_c2d_twin_read_rate_aggregator}:azure.devices_iothubs.c2d.twin.read.success{${var.filter_tags}} by {resource_group,region,name}.as_count() )
) * 100 > ${var.failed_c2d_twin_read_rate_threshold_critical} ) * 100 > ${var.failed_c2d_twin_read_rate_threshold_critical}
EOF EOF
@ -223,10 +223,10 @@ resource "datadog_monitor" "too_many_c2d_twin_update_failed" {
message = "${coalesce(var.failed_c2d_twin_update_rate_message, var.message)}" message = "${coalesce(var.failed_c2d_twin_update_rate_message, var.message)}"
query = <<EOF query = <<EOF
sum(${var.failed_c2d_twin_update_rate_timeframe}):( ${var.failed_c2d_twin_update_rate_aggregator}(${var.failed_c2d_twin_update_rate_timeframe}):(
avg:azure.devices_iothubs.c2d.twin.update.failure{${var.filter_tags}} by {resource_group,region,name}.as_count() / ${var.failed_c2d_twin_update_rate_aggregator}:azure.devices_iothubs.c2d.twin.update.failure{${var.filter_tags}} by {resource_group,region,name}.as_count() /
( avg:azure.devices_iothubs.c2d.twin.update.failure{${var.filter_tags}} by {resource_group,region,name}.as_count() + ( ${var.failed_c2d_twin_update_rate_aggregator}:azure.devices_iothubs.c2d.twin.update.failure{${var.filter_tags}} by {resource_group,region,name}.as_count() +
avg:azure.devices_iothubs.c2d.twin.update.success{${var.filter_tags}} by {resource_group,region,name}.as_count() ) ${var.failed_c2d_twin_update_rate_aggregator}:azure.devices_iothubs.c2d.twin.update.success{${var.filter_tags}} by {resource_group,region,name}.as_count() )
) * 100 > ${var.failed_c2d_twin_update_rate_threshold_critical} ) * 100 > ${var.failed_c2d_twin_update_rate_threshold_critical}
EOF EOF
@ -257,10 +257,10 @@ resource "datadog_monitor" "too_many_d2c_twin_read_failed" {
message = "${coalesce(var.failed_d2c_twin_read_rate_message, var.message)}" message = "${coalesce(var.failed_d2c_twin_read_rate_message, var.message)}"
query = <<EOF query = <<EOF
sum(${var.failed_d2c_twin_read_rate_timeframe}):( ${var.failed_d2c_twin_read_rate_aggregator}(${var.failed_d2c_twin_read_rate_timeframe}):(
avg:azure.devices_iothubs.d2c.twin.read.failure{${var.filter_tags}} by {resource_group,region,name}.as_count() / ${var.failed_d2c_twin_read_rate_aggregator}:azure.devices_iothubs.d2c.twin.read.failure{${var.filter_tags}} by {resource_group,region,name}.as_count() /
( avg:azure.devices_iothubs.d2c.twin.read.failure{${var.filter_tags}} by {resource_group,region,name}.as_count() + ( ${var.failed_d2c_twin_read_rate_aggregator}:azure.devices_iothubs.d2c.twin.read.failure{${var.filter_tags}} by {resource_group,region,name}.as_count() +
avg:azure.devices_iothubs.d2c.twin.read.success{${var.filter_tags}} by {resource_group,region,name}.as_count() ) ${var.failed_d2c_twin_read_rate_aggregator}:azure.devices_iothubs.d2c.twin.read.success{${var.filter_tags}} by {resource_group,region,name}.as_count() )
) * 100 > ${var.failed_d2c_twin_read_rate_threshold_critical} ) * 100 > ${var.failed_d2c_twin_read_rate_threshold_critical}
EOF EOF
@ -291,10 +291,10 @@ resource "datadog_monitor" "too_many_d2c_twin_update_failed" {
message = "${coalesce(var.failed_d2c_twin_update_rate_message, var.message)}" message = "${coalesce(var.failed_d2c_twin_update_rate_message, var.message)}"
query = <<EOF query = <<EOF
sum(${var.failed_d2c_twin_update_rate_timeframe}):( ${var.failed_d2c_twin_update_rate_aggregator}(${var.failed_d2c_twin_update_rate_timeframe}):(
avg:azure.devices_iothubs.d2c.twin.update.failure{${var.filter_tags}} by {resource_group,region,name}.as_count() / ${var.failed_d2c_twin_update_rate_aggregator}:azure.devices_iothubs.d2c.twin.update.failure{${var.filter_tags}} by {resource_group,region,name}.as_count() /
( avg:azure.devices_iothubs.d2c.twin.update.failure{${var.filter_tags}} by {resource_group,region,name}.as_count() + ( ${var.failed_d2c_twin_update_rate_aggregator}:azure.devices_iothubs.d2c.twin.update.failure{${var.filter_tags}} by {resource_group,region,name}.as_count() +
avg:azure.devices_iothubs.d2c.twin.update.success{${var.filter_tags}} by {resource_group,region,name}.as_count() ) ${var.failed_d2c_twin_update_rate_aggregator}:azure.devices_iothubs.d2c.twin.update.success{${var.filter_tags}} by {resource_group,region,name}.as_count() )
) * 100 > ${var.failed_d2c_twin_update_rate_threshold_critical} ) * 100 > ${var.failed_d2c_twin_update_rate_threshold_critical}
EOF EOF
@ -325,12 +325,12 @@ resource "datadog_monitor" "too_many_d2c_telemetry_egress_dropped" {
message = "${coalesce(var.dropped_d2c_telemetry_egress_message, var.message)}" message = "${coalesce(var.dropped_d2c_telemetry_egress_message, var.message)}"
query = <<EOF query = <<EOF
sum(${var.dropped_d2c_telemetry_egress_timeframe}): ( ${var.dropped_d2c_telemetry_egress_aggregator}(${var.dropped_d2c_telemetry_egress_timeframe}): (
avg:azure.devices_iothubs.d2c.telemetry.egress.dropped{${var.filter_tags}} by {resource_group,region,name}.as_count() / ${var.dropped_d2c_telemetry_egress_aggregator}:azure.devices_iothubs.d2c.telemetry.egress.dropped{${var.filter_tags}} by {resource_group,region,name}.as_count() /
(avg:azure.devices_iothubs.d2c.telemetry.egress.dropped{${var.filter_tags}} by {resource_group,region,name}.as_count() + (${var.dropped_d2c_telemetry_egress_aggregator}:azure.devices_iothubs.d2c.telemetry.egress.dropped{${var.filter_tags}} by {resource_group,region,name}.as_count() +
avg:azure.devices_iothubs.d2c.telemetry.egress.orphaned{${var.filter_tags}} by {resource_group,region,name}.as_count() + ${var.dropped_d2c_telemetry_egress_aggregator}:azure.devices_iothubs.d2c.telemetry.egress.orphaned{${var.filter_tags}} by {resource_group,region,name}.as_count() +
avg:azure.devices_iothubs.d2c.telemetry.egress.invalid{${var.filter_tags}} by {resource_group,region,name}.as_count() + ${var.dropped_d2c_telemetry_egress_aggregator}:azure.devices_iothubs.d2c.telemetry.egress.invalid{${var.filter_tags}} by {resource_group,region,name}.as_count() +
avg:azure.devices_iothubs.d2c.telemetry.egress.success{${var.filter_tags}} by {resource_group,region,name}.as_count()) ${var.dropped_d2c_telemetry_egress_aggregator}:azure.devices_iothubs.d2c.telemetry.egress.success{${var.filter_tags}} by {resource_group,region,name}.as_count())
* 100 * 100
) > ${var.dropped_d2c_telemetry_egress_rate_threshold_critical} ) > ${var.dropped_d2c_telemetry_egress_rate_threshold_critical}
EOF EOF
@ -362,12 +362,12 @@ resource "datadog_monitor" "too_many_d2c_telemetry_egress_orphaned" {
message = "${coalesce(var.orphaned_d2c_telemetry_egress_message, var.message)}" message = "${coalesce(var.orphaned_d2c_telemetry_egress_message, var.message)}"
query = <<EOF query = <<EOF
sum(${var.orphaned_d2c_telemetry_egress_timeframe}): ( ${var.orphaned_d2c_telemetry_egress_aggregator}(${var.orphaned_d2c_telemetry_egress_timeframe}): (
avg:azure.devices_iothubs.d2c.telemetry.egress.orphaned{${var.filter_tags}} by {resource_group,region,name}.as_count() / ${var.orphaned_d2c_telemetry_egress_aggregator}:azure.devices_iothubs.d2c.telemetry.egress.orphaned{${var.filter_tags}} by {resource_group,region,name}.as_count() /
(avg:azure.devices_iothubs.d2c.telemetry.egress.dropped{${var.filter_tags}} by {resource_group,region,name}.as_count() + (${var.orphaned_d2c_telemetry_egress_aggregator}:azure.devices_iothubs.d2c.telemetry.egress.dropped{${var.filter_tags}} by {resource_group,region,name}.as_count() +
avg:azure.devices_iothubs.d2c.telemetry.egress.orphaned{${var.filter_tags}} by {resource_group,region,name}.as_count() + ${var.orphaned_d2c_telemetry_egress_aggregator}:azure.devices_iothubs.d2c.telemetry.egress.orphaned{${var.filter_tags}} by {resource_group,region,name}.as_count() +
avg:azure.devices_iothubs.d2c.telemetry.egress.invalid{${var.filter_tags}} by {resource_group,region,name}.as_count() + ${var.orphaned_d2c_telemetry_egress_aggregator}:azure.devices_iothubs.d2c.telemetry.egress.invalid{${var.filter_tags}} by {resource_group,region,name}.as_count() +
avg:azure.devices_iothubs.d2c.telemetry.egress.success{${var.filter_tags}} by {resource_group,region,name}.as_count()) ${var.orphaned_d2c_telemetry_egress_aggregator}:azure.devices_iothubs.d2c.telemetry.egress.success{${var.filter_tags}} by {resource_group,region,name}.as_count())
* 100 * 100
) > ${var.orphaned_d2c_telemetry_egress_rate_threshold_critical} ) > ${var.orphaned_d2c_telemetry_egress_rate_threshold_critical}
EOF EOF
@ -399,12 +399,12 @@ resource "datadog_monitor" "too_many_d2c_telemetry_egress_invalid" {
message = "${coalesce(var.invalid_d2c_telemetry_egress_message, var.message)}" message = "${coalesce(var.invalid_d2c_telemetry_egress_message, var.message)}"
query = <<EOF query = <<EOF
sum(${var.invalid_d2c_telemetry_egress_timeframe}): ( ${var.invalid_d2c_telemetry_egress_aggregator}(${var.invalid_d2c_telemetry_egress_timeframe}): (
avg:azure.devices_iothubs.d2c.telemetry.egress.invalid{${var.filter_tags}} by {resource_group,region,name}.as_count() / ${var.invalid_d2c_telemetry_egress_aggregator}:azure.devices_iothubs.d2c.telemetry.egress.invalid{${var.filter_tags}} by {resource_group,region,name}.as_count() /
(avg:azure.devices_iothubs.d2c.telemetry.egress.dropped{${var.filter_tags}} by {resource_group,region,name}.as_count() + (${var.invalid_d2c_telemetry_egress_aggregator}:azure.devices_iothubs.d2c.telemetry.egress.dropped{${var.filter_tags}} by {resource_group,region,name}.as_count() +
avg:azure.devices_iothubs.d2c.telemetry.egress.orphaned{${var.filter_tags}} by {resource_group,region,name}.as_count() + ${var.invalid_d2c_telemetry_egress_aggregator}:azure.devices_iothubs.d2c.telemetry.egress.orphaned{${var.filter_tags}} by {resource_group,region,name}.as_count() +
avg:azure.devices_iothubs.d2c.telemetry.egress.invalid{${var.filter_tags}} by {resource_group,region,name}.as_count() + ${var.invalid_d2c_telemetry_egress_aggregator}:azure.devices_iothubs.d2c.telemetry.egress.invalid{${var.filter_tags}} by {resource_group,region,name}.as_count() +
avg:azure.devices_iothubs.d2c.telemetry.egress.success{${var.filter_tags}} by {resource_group,region,name}.as_count()) ${var.invalid_d2c_telemetry_egress_aggregator}:azure.devices_iothubs.d2c.telemetry.egress.success{${var.filter_tags}} by {resource_group,region,name}.as_count())
* 100 * 100
) > ${var.invalid_d2c_telemetry_egress_rate_threshold_critical} ) > ${var.invalid_d2c_telemetry_egress_rate_threshold_critical}
EOF EOF
@ -436,9 +436,9 @@ resource "datadog_monitor" "too_many_d2c_telemetry_ingress_nosent" {
message = "${coalesce(var.too_many_d2c_telemetry_ingress_nosent_message, var.message)}" message = "${coalesce(var.too_many_d2c_telemetry_ingress_nosent_message, var.message)}"
query = <<EOF query = <<EOF
sum(${var.too_many_d2c_telemetry_ingress_nosent_timeframe}): ( ${var.too_many_d2c_telemetry_ingress_nosent_aggregator}(${var.too_many_d2c_telemetry_ingress_nosent_timeframe}): (
avg:azure.devices_iothubs.d2c.telemetry.ingress.all_protocol{${var.filter_tags}} by {resource_group,region,name}.as_count() - ${var.too_many_d2c_telemetry_ingress_nosent_aggregator}:azure.devices_iothubs.d2c.telemetry.ingress.all_protocol{${var.filter_tags}} by {resource_group,region,name}.as_count() -
avg:azure.devices_iothubs.d2c.telemetry.ingress.success{${var.filter_tags}} by {resource_group,region,name}.as_count() ${var.too_many_d2c_telemetry_ingress_nosent_aggregator}:azure.devices_iothubs.d2c.telemetry.ingress.success{${var.filter_tags}} by {resource_group,region,name}.as_count()
) > 0 ) > 0
EOF EOF

View File

@ -29,6 +29,7 @@ Inputs
|------|-------------|:----:|:-----:|:-----:| |------|-------------|:----:|:-----:|:-----:|
| delay | Delay in seconds for the metric evaluation | string | `900` | no | | delay | Delay in seconds for the metric evaluation | string | `900` | no |
| environment | Architecture environment | string | - | yes | | environment | Architecture environment | string | - | yes |
| evictedkeys_limit_aggregator | Monitor aggregator for Redis evicted keys [available values: min, max, sum or avg] | string | `avg` | no |
| evictedkeys_limit_message | Custom message for Redis evicted keys monitor | string | `` | 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 | `<map>` | no | | evictedkeys_limit_silenced | Groups to mute for Redis evicted keys monitor | map | `<map>` | no |
| evictedkeys_limit_threshold_critical | Evicted keys limit (critical threshold) | string | `100` | no | | evictedkeys_limit_threshold_critical | Evicted keys limit (critical threshold) | string | `100` | no |
@ -37,16 +38,19 @@ Inputs
| filter_tags_custom | Tags used for custom filtering when filter_tags_use_defaults is false | string | `*` | 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 | | filter_tags_use_defaults | Use default filter tags convention | string | `true` | no |
| message | Message sent when a Redis monitor is triggered | string | - | yes | | message | Message sent when a Redis monitor is triggered | string | - | yes |
| percent_processor_time_aggregator | Monitor aggregator for Redis processor [available values: min, max, sum or avg] | string | `avg` | no |
| percent_processor_time_message | Custom message for Redis processor monitor | string | `` | 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 | `<map>` | no | | percent_processor_time_silenced | Groups to mute for Redis processor monitor | map | `<map>` | no |
| percent_processor_time_threshold_critical | Processor time percent (critical threshold) | string | `80` | no | | percent_processor_time_threshold_critical | Processor time percent (critical threshold) | string | `80` | no |
| percent_processor_time_threshold_warning | Processor time percent (warning threshold) | string | `60` | no | | percent_processor_time_threshold_warning | Processor time percent (warning threshold) | string | `60` | 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 | | 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_aggregator | Monitor aggregator for Redis server load [available values: min, max, sum or avg] | string | `avg` | no |
| server_load_rate_message | Custom message for Redis server load monitor | string | `` | 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 | `<map>` | no | | server_load_rate_silenced | Groups to mute for Redis server load monitor | map | `<map>` | no |
| server_load_rate_threshold_critical | Server CPU load rate (critical threshold) | string | `90` | no | | server_load_rate_threshold_critical | Server CPU load rate (critical threshold) | string | `90` | no |
| server_load_rate_threshold_warning | Server CPU load rate (warning threshold) | string | `70` | no | | server_load_rate_threshold_warning | Server CPU load rate (warning threshold) | string | `70` | 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 | | 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_aggregator | Monitor aggregator for Redis status [available values: min, max, sum or avg] | string | `avg` | no |
| status_message | Custom message for Redis status monitor | string | `` | no | | status_message | Custom message for Redis status monitor | string | `` | no |
| status_silenced | Groups to mute for Redis status monitor | map | `<map>` | no | | status_silenced | Groups to mute for Redis status monitor | map | `<map>` | no |
| status_timeframe | Monitor timeframe for Redis status [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | | status_timeframe | Monitor timeframe for Redis status [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no |

View File

@ -37,6 +37,12 @@ variable "status_message" {
default = "" default = ""
} }
variable "status_aggregator" {
description = "Monitor aggregator for Redis status [available values: min, max, sum or avg]"
type = "string"
default = "avg"
}
variable "status_timeframe" { variable "status_timeframe" {
description = "Monitor timeframe for Redis status [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]" description = "Monitor timeframe for Redis status [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]"
type = "string" type = "string"
@ -55,6 +61,12 @@ variable "evictedkeys_limit_message" {
default = "" default = ""
} }
variable "evictedkeys_limit_aggregator" {
description = "Monitor aggregator for Redis evicted keys [available values: min, max, sum or avg]"
type = "string"
default = "avg"
}
variable "evictedkeys_limit_timeframe" { variable "evictedkeys_limit_timeframe" {
description = "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`]" description = "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`]"
type = "string" type = "string"
@ -83,6 +95,12 @@ variable "percent_processor_time_message" {
default = "" default = ""
} }
variable "percent_processor_time_aggregator" {
description = "Monitor aggregator for Redis processor [available values: min, max, sum or avg]"
type = "string"
default = "avg"
}
variable "percent_processor_time_timeframe" { variable "percent_processor_time_timeframe" {
description = "Monitor timeframe for Redis processor [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]" description = "Monitor timeframe for Redis processor [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]"
type = "string" type = "string"
@ -111,6 +129,12 @@ variable "server_load_rate_message" {
default = "" default = ""
} }
variable "server_load_rate_aggregator" {
description = "Monitor aggregator for Redis server load [available values: min, max, sum or avg]"
type = "string"
default = "avg"
}
variable "server_load_rate_timeframe" { variable "server_load_rate_timeframe" {
description = "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`]" description = "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`]"
type = "string" type = "string"

View File

@ -100,8 +100,8 @@ resource "datadog_monitor" "server_load" {
message = "${coalesce(var.server_load_rate_message, var.message)}" message = "${coalesce(var.server_load_rate_message, var.message)}"
query = <<EOF query = <<EOF
avg(${var.server_load_rate_timeframe}): ( ${var.server_load_rate_aggregator}(${var.server_load_rate_timeframe}): (
avg:azure.cache_redis.server_load{${data.template_file.filter.rendered}} by {resource_group,region,name} ${var.server_load_rate_aggregator}:azure.cache_redis.server_load{${data.template_file.filter.rendered}} by {resource_group,region,name}
) > ${var.server_load_rate_threshold_critical} ) > ${var.server_load_rate_threshold_critical}
EOF EOF

View File

@ -27,21 +27,25 @@ Inputs
| Name | Description | Type | Default | Required | | Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:| |------|-------------|:----:|:-----:|:-----:|
| cpu_aggregator | Monitor aggregator for SQL CPU [available values: min, max, sum or avg] | string | `avg` | no |
| cpu_message | Custom message for SQL CPU monitor | string | `` | no | | cpu_message | Custom message for SQL CPU monitor | string | `` | no |
| cpu_silenced | Groups to mute for SQL CPU monitor | map | `<map>` | no | | cpu_silenced | Groups to mute for SQL CPU monitor | map | `<map>` | no |
| cpu_threshold_critical | CPU usage in percent (critical threshold) | string | `90` | no | | cpu_threshold_critical | CPU usage in percent (critical threshold) | string | `90` | no |
| cpu_threshold_warning | CPU usage in percent (warning threshold) | string | `80` | no | | cpu_threshold_warning | CPU usage in percent (warning threshold) | string | `80` | 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 | | 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_aggregator | Monitor aggregator for SQL Deadlock [available values: min, max, sum or avg] | string | `sum` | no |
| deadlock_message | Custom message for SQL Deadlock monitor | string | `` | no | | deadlock_message | Custom message for SQL Deadlock monitor | string | `` | no |
| deadlock_silenced | Groups to mute for SQL Deadlock monitor | map | `<map>` | no | | deadlock_silenced | Groups to mute for SQL Deadlock monitor | map | `<map>` | no |
| deadlock_threshold_critical | Amount of Deadlocks (critical threshold) | string | `1` | 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 | | 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 |
| delay | Delay in seconds for the metric evaluation | string | `900` | no | | delay | Delay in seconds for the metric evaluation | string | `900` | no |
| diskspace_aggregator | Monitor aggregator for SQL disk space [available values: min, max, sum or avg] | string | `avg` | no |
| diskspace_message | Custom message for SQL disk space monitor | string | `` | no | | diskspace_message | Custom message for SQL disk space monitor | string | `` | no |
| diskspace_silenced | Groups to mute for SQL disk space monitor | map | `<map>` | no | | diskspace_silenced | Groups to mute for SQL disk space monitor | map | `<map>` | no |
| diskspace_threshold_critical | Disk space used in percent (critical threshold) | string | `90` | no | | diskspace_threshold_critical | Disk space used in percent (critical threshold) | string | `90` | no |
| diskspace_threshold_warning | Disk space used in percent (warning threshold) | string | `80` | no | | diskspace_threshold_warning | Disk space used in percent (warning threshold) | string | `80` | 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 | | 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_aggregator | Monitor aggregator for SQL DTU [available values: min, max, sum or avg] | string | `avg` | no |
| dtu_message | Custom message for SQL DTU monitor | string | `` | no | | dtu_message | Custom message for SQL DTU monitor | string | `` | no |
| dtu_silenced | Groups to mute for SQL DTU monitor | map | `<map>` | no | | dtu_silenced | Groups to mute for SQL DTU monitor | map | `<map>` | no |
| dtu_threshold_critical | Amount of DTU used (critical threshold) | string | `90` | no | | dtu_threshold_critical | Amount of DTU used (critical threshold) | string | `90` | no |

View File

@ -37,6 +37,12 @@ variable "cpu_message" {
default = "" default = ""
} }
variable "cpu_aggregator" {
description = "Monitor aggregator for SQL CPU [available values: min, max, sum or avg]"
type = "string"
default = "avg"
}
variable "cpu_timeframe" { variable "cpu_timeframe" {
description = "Monitor timeframe for SQL CPU [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]" description = "Monitor timeframe for SQL CPU [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]"
type = "string" type = "string"
@ -65,6 +71,12 @@ variable "diskspace_message" {
default = "" default = ""
} }
variable "diskspace_aggregator" {
description = "Monitor aggregator for SQL disk space [available values: min, max, sum or avg]"
type = "string"
default = "avg"
}
variable "diskspace_timeframe" { variable "diskspace_timeframe" {
description = "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`]" description = "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`]"
type = "string" type = "string"
@ -93,6 +105,12 @@ variable "dtu_message" {
default = "" default = ""
} }
variable "dtu_aggregator" {
description = "Monitor aggregator for SQL DTU [available values: min, max, sum or avg]"
type = "string"
default = "avg"
}
variable "dtu_timeframe" { variable "dtu_timeframe" {
description = "Monitor timeframe for SQL DTU [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]" description = "Monitor timeframe for SQL DTU [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]"
type = "string" type = "string"
@ -121,6 +139,12 @@ variable "deadlock_message" {
default = "" default = ""
} }
variable "deadlock_aggregator" {
description = "Monitor aggregator for SQL Deadlock [available values: min, max, sum or avg]"
type = "string"
default = "sum"
}
variable "deadlock_timeframe" { variable "deadlock_timeframe" {
description = "Monitor timeframe for SQL Deadlock [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]" description = "Monitor timeframe for SQL Deadlock [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]"
type = "string" type = "string"

View File

@ -11,8 +11,8 @@ resource "datadog_monitor" "sql-database_cpu_90_15min" {
message = "${coalesce(var.cpu_message, var.message)}" message = "${coalesce(var.cpu_message, var.message)}"
query = <<EOF query = <<EOF
avg(${var.cpu_timeframe}): ( ${var.cpu_aggregator}(${var.cpu_timeframe}): (
avg:azure.sql_servers_databases.cpu_percent{${data.template_file.filter.rendered}} by {resource_group,region,name} ${var.cpu_aggregator}:azure.sql_servers_databases.cpu_percent{${data.template_file.filter.rendered}} by {resource_group,region,name}
) > ${var.cpu_threshold_critical} ) > ${var.cpu_threshold_critical}
EOF EOF
@ -44,8 +44,8 @@ resource "datadog_monitor" "sql-database_free_space_low" {
type = "metric alert" type = "metric alert"
query = <<EOF query = <<EOF
avg(${var.diskspace_timeframe}): ( ${var.diskspace_aggregator}(${var.diskspace_timeframe}): (
avg:azure.sql_servers_databases.storage_percent{${data.template_file.filter.rendered}} by {resource_group,region,name} ${var.diskspace_aggregator}:azure.sql_servers_databases.storage_percent{${data.template_file.filter.rendered}} by {resource_group,region,name}
) > ${var.diskspace_threshold_critical} ) > ${var.diskspace_threshold_critical}
EOF EOF
@ -76,7 +76,7 @@ resource "datadog_monitor" "sql-database_dtu_consumption_high" {
type = "metric alert" type = "metric alert"
query = <<EOF query = <<EOF
avg(${var.dtu_timeframe}): ( ${var.dtu_aggregator}(${var.dtu_timeframe}): (
azure.sql_servers_databases.dtu_consumption_percent{${data.template_file.filter.rendered}} by {resource_group,region,name} azure.sql_servers_databases.dtu_consumption_percent{${data.template_file.filter.rendered}} by {resource_group,region,name}
) > ${var.dtu_threshold_critical} ) > ${var.dtu_threshold_critical}
EOF EOF
@ -108,8 +108,8 @@ resource "datadog_monitor" "sql-database_deadlocks_count" {
type = "metric alert" type = "metric alert"
query = <<EOF query = <<EOF
sum(${var.deadlock_timeframe}): ( ${var.deadlock_aggregator}(${var.deadlock_timeframe}): (
avg:azure.sql_servers_databases.deadlock{${data.template_file.filter.rendered}} by {resource_group,region,name}.as_count() ${var.deadlock_aggregator}:azure.sql_servers_databases.deadlock{${data.template_file.filter.rendered}} by {resource_group,region,name}.as_count()
) > ${var.deadlock_threshold_critical} ) > ${var.deadlock_threshold_critical}
EOF EOF

View File

@ -32,16 +32,19 @@ Inputs
| Name | Description | Type | Default | Required | | Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:| |------|-------------|:----:|:-----:|:-----:|
| authorization_error_requests_aggregator | Monitor aggregator for Storage authorization errors [available values: min, max, sum or avg] | string | `avg` | no |
| authorization_error_requests_message | Custom message for Storage authorization errors monitor | string | `` | 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 | `<map>` | no | | authorization_error_requests_silenced | Groups to mute for Storage authorization errors monitor | map | `<map>` | no |
| authorization_error_requests_threshold_critical | Maximum acceptable percent of authorization error requests for a storage | string | `90` | no | | authorization_error_requests_threshold_critical | Maximum acceptable percent of authorization error requests for a storage | string | `90` | no |
| authorization_error_requests_threshold_warning | Warning regarding acceptable percent of authorization error requests for a storage | string | `50` | no | | authorization_error_requests_threshold_warning | Warning regarding acceptable percent of authorization error requests for a storage | string | `50` | 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 | | 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_aggregator | Monitor aggregator for Storage availability [available values: min, max, sum or avg] | string | `avg` | no |
| availability_message | Custom message for Storage availability monitor | string | `` | no | | availability_message | Custom message for Storage availability monitor | string | `` | no |
| availability_silenced | Groups to mute for Storage availability monitor | map | `<map>` | no | | availability_silenced | Groups to mute for Storage availability monitor | map | `<map>` | no |
| availability_threshold_critical | Minimum acceptable percent of availability for a storage | string | `50` | no | | availability_threshold_critical | Minimum acceptable percent of availability for a storage | string | `50` | no |
| availability_threshold_warning | Warning regarding acceptable percent of availability for a storage | string | `90` | no | | availability_threshold_warning | Warning regarding acceptable percent of availability for a storage | string | `90` | 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 | | 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_aggregator | Monitor aggregator for Storage other errors [available values: min, max, sum or avg] | string | `avg` | no |
| client_other_error_requests_message | Custom message for Storage other errors monitor | string | `` | 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 | `<map>` | no | | client_other_error_requests_silenced | Groups to mute for Storage other errors monitor | map | `<map>` | no |
| client_other_error_requests_threshold_critical | Maximum acceptable percent of client other error requests for a storage | string | `90` | no | | client_other_error_requests_threshold_critical | Maximum acceptable percent of client other error requests for a storage | string | `90` | no |
@ -51,32 +54,38 @@ Inputs
| environment | Architecture environment | string | - | yes | | environment | Architecture environment | string | - | yes |
| filter_tags_custom | Tags used for custom filtering when filter_tags_use_defaults is false | string | `*` | 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 | | filter_tags_use_defaults | Use default filter tags convention | string | `true` | no |
| latency_aggregator | Monitor aggregator for Storage latency [available values: min, max, sum or avg] | string | `min` | no |
| latency_message | Custom message for Storage latency monitor | string | `` | no | | latency_message | Custom message for Storage latency monitor | string | `` | no |
| latency_silenced | Groups to mute for Storage latency monitor | map | `<map>` | no | | latency_silenced | Groups to mute for Storage latency monitor | map | `<map>` | no |
| latency_threshold_critical | Maximum acceptable end to end latency (ms) for a storage | string | `2000` | no | | latency_threshold_critical | Maximum acceptable end to end latency (ms) for a storage | string | `2000` | no |
| latency_threshold_warning | Warning regarding acceptable end to end latency (ms) for a storage | string | `1000` | no | | latency_threshold_warning | Warning regarding acceptable end to end latency (ms) for a storage | string | `1000` | 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 | | 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 | | message | Message sent when a Redis monitor is triggered | string | - | yes |
| network_error_requests_aggregator | Monitor aggregator for Storage network errors [available values: min, max, sum or avg] | string | `avg` | no |
| network_error_requests_message | Custom message for Storage network errors monitor | string | `` | 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 | `<map>` | no | | network_error_requests_silenced | Groups to mute for Storage network errors monitor | map | `<map>` | no |
| network_error_requests_threshold_critical | Maximum acceptable percent of network error requests for a storage | string | `90` | no | | network_error_requests_threshold_critical | Maximum acceptable percent of network error requests for a storage | string | `90` | no |
| network_error_requests_threshold_warning | Warning regarding acceptable percent of network error requests for a storage | string | `50` | no | | network_error_requests_threshold_warning | Warning regarding acceptable percent of network error requests for a storage | string | `50` | 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 | | 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 |
| server_other_error_requests_aggregator | Monitor aggregator for Storage other errors [available values: min, max, sum or avg] | string | `avg` | no |
| server_other_error_requests_message | Custom message for Storage server other errors monitor | string | `` | 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 | `<map>` | no | | server_other_error_requests_silenced | Groups to mute for Storage server other errors monitor | map | `<map>` | no |
| server_other_error_requests_threshold_critical | Maximum acceptable percent of server other error requests for a storage | string | `90` | no | | server_other_error_requests_threshold_critical | Maximum acceptable percent of server other error requests for a storage | string | `90` | no |
| 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_threshold_warning | Warning regarding acceptable percent of server other error requests for a storage | string | `50` | 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 | | 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_aggregator | Monitor aggregator for Storage sucessful requests [available values: min, max, sum or avg] | string | `avg` | no |
| successful_requests_message | Custom message for Storage sucessful requests monitor | string | `` | 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 | `<map>` | no | | successful_requests_silenced | Groups to mute for Storage sucessful requests monitor | map | `<map>` | no |
| successful_requests_threshold_critical | Minimum acceptable percent of successful requests for a storage | string | `10` | no | | successful_requests_threshold_critical | Minimum acceptable percent of successful requests for a storage | string | `10` | no |
| successful_requests_threshold_warning | Warning regarding acceptable percent of successful requests for a storage | string | `30` | no | | successful_requests_threshold_warning | Warning regarding acceptable percent of successful requests for a storage | string | `30` | 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 | | 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_aggregator | Monitor aggregator for Storage throttling errors [available values: min, max, sum or avg] | string | `avg` | no |
| throttling_error_requests_message | Custom message for Storage throttling error monitor | string | `` | 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 | `<map>` | no | | throttling_error_requests_silenced | Groups to mute for Storage throttling error monitor | map | `<map>` | no |
| throttling_error_requests_threshold_critical | Maximum acceptable percent of throttling error requests for a storage | string | `90` | no | | throttling_error_requests_threshold_critical | Maximum acceptable percent of throttling error requests for a storage | string | `90` | no |
| throttling_error_requests_threshold_warning | Warning regarding acceptable percent of throttling error requests for a storage | string | `50` | no | | throttling_error_requests_threshold_warning | Warning regarding acceptable percent of throttling error requests for a storage | string | `50` | 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 | | 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_aggregator | Monitor aggregator for Storage timeout [available values: min, max, sum or avg] | string | `avg` | no |
| timeout_error_requests_message | Custom message for Storage timeout monitor | string | `` | 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 | `<map>` | no | | timeout_error_requests_silenced | Groups to mute for Storage timeout monitor | map | `<map>` | no |
| timeout_error_requests_threshold_critical | Maximum acceptable percent of timeout error requests for a storage | string | `90` | no | | timeout_error_requests_threshold_critical | Maximum acceptable percent of timeout error requests for a storage | string | `90` | no |

View File

@ -37,6 +37,12 @@ variable "availability_message" {
default = "" default = ""
} }
variable "availability_aggregator" {
description = "Monitor aggregator for Storage availability [available values: min, max, sum or avg]"
type = "string"
default = "avg"
}
variable "availability_timeframe" { variable "availability_timeframe" {
description = "Monitor timeframe for Storage availability [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]" description = "Monitor timeframe for Storage availability [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]"
type = "string" type = "string"
@ -65,6 +71,12 @@ variable "successful_requests_message" {
default = "" default = ""
} }
variable "successful_requests_aggregator" {
description = "Monitor aggregator for Storage sucessful requests [available values: min, max, sum or avg]"
type = "string"
default = "avg"
}
variable "successful_requests_timeframe" { variable "successful_requests_timeframe" {
description = "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`]" description = "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`]"
type = "string" type = "string"
@ -93,6 +105,12 @@ variable "latency_message" {
default = "" default = ""
} }
variable "latency_aggregator" {
description = "Monitor aggregator for Storage latency [available values: min, max, sum or avg]"
type = "string"
default = "min"
}
variable "latency_timeframe" { variable "latency_timeframe" {
description = "Monitor timeframe for Storage latency [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]" description = "Monitor timeframe for Storage latency [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]"
type = "string" type = "string"
@ -121,6 +139,12 @@ variable "timeout_error_requests_message" {
default = "" default = ""
} }
variable "timeout_error_requests_aggregator" {
description = "Monitor aggregator for Storage timeout [available values: min, max, sum or avg]"
type = "string"
default = "avg"
}
variable "timeout_error_requests_timeframe" { variable "timeout_error_requests_timeframe" {
description = "Monitor timeframe for Storage timeout [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]" description = "Monitor timeframe for Storage timeout [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]"
type = "string" type = "string"
@ -149,6 +173,12 @@ variable "network_error_requests_message" {
default = "" default = ""
} }
variable "network_error_requests_aggregator" {
description = "Monitor aggregator for Storage network errors [available values: min, max, sum or avg]"
type = "string"
default = "avg"
}
variable "network_error_requests_timeframe" { variable "network_error_requests_timeframe" {
description = "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`]" description = "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`]"
type = "string" type = "string"
@ -177,6 +207,12 @@ variable "throttling_error_requests_message" {
default = "" default = ""
} }
variable "throttling_error_requests_aggregator" {
description = "Monitor aggregator for Storage throttling errors [available values: min, max, sum or avg]"
type = "string"
default = "avg"
}
variable "throttling_error_requests_timeframe" { variable "throttling_error_requests_timeframe" {
description = "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`]" description = "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`]"
type = "string" type = "string"
@ -205,6 +241,12 @@ variable "server_other_error_requests_message" {
default = "" default = ""
} }
variable "server_other_error_requests_aggregator" {
description = "Monitor aggregator for Storage other errors [available values: min, max, sum or avg]"
type = "string"
default = "avg"
}
variable "server_other_error_requests_timeframe" { variable "server_other_error_requests_timeframe" {
description = "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`]" description = "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`]"
type = "string" type = "string"
@ -233,6 +275,12 @@ variable "client_other_error_requests_message" {
default = "" default = ""
} }
variable "client_other_error_requests_aggregator" {
description = "Monitor aggregator for Storage other errors [available values: min, max, sum or avg]"
type = "string"
default = "avg"
}
variable "client_other_error_requests_timeframe" { variable "client_other_error_requests_timeframe" {
description = "Monitor timeframe for Storage other errors [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]" description = "Monitor timeframe for Storage other errors [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]"
type = "string" type = "string"
@ -261,6 +309,12 @@ variable "authorization_error_requests_message" {
default = "" default = ""
} }
variable "authorization_error_requests_aggregator" {
description = "Monitor aggregator for Storage authorization errors [available values: min, max, sum or avg]"
type = "string"
default = "avg"
}
variable "authorization_error_requests_timeframe" { variable "authorization_error_requests_timeframe" {
description = "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`]" description = "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`]"
type = "string" type = "string"

View File

@ -11,8 +11,8 @@ resource "datadog_monitor" "availability" {
message = "${coalesce(var.availability_message, var.message)}" message = "${coalesce(var.availability_message, var.message)}"
query = <<EOF query = <<EOF
avg(${var.availability_timeframe}): (default( ${var.availability_aggregator}(${var.availability_timeframe}): (default(
avg:azure.storage.availability{${data.template_file.filter.rendered},transaction_type:all} by {resource_group,storage_type,name}, ${var.availability_aggregator}:azure.storage.availability{${data.template_file.filter.rendered},transaction_type:all} by {resource_group,storage_type,name},
100)) < ${var.availability_threshold_critical} 100)) < ${var.availability_threshold_critical}
EOF EOF
@ -42,8 +42,8 @@ resource "datadog_monitor" "successful_requests" {
message = "${coalesce(var.successful_requests_message, var.message)}" message = "${coalesce(var.successful_requests_message, var.message)}"
query = <<EOF query = <<EOF
avg(${var.successful_requests_timeframe}): (default( ${var.successful_requests_aggregator}(${var.successful_requests_timeframe}): (default(
avg:azure.storage.percent_success{${data.template_file.filter.rendered},transaction_type:all} by {resource_group,storage_type,name}, ${var.successful_requests_aggregator}:azure.storage.percent_success{${data.template_file.filter.rendered},transaction_type:all} by {resource_group,storage_type,name},
100)) < ${var.successful_requests_threshold_critical} 100)) < ${var.successful_requests_threshold_critical}
EOF EOF
@ -73,8 +73,8 @@ resource "datadog_monitor" "latency" {
message = "${coalesce(var.latency_message, var.message)}" message = "${coalesce(var.latency_message, var.message)}"
query = <<EOF query = <<EOF
min(${var.latency_timeframe}): (default( ${var.latency_aggregator}(${var.latency_timeframe}): (default(
avg:azure.storage.average_e2_e_latency{${data.template_file.filter.rendered},transaction_type:all} by {resource_group,storage_type,name}, ${var.latency_aggregator}:azure.storage.average_e2_e_latency{${data.template_file.filter.rendered},transaction_type:all} by {resource_group,storage_type,name},
0)) > ${var.latency_threshold_critical} 0)) > ${var.latency_threshold_critical}
EOF EOF
@ -104,8 +104,8 @@ resource "datadog_monitor" "timeout_error_requests" {
message = "${coalesce(var.timeout_error_requests_message, var.message)}" message = "${coalesce(var.timeout_error_requests_message, var.message)}"
query = <<EOF query = <<EOF
avg(${var.timeout_error_requests_timeframe}): (default( ${var.timeout_error_requests_aggregator}(${var.timeout_error_requests_timeframe}): (default(
avg:azure.storage.percent_timeout_error{${data.template_file.filter.rendered},transaction_type:all} by {resource_group,storage_type,name}, ${var.timeout_error_requests_aggregator}:azure.storage.percent_timeout_error{${data.template_file.filter.rendered},transaction_type:all} by {resource_group,storage_type,name},
0)) > ${var.timeout_error_requests_threshold_critical} 0)) > ${var.timeout_error_requests_threshold_critical}
EOF EOF
@ -135,8 +135,8 @@ resource "datadog_monitor" "network_error_requests" {
message = "${coalesce(var.network_error_requests_message, var.message)}" message = "${coalesce(var.network_error_requests_message, var.message)}"
query = <<EOF query = <<EOF
avg(${var.network_error_requests_timeframe}): (default( ${var.network_error_requests_aggregator}(${var.network_error_requests_timeframe}): (default(
avg:azure.storage.percent_network_error{${data.template_file.filter.rendered},transaction_type:all} by {resource_group,storage_type,name}, ${var.network_error_requests_aggregator}:azure.storage.percent_network_error{${data.template_file.filter.rendered},transaction_type:all} by {resource_group,storage_type,name},
0)) > ${var.network_error_requests_threshold_critical} 0)) > ${var.network_error_requests_threshold_critical}
EOF EOF
@ -166,8 +166,8 @@ resource "datadog_monitor" "throttling_error_requests" {
message = "${coalesce(var.throttling_error_requests_message, var.message)}" message = "${coalesce(var.throttling_error_requests_message, var.message)}"
query = <<EOF query = <<EOF
avg(${var.throttling_error_requests_timeframe}): (default( ${var.throttling_error_requests_aggregator}(${var.throttling_error_requests_timeframe}): (default(
avg:azure.storage.percent_throttling_error{${data.template_file.filter.rendered},transaction_type:all} by {resource_group,storage_type,name}, ${var.throttling_error_requests_aggregator}:azure.storage.percent_throttling_error{${data.template_file.filter.rendered},transaction_type:all} by {resource_group,storage_type,name},
0)) > ${var.throttling_error_requests_threshold_critical} 0)) > ${var.throttling_error_requests_threshold_critical}
EOF EOF
@ -197,8 +197,8 @@ resource "datadog_monitor" "server_other_error_requests" {
message = "${coalesce(var.server_other_error_requests_message, var.message)}" message = "${coalesce(var.server_other_error_requests_message, var.message)}"
query = <<EOF query = <<EOF
avg(${var.server_other_error_requests_timeframe}): (default( ${var.server_other_error_requests_aggregator}(${var.server_other_error_requests_timeframe}): (default(
avg:azure.storage.percent_server_other_error{${data.template_file.filter.rendered},transaction_type:all} by {resource_group,storage_type,name}, ${var.server_other_error_requests_aggregator}:azure.storage.percent_server_other_error{${data.template_file.filter.rendered},transaction_type:all} by {resource_group,storage_type,name},
0)) > ${var.server_other_error_requests_threshold_critical} 0)) > ${var.server_other_error_requests_threshold_critical}
EOF EOF
@ -228,8 +228,8 @@ resource "datadog_monitor" "client_other_error_requests" {
message = "${coalesce(var.client_other_error_requests_message, var.message)}" message = "${coalesce(var.client_other_error_requests_message, var.message)}"
query = <<EOF query = <<EOF
avg(${var.client_other_error_requests_timeframe}): (default( ${var.client_other_error_requests_aggregator}(${var.client_other_error_requests_timeframe}): (default(
avg:azure.storage.percent_client_other_error{${data.template_file.filter.rendered},transaction_type:all} by {resource_group,storage_type,name}, ${var.client_other_error_requests_aggregator}:azure.storage.percent_client_other_error{${data.template_file.filter.rendered},transaction_type:all} by {resource_group,storage_type,name},
0)) > ${var.client_other_error_requests_threshold_critical} 0)) > ${var.client_other_error_requests_threshold_critical}
EOF EOF
@ -259,8 +259,8 @@ resource "datadog_monitor" "authorization_error_requests" {
message = "${coalesce(var.authorization_error_requests_message, var.message)}" message = "${coalesce(var.authorization_error_requests_message, var.message)}"
query = <<EOF query = <<EOF
avg(${var.authorization_error_requests_timeframe}): (default( ${var.authorization_error_requests_aggregator}(${var.authorization_error_requests_timeframe}): (default(
avg:azure.storage.percent_authorization_error{${data.template_file.filter.rendered},transaction_type:all} by {resource_group,storage_type,name}, ${var.authorization_error_requests_aggregator}:azure.storage.percent_authorization_error{${data.template_file.filter.rendered},transaction_type:all} by {resource_group,storage_type,name},
0)) > ${var.authorization_error_requests_threshold_critical} 0)) > ${var.authorization_error_requests_threshold_critical}
EOF EOF

View File

@ -18,6 +18,7 @@ Inputs
| Name | Description | Type | Default | Required | | Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:| |------|-------------|:----:|:-----:|:-----:|
| conversion_errors_aggregator | Monitor aggregator for Stream Analytics conversion errors [available values: min, max, sum or avg] | string | `avg` | no |
| conversion_errors_message | Custom message for Stream Analytics conversion errors monitor | string | `` | 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 | `<map>` | no | | conversion_errors_silenced | Groups to mute for Stream Analytics conversion errors monitor | map | `<map>` | no |
| conversion_errors_threshold_critical | Conversion errors limit (critical threshold) | string | `10` | no | | conversion_errors_threshold_critical | Conversion errors limit (critical threshold) | string | `10` | no |
@ -25,6 +26,7 @@ Inputs
| 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 | | 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 |
| delay | Delay in seconds for the metric evaluation | string | `900` | no | | delay | Delay in seconds for the metric evaluation | string | `900` | no |
| environment | Architecture environment | string | - | yes | | environment | Architecture environment | string | - | yes |
| failed_function_requests_aggregator | Monitor aggregator for Stream Analytics failed requests [available values: min, max, sum or avg] | string | `sum` | no |
| failed_function_requests_message | Custom message for Stream Analytics failed requests monitor | string | `` | 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 | `<map>` | no | | failed_function_requests_silenced | Groups to mute for Stream Analytics failed requests monitor | map | `<map>` | no |
| failed_function_requests_threshold_critical | Failed Function Request rate limit (critical threshold) | string | `10` | no | | failed_function_requests_threshold_critical | Failed Function Request rate limit (critical threshold) | string | `10` | no |
@ -33,14 +35,17 @@ Inputs
| filter_tags_custom | Tags used for custom filtering when filter_tags_use_defaults is false | string | `*` | 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 | | filter_tags_use_defaults | Use default filter tags convention | string | `true` | no |
| message | Message sent when a Redis monitor is triggered | string | - | yes | | message | Message sent when a Redis monitor is triggered | string | - | yes |
| runtime_errors_aggregator | Monitor aggregator for Stream Analytics runtime errors [available values: min, max, sum or avg] | string | `avg` | no |
| runtime_errors_message | Custom message for Stream Analytics runtime errors monitor | string | `` | 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 | `<map>` | no | | runtime_errors_silenced | Groups to mute for Stream Analytics runtime errors monitor | map | `<map>` | no |
| runtime_errors_threshold_critical | Runtime errors limit (critical threshold) | string | `10` | no | | runtime_errors_threshold_critical | Runtime errors limit (critical threshold) | string | `10` | no |
| runtime_errors_threshold_warning | Runtime errors limit (warning threshold) | string | `0` | no | | runtime_errors_threshold_warning | Runtime errors limit (warning threshold) | string | `0` | 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 | | 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_aggregator | Monitor aggregator for Stream Analytics status [available values: min, max, sum or avg] | string | `avg` | no |
| status_message | Custom message for Stream Analytics status monitor | string | `` | no | | status_message | Custom message for Stream Analytics status monitor | string | `` | no |
| status_silenced | Groups to mute for Stream Analytics status monitor | map | `<map>` | no | | status_silenced | Groups to mute for Stream Analytics status monitor | map | `<map>` | 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 | | 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_aggregator | Monitor aggregator for Stream Analytics utilization [available values: min, max, sum or avg] | string | `avg` | no |
| su_utilization_message | Custom message for Stream Analytics utilization monitor | string | `` | 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 | `<map>` | no | | su_utilization_silenced | Groups to mute for Stream Analytics utilization monitor | map | `<map>` | no |
| su_utilization_threshold_critical | Streaming Unit utilization rate limit (critical threshold) | string | `80` | no | | su_utilization_threshold_critical | Streaming Unit utilization rate limit (critical threshold) | string | `80` | no |

View File

@ -37,6 +37,12 @@ variable "status_message" {
default = "" default = ""
} }
variable "status_aggregator" {
description = "Monitor aggregator for Stream Analytics status [available values: min, max, sum or avg]"
type = "string"
default = "avg"
}
variable "status_timeframe" { variable "status_timeframe" {
description = "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`]" description = "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`]"
type = "string" type = "string"
@ -55,6 +61,12 @@ variable "su_utilization_message" {
default = "" default = ""
} }
variable "su_utilization_aggregator" {
description = "Monitor aggregator for Stream Analytics utilization [available values: min, max, sum or avg]"
type = "string"
default = "avg"
}
variable "su_utilization_timeframe" { variable "su_utilization_timeframe" {
description = "Monitor timeframe for Stream Analytics utilization [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]" description = "Monitor timeframe for Stream Analytics utilization [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]"
type = "string" type = "string"
@ -83,6 +95,12 @@ variable "failed_function_requests_message" {
default = "" default = ""
} }
variable "failed_function_requests_aggregator" {
description = "Monitor aggregator for Stream Analytics failed requests [available values: min, max, sum or avg]"
type = "string"
default = "sum"
}
variable "failed_function_requests_timeframe" { variable "failed_function_requests_timeframe" {
description = "Monitor timeframe for Stream Analytics failed requests [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]" description = "Monitor timeframe for Stream Analytics failed requests [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]"
type = "string" type = "string"
@ -111,6 +129,12 @@ variable "conversion_errors_message" {
default = "" default = ""
} }
variable "conversion_errors_aggregator" {
description = "Monitor aggregator for Stream Analytics conversion errors [available values: min, max, sum or avg]"
type = "string"
default = "avg"
}
variable "conversion_errors_timeframe" { variable "conversion_errors_timeframe" {
description = "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`]" description = "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`]"
type = "string" type = "string"
@ -139,6 +163,12 @@ variable "runtime_errors_message" {
default = "" default = ""
} }
variable "runtime_errors_aggregator" {
description = "Monitor aggregator for Stream Analytics runtime errors [available values: min, max, sum or avg]"
type = "string"
default = "avg"
}
variable "runtime_errors_timeframe" { variable "runtime_errors_timeframe" {
description = "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`]" description = "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`]"
type = "string" type = "string"

View File

@ -11,7 +11,7 @@ resource "datadog_monitor" "status" {
message = "${coalesce(var.status_message, var.message)}" message = "${coalesce(var.status_message, var.message)}"
query = <<EOF query = <<EOF
avg(${var.status_timeframe}):avg:azure.streamanalytics_streamingjobs.status{${data.template_file.filter.rendered}} by {resource_group,region,name} < 1 ${var.status_aggregator}(${var.status_timeframe}):avg:azure.streamanalytics_streamingjobs.status{${data.template_file.filter.rendered}} by {resource_group,region,name} < 1
EOF EOF
type = "metric alert" type = "metric alert"
@ -36,8 +36,8 @@ resource "datadog_monitor" "su_utilization" {
message = "${coalesce(var.su_utilization_message, var.message)}" message = "${coalesce(var.su_utilization_message, var.message)}"
query = <<EOF query = <<EOF
avg(${var.su_utilization_timeframe}): ( ${var.su_utilization_aggregator}(${var.su_utilization_timeframe}): (
avg:azure.streamanalytics_streamingjobs.resource_utilization{${data.template_file.filter.rendered}} by {resource_group,region,name} ${var.su_utilization_aggregator}:azure.streamanalytics_streamingjobs.resource_utilization{${data.template_file.filter.rendered}} by {resource_group,region,name}
) > ${var.su_utilization_threshold_critical} ) > ${var.su_utilization_threshold_critical}
EOF EOF
@ -68,9 +68,9 @@ resource "datadog_monitor" "failed_function_requests" {
message = "${coalesce(var.failed_function_requests_message, var.message)}" message = "${coalesce(var.failed_function_requests_message, var.message)}"
query = <<EOF query = <<EOF
sum(${var.failed_function_requests_timeframe}): ( ${var.failed_function_requests_aggregator}(${var.failed_function_requests_timeframe}): (
avg:azure.streamanalytics_streamingjobs.aml_callout_failed_requests{${data.template_file.filter.rendered}} by {resource_group,region,name}.as_count() / ${var.failed_function_requests_aggregator}:azure.streamanalytics_streamingjobs.aml_callout_failed_requests{${data.template_file.filter.rendered}} by {resource_group,region,name}.as_count() /
avg:azure.streamanalytics_streamingjobs.aml_callout_requests{${data.template_file.filter.rendered}} by {resource_group,region,name}.as_count() ${var.failed_function_requests_aggregator}:azure.streamanalytics_streamingjobs.aml_callout_requests{${data.template_file.filter.rendered}} by {resource_group,region,name}.as_count()
) * 100 > ${var.failed_function_requests_threshold_critical} ) * 100 > ${var.failed_function_requests_threshold_critical}
EOF EOF
@ -101,8 +101,8 @@ resource "datadog_monitor" "conversion_errors" {
message = "${coalesce(var.conversion_errors_message, var.message)}" message = "${coalesce(var.conversion_errors_message, var.message)}"
query = <<EOF query = <<EOF
avg(${var.conversion_errors_timeframe}): ( ${var.conversion_errors_aggregator}(${var.conversion_errors_timeframe}): (
avg:azure.streamanalytics_streamingjobs.conversion_errors{${data.template_file.filter.rendered}} by {resource_group,region,name} ${var.conversion_errors_aggregator}:azure.streamanalytics_streamingjobs.conversion_errors{${data.template_file.filter.rendered}} by {resource_group,region,name}
) > ${var.conversion_errors_threshold_critical} ) > ${var.conversion_errors_threshold_critical}
EOF EOF
@ -133,8 +133,8 @@ resource "datadog_monitor" "runtime_errors" {
message = "${coalesce(var.runtime_errors_message, var.message)}" message = "${coalesce(var.runtime_errors_message, var.message)}"
query = <<EOF query = <<EOF
avg(${var.runtime_errors_timeframe}): ( ${var.runtime_errors_aggregator}(${var.runtime_errors_timeframe}): (
avg:azure.streamanalytics_streamingjobs.errors{${data.template_file.filter.rendered}} by {resource_group,region,name} ${var.runtime_errors_aggregator}:azure.streamanalytics_streamingjobs.errors{${data.template_file.filter.rendered}} by {resource_group,region,name}
) > ${var.runtime_errors_threshold_critical} ) > ${var.runtime_errors_threshold_critical}
EOF EOF