# CLOUD AZURE EVENTGRID DataDog monitors ## How to use this module ```hcl module "datadog-monitors-cloud-azure-eventgrid" { source = "claranet/monitors/datadog//cloud/azure/eventgrid" version = "{revision}" environment = var.environment message = module.datadog-message-alerting.alerting-message } ``` ## Purpose Creates DataDog monitors with the following checks: - Event Grid no successful message - Event Grid too many failed messages - Event Grid too many unmatched events ## Requirements | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 0.12.31 | | [datadog](#requirement\_datadog) | >= 3.1.0 | ## Providers | Name | Version | |------|---------| | [datadog](#provider\_datadog) | 3.1.2 | ## Modules | Name | Source | Version | |------|--------|---------| | [filter-tags](#module\_filter-tags) | ../../../common/filter-tags | n/a | ## Resources | Name | Type | |------|------| | [datadog_monitor.eventgrid_failed_messages](https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/monitor) | resource | | [datadog_monitor.eventgrid_no_successful_message](https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/monitor) | resource | | [datadog_monitor.eventgrid_unmatched_events](https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/monitor) | resource | ## Inputs | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| | [environment](#input\_environment) | Architecture environment | `string` | n/a | yes | | [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `900` | no | | [eventgrid\_no\_successful\_message\_no\_data\_timeframe](#input\_eventgrid\_no\_successful\_message\_no\_data\_timeframe) | Number of minutes before reporting no data | `string` | `10` | no | | [failed\_messages\_rate\_enabled](#input\_failed\_messages\_rate\_enabled) | Flag to enable Event Grid failed messages monitor | `string` | `"true"` | no | | [failed\_messages\_rate\_extra\_tags](#input\_failed\_messages\_rate\_extra\_tags) | Extra tags for Event Grid failed messages monitor | `list(string)` | `[]` | no | | [failed\_messages\_rate\_message](#input\_failed\_messages\_rate\_message) | Custom message for Event Grid failed messages monitor | `string` | `""` | no | | [failed\_messages\_rate\_thresold\_critical](#input\_failed\_messages\_rate\_thresold\_critical) | Failed messages ratio (percentage) to trigger the critical alert | `number` | `90` | no | | [failed\_messages\_rate\_thresold\_warning](#input\_failed\_messages\_rate\_thresold\_warning) | Failed messages ratio (percentage) to trigger a warning alert | `number` | `50` | no | | [failed\_messages\_rate\_time\_aggregator](#input\_failed\_messages\_rate\_time\_aggregator) | Monitor aggregator for Event Grid failed messages [available values: min, max or avg] | `string` | `"min"` | no | | [failed\_messages\_rate\_timeframe](#input\_failed\_messages\_rate\_timeframe) | Monitor timeframe for Event Grid failed messages [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_5m"` | no | | [filter\_tags\_custom](#input\_filter\_tags\_custom) | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no | | [filter\_tags\_custom\_excluded](#input\_filter\_tags\_custom\_excluded) | Tags excluded for custom filtering when filter\_tags\_use\_defaults is false | `string` | `""` | no | | [filter\_tags\_use\_defaults](#input\_filter\_tags\_use\_defaults) | Use default filter tags convention | `string` | `"true"` | no | | [message](#input\_message) | Message sent when an alert is triggered | `any` | n/a | yes | | [new\_host\_delay](#input\_new\_host\_delay) | Delay in seconds before monitor new resource | `number` | `300` | no | | [no\_successful\_message\_rate\_enabled](#input\_no\_successful\_message\_rate\_enabled) | Flag to enable Event Grid no successful message monitor | `string` | `"true"` | no | | [no\_successful\_message\_rate\_extra\_tags](#input\_no\_successful\_message\_rate\_extra\_tags) | Extra tags for Event Grid no successful message monitor | `list(string)` | `[]` | no | | [no\_successful\_message\_rate\_message](#input\_no\_successful\_message\_rate\_message) | Custom message for Event Grid no successful message monitor | `string` | `""` | no | | [no\_successful\_message\_rate\_time\_aggregator](#input\_no\_successful\_message\_rate\_time\_aggregator) | Monitor aggregator for Event Grid no successful message [available values: min, max or avg] | `string` | `"min"` | no | | [no\_successful\_message\_rate\_timeframe](#input\_no\_successful\_message\_rate\_timeframe) | Monitor timeframe for Event Grid no successful message [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_5m"` | no | | [notify\_no\_data](#input\_notify\_no\_data) | Will raise no data alert if set to true | `bool` | `true` | no | | [prefix\_slug](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no | | [unmatched\_events\_rate\_enabled](#input\_unmatched\_events\_rate\_enabled) | Flag to enable Event Grid unmatched events monitor | `string` | `"true"` | no | | [unmatched\_events\_rate\_extra\_tags](#input\_unmatched\_events\_rate\_extra\_tags) | Extra tags for Event Grid unmatched events monitor | `list(string)` | `[]` | no | | [unmatched\_events\_rate\_message](#input\_unmatched\_events\_rate\_message) | Custom message for Event Grid unmatched events monitor | `string` | `""` | no | | [unmatched\_events\_rate\_thresold\_critical](#input\_unmatched\_events\_rate\_thresold\_critical) | Unmatched events ratio (percentage) to trigger the critical alert | `number` | `90` | no | | [unmatched\_events\_rate\_thresold\_warning](#input\_unmatched\_events\_rate\_thresold\_warning) | Unmatched events ratio (percentage) to trigger a warning alert | `number` | `50` | no | | [unmatched\_events\_rate\_time\_aggregator](#input\_unmatched\_events\_rate\_time\_aggregator) | Monitor aggregator for Event Grid unmatched events [available values: min, max or avg] | `string` | `"min"` | no | | [unmatched\_events\_rate\_timeframe](#input\_unmatched\_events\_rate\_timeframe) | Monitor timeframe for Event Grid unmatched events [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_5m"` | no | ## Outputs | Name | Description | |------|-------------| | [eventgrid\_failed\_messages\_id](#output\_eventgrid\_failed\_messages\_id) | id for monitor eventgrid\_failed\_messages | | [eventgrid\_no\_successful\_message\_id](#output\_eventgrid\_no\_successful\_message\_id) | id for monitor eventgrid\_no\_successful\_message | | [eventgrid\_unmatched\_events\_id](#output\_eventgrid\_unmatched\_events\_id) | id for monitor eventgrid\_unmatched\_events | ## Related documentation Datadog Azure documentation: [https://docs.datadoghq.com/integrations/azure/](https://docs.datadoghq.com/integrations/azure/) Azure "Monitor event delivery" documentation: [https://docs.microsoft.com/en-us/azure/event-grid/monitor-event-delivery](https://docs.microsoft.com/en-us/azure/event-grid/monitor-event-delivery) Azure Monitor metrics: [https://docs.microsoft.com/en-us/azure/azure-monitor/platform/metrics-supported#microsofteventgridtopics](https://docs.microsoft.com/en-us/azure/azure-monitor/platform/metrics-supported#microsofteventgridtopics)