From 47bf31bc3ffaaa7082fbdeabdf484d11114240b1 Mon Sep 17 00:00:00 2001 From: Quentin Manfroi Date: Thu, 16 Aug 2018 10:54:12 +0200 Subject: [PATCH 1/6] MON-287 update service check monitors configuration --- middleware/apache/monitors-apache.tf | 8 +++----- middleware/nginx/monitors-nginx.tf | 8 +++----- middleware/php-fpm/monitors-fpm.tf | 3 +-- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/middleware/apache/monitors-apache.tf b/middleware/apache/monitors-apache.tf index 72bd853..e884448 100644 --- a/middleware/apache/monitors-apache.tf +++ b/middleware/apache/monitors-apache.tf @@ -5,17 +5,15 @@ resource "datadog_monitor" "datadog_apache_process" { type = "service check" query = < Date: Thu, 16 Aug 2018 10:59:10 +0200 Subject: [PATCH 2/6] MON-287 update service check monitors names --- middleware/apache/monitors-apache.tf | 2 +- middleware/nginx/monitors-nginx.tf | 2 +- middleware/php-fpm/monitors-fpm.tf | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/middleware/apache/monitors-apache.tf b/middleware/apache/monitors-apache.tf index e884448..7755dad 100644 --- a/middleware/apache/monitors-apache.tf +++ b/middleware/apache/monitors-apache.tf @@ -1,5 +1,5 @@ resource "datadog_monitor" "datadog_apache_process" { - name = "[${var.environment}] Can't connect to apache vhost status" + name = "[${var.environment}] Apache vhost status does not respond" message = "${coalesce(var.apache_connect_message, var.message)}" type = "service check" diff --git a/middleware/nginx/monitors-nginx.tf b/middleware/nginx/monitors-nginx.tf index 0861736..a601f15 100644 --- a/middleware/nginx/monitors-nginx.tf +++ b/middleware/nginx/monitors-nginx.tf @@ -1,5 +1,5 @@ resource "datadog_monitor" "datadog_nginx_process" { - name = "[${var.environment}] Can't connect to nginx vhost status" + name = "[${var.environment}] Nginx vhost status does not respond" message = "${coalesce(var.nginx_connect_message, var.message)}" type = "service check" diff --git a/middleware/php-fpm/monitors-fpm.tf b/middleware/php-fpm/monitors-fpm.tf index 1f57178..aaf3175 100644 --- a/middleware/php-fpm/monitors-fpm.tf +++ b/middleware/php-fpm/monitors-fpm.tf @@ -1,5 +1,5 @@ resource "datadog_monitor" "datadog_php_fpm_connect_idle" { - name = "[${var.environment}] php_fpm busy worker {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" + name = "[${var.environment}] Php-fpm busy worker {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.php_fpm_busy_message, var.message)}" type = "metric alert" @@ -32,7 +32,7 @@ resource "datadog_monitor" "datadog_php_fpm_connect_idle" { } resource "datadog_monitor" "datadog_fpm_process" { - name = "[${var.environment}] Can't connect to php-fpm" + name = "[${var.environment}] Php-fpm ping url does not respond" message = "${coalesce(var.php_fpm_connect_message, var.message)}" type = "service check" From ad1de2322cdea1c568cd1ec77518f602ad622e55 Mon Sep 17 00:00:00 2001 From: Quentin Manfroi Date: Thu, 16 Aug 2018 12:04:59 +0200 Subject: [PATCH 3/6] MON-287 update readme --- middleware/apache/README.md | 2 +- middleware/nginx/README.md | 2 +- middleware/php-fpm/README.md | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/middleware/apache/README.md b/middleware/apache/README.md index b41fe1f..1ed551d 100644 --- a/middleware/apache/README.md +++ b/middleware/apache/README.md @@ -16,7 +16,7 @@ module "datadog-monitors-middleware-apache" { Creates DataDog monitors with the following checks: -- Can't connect to apache vhost status +- Apache vhost status does not respond ## Inputs diff --git a/middleware/nginx/README.md b/middleware/nginx/README.md index 551ea03..46f7e37 100644 --- a/middleware/nginx/README.md +++ b/middleware/nginx/README.md @@ -16,7 +16,7 @@ module "datadog-monitors-middleware-nginx" { Creates DataDog monitors with the following checks: -- Can't connect to nginx vhost status +- Nginx vhost status does not respond ## Inputs diff --git a/middleware/php-fpm/README.md b/middleware/php-fpm/README.md index 09bdf1a..0e74dab 100644 --- a/middleware/php-fpm/README.md +++ b/middleware/php-fpm/README.md @@ -16,8 +16,8 @@ module "datadog-monitors-middleware-php-fpm" { Creates DataDog monitors with the following checks: -- php_fpm busy worker -- Can't connect to php-fpm +- Php-fpm busy worker +- Php-fpm ping url does not respond ## Inputs From b50cea0d4ed80a7d9eed4725f66faa5f01c118a7 Mon Sep 17 00:00:00 2001 From: Quentin Manfroi Date: Mon, 20 Aug 2018 14:57:08 +0200 Subject: [PATCH 4/6] MON-287 add variable for cluster alert threshold --- middleware/apache/README.md | 5 +++-- middleware/apache/inputs.tf | 10 ++++++++-- middleware/apache/monitors-apache.tf | 2 +- middleware/nginx/README.md | 5 +++-- middleware/nginx/inputs.tf | 10 ++++++++-- middleware/nginx/monitors-nginx.tf | 2 +- 6 files changed, 24 insertions(+), 10 deletions(-) diff --git a/middleware/apache/README.md b/middleware/apache/README.md index 1ed551d..f9dae38 100644 --- a/middleware/apache/README.md +++ b/middleware/apache/README.md @@ -22,8 +22,9 @@ Creates DataDog monitors with the following checks: | Name | Description | Type | Default | Required | |------|-------------|:----:|:-----:|:-----:| -| apache_connect_message | Custom message for Apache process monitor | string | `` | no | -| apache_connect_silenced | Groups to mute for Apache process monitor | map | `` | no | +| apache_connect_message | Custom message for Apache status monitor | string | `` | no | +| apache_connect_silenced | Groups to mute for Apache status monitor | map | `` | no | +| apache_connect_threshold_critical | Apache status monitor (critical threshold) | string | `1.1754943508222875e-38` | no | | delay | Delay in seconds for the metric evaluation | string | `15` | no | | environment | Architecture Environment | string | - | yes | | filter_tags_custom | Tags used for custom filtering when filter_tags_use_defaults is false | string | `*` | no | diff --git a/middleware/apache/inputs.tf b/middleware/apache/inputs.tf index 400d637..0f30b12 100644 --- a/middleware/apache/inputs.tf +++ b/middleware/apache/inputs.tf @@ -27,13 +27,19 @@ variable "filter_tags_custom" { # Apache Middleware specific variable "apache_connect_silenced" { - description = "Groups to mute for Apache process monitor" + description = "Groups to mute for Apache status monitor" type = "map" default = {} } variable "apache_connect_message" { - description = "Custom message for Apache process monitor" + description = "Custom message for Apache status monitor" type = "string" default = "" } + +variable "apache_connect_threshold_critical" { + description = "Apache status monitor (critical threshold)" + type = "string" + default = 1.1754943508222875e-38 +} diff --git a/middleware/apache/monitors-apache.tf b/middleware/apache/monitors-apache.tf index 7755dad..d134287 100644 --- a/middleware/apache/monitors-apache.tf +++ b/middleware/apache/monitors-apache.tf @@ -10,7 +10,7 @@ resource "datadog_monitor" "datadog_apache_process" { thresholds = { warning = 0 - critical = 1.1754943508222875e-38 + critical = "${var.apache_connect_threshold_critical}" } notify_no_data = true diff --git a/middleware/nginx/README.md b/middleware/nginx/README.md index 46f7e37..83351c8 100644 --- a/middleware/nginx/README.md +++ b/middleware/nginx/README.md @@ -22,13 +22,14 @@ Creates DataDog monitors with the following checks: | Name | Description | Type | Default | Required | |------|-------------|:----:|:-----:|:-----:| +| apache_connect_threshold_critical | Nginx status monitor (critical threshold) | string | `1.1754943508222875e-38` | no | | delay | Delay in seconds for the metric evaluation | string | `15` | no | | environment | Architecture Environment | string | - | yes | | 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 | | message | Message sent when an alert is triggered | string | - | yes | -| nginx_connect_message | Custom message for Nginx process monitor | string | `` | no | -| nginx_connect_silenced | Groups to mute for Nginx process monitor | map | `` | no | +| nginx_connect_message | Custom message for Nginx status monitor | string | `` | no | +| nginx_connect_silenced | Groups to mute for Nginx status monitor | map | `` | no | ## Outputs diff --git a/middleware/nginx/inputs.tf b/middleware/nginx/inputs.tf index 7370f6e..a2b248d 100644 --- a/middleware/nginx/inputs.tf +++ b/middleware/nginx/inputs.tf @@ -27,13 +27,19 @@ variable "filter_tags_custom" { # Nginx Middleware specific variable "nginx_connect_silenced" { - description = "Groups to mute for Nginx process monitor" + description = "Groups to mute for Nginx status monitor" type = "map" default = {} } variable "nginx_connect_message" { - description = "Custom message for Nginx process monitor" + description = "Custom message for Nginx status monitor" type = "string" default = "" } + +variable "apache_connect_threshold_critical" { + description = "Nginx status monitor (critical threshold)" + type = "string" + default = 1.1754943508222875e-38 +} diff --git a/middleware/nginx/monitors-nginx.tf b/middleware/nginx/monitors-nginx.tf index a601f15..4f44be5 100644 --- a/middleware/nginx/monitors-nginx.tf +++ b/middleware/nginx/monitors-nginx.tf @@ -10,7 +10,7 @@ resource "datadog_monitor" "datadog_nginx_process" { thresholds = { warning = 0 - critical = 1.1754943508222875e-38 + critical = "${var.nginx_connect_threshold_critical}" } notify_no_data = true From 19323eece0a3e76b22af3862849668cde17fc4a5 Mon Sep 17 00:00:00 2001 From: Quentin Manfroi Date: Mon, 20 Aug 2018 15:44:36 +0200 Subject: [PATCH 5/6] MON-287 fix wrong name for nginx variable --- middleware/nginx/inputs.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/middleware/nginx/inputs.tf b/middleware/nginx/inputs.tf index a2b248d..d7d4fc1 100644 --- a/middleware/nginx/inputs.tf +++ b/middleware/nginx/inputs.tf @@ -38,7 +38,7 @@ variable "nginx_connect_message" { default = "" } -variable "apache_connect_threshold_critical" { +variable "nginx_connect_threshold_critical" { description = "Nginx status monitor (critical threshold)" type = "string" default = 1.1754943508222875e-38 From 56f9aea5aeb2e7522134738576658bb52c124537 Mon Sep 17 00:00:00 2001 From: Quentin Manfroi Date: Mon, 20 Aug 2018 15:49:12 +0200 Subject: [PATCH 6/6] MON-287 update readme --- middleware/nginx/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/middleware/nginx/README.md b/middleware/nginx/README.md index 83351c8..cbfd72f 100644 --- a/middleware/nginx/README.md +++ b/middleware/nginx/README.md @@ -22,7 +22,6 @@ Creates DataDog monitors with the following checks: | Name | Description | Type | Default | Required | |------|-------------|:----:|:-----:|:-----:| -| apache_connect_threshold_critical | Nginx status monitor (critical threshold) | string | `1.1754943508222875e-38` | no | | delay | Delay in seconds for the metric evaluation | string | `15` | no | | environment | Architecture Environment | string | - | yes | | filter_tags_custom | Tags used for custom filtering when filter_tags_use_defaults is false | string | `*` | no | @@ -30,6 +29,7 @@ Creates DataDog monitors with the following checks: | message | Message sent when an alert is triggered | string | - | yes | | nginx_connect_message | Custom message for Nginx status monitor | string | `` | no | | nginx_connect_silenced | Groups to mute for Nginx status monitor | map | `` | no | +| nginx_connect_threshold_critical | Nginx status monitor (critical threshold) | string | `1.1754943508222875e-38` | no | ## Outputs