MON-142 split delay variable

This commit is contained in:
Quentin Manfroi 2018-08-22 15:07:06 +02:00
parent 26f660310c
commit e7c21f49ab
3 changed files with 12 additions and 7 deletions

View File

@ -23,8 +23,8 @@ Creates DataDog monitors with the following checks:
| Name | Description | Type | Default | Required | | Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:| |------|-------------|:----:|:-----:|:-----:|
| delay | Delay in seconds for the metric evaluation | string | `15` | no |
| environment | Environment | string | - | yes | | environment | Environment | string | - | yes |
| evaluation_delay | Delay in seconds for the metric evaluation | string | `15` | no |
| filter_tags_custom | Tags used for custom filtering when filter_tags_use_defaults is false | string | `*` | no | | filter_tags_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 |
@ -36,6 +36,7 @@ Creates DataDog monitors with the following checks:
| mysql_thread_silenced | Groups to mute mysql threads monitor | map | `<map>` | no | | mysql_thread_silenced | Groups to mute mysql threads monitor | map | `<map>` | no |
| mysql_thread_threshold_critical | Maximum critical acceptable number of threads | string | `500` | no | | mysql_thread_threshold_critical | Maximum critical acceptable number of threads | string | `500` | no |
| mysql_thread_threshold_warning | Maximum warning acceptable number of threads | string | `400` | no | | mysql_thread_threshold_warning | Maximum warning acceptable number of threads | string | `400` | no |
| new_host_delay | Delay in seconds for the metric evaluation | string | `300` | no |
## Outputs ## Outputs

View File

@ -3,12 +3,16 @@ variable "environment" {
type = "string" type = "string"
} }
# Global DataDog variable "evaluation_delay" {
variable "delay" {
description = "Delay in seconds for the metric evaluation" description = "Delay in seconds for the metric evaluation"
default = 15 default = 15
} }
variable "new_host_delay" {
description = "Delay in seconds for the metric evaluation"
default = 300
}
variable "message" { variable "message" {
description = "Message sent when an alert is triggered" description = "Message sent when an alert is triggered"
} }

View File

@ -10,8 +10,8 @@ resource "datadog_monitor" "mysql_connection_too_high" {
) * 100 > ${var.mysql_connection_threshold_critical} ) * 100 > ${var.mysql_connection_threshold_critical}
EOF EOF
evaluation_delay = "${var.delay}" evaluation_delay = "${var.evaluation_delay}"
new_host_delay = "${var.delay}" new_host_delay = "${var.new_host_delay}"
thresholds { thresholds {
warning = "${var.mysql_connection_threshold_warning}" warning = "${var.mysql_connection_threshold_warning}"
@ -40,8 +40,8 @@ resource "datadog_monitor" "mysql_thread_too_high" {
) > ${var.mysql_thread_threshold_critical} ) > ${var.mysql_thread_threshold_critical}
EOF EOF
evaluation_delay = "${var.delay}" evaluation_delay = "${var.evaluation_delay}"
new_host_delay = "${var.delay}" new_host_delay = "${var.new_host_delay}"
thresholds { thresholds {
warning = "${var.mysql_thread_threshold_warning}" warning = "${var.mysql_thread_threshold_warning}"