From 86cf2774d62888b8acae6f239f8d901d7907ae7c Mon Sep 17 00:00:00 2001 From: Alexandre Gaillet Date: Tue, 20 Mar 2018 16:47:50 +0100 Subject: [PATCH 1/4] MON-139 - Updated Azure monitors name with new best practice --- .../monitors-azure-apimanagement.tf | 8 +++--- .../app-services/monitors-app_services.tf | 10 +++---- cloud/azure/eventhub/monitors-eventhub.tf | 4 +-- cloud/azure/iothubs/monitors-iothubs.tf | 26 +++++++++---------- cloud/azure/redis/monitors-azure-redis.tf | 6 ++--- .../monitors-sql-database-basics.tf | 8 +++--- cloud/azure/storage/monitors-azure-storage.tf | 16 ++++++------ .../monitors-stream-analytics.tf | 8 +++--- 8 files changed, 43 insertions(+), 43 deletions(-) diff --git a/cloud/azure/apimanagement/monitors-azure-apimanagement.tf b/cloud/azure/apimanagement/monitors-azure-apimanagement.tf index a8d81ca..2862dc1 100644 --- a/cloud/azure/apimanagement/monitors-azure-apimanagement.tf +++ b/cloud/azure/apimanagement/monitors-azure-apimanagement.tf @@ -39,7 +39,7 @@ resource "datadog_monitor" "apimgt_status" { } resource "datadog_monitor" "apimgt_failed_requests" { - name = "[${var.environment}] API Management too many failed requests {{comparator}} {{#is_alert}}{{threshold}}%{{/is_alert}}{{#is_warning}}{{warn_threshold}}%{{/is_warning}} ({{value}}%)" + name = "[${var.environment}] API Management too many failed requests {{#is_alert}}{{comparator}}{{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{comparator}}{{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.failed_requests_message, var.message)}" query = < Date: Tue, 20 Mar 2018 17:23:44 +0100 Subject: [PATCH 2/4] MON-139 - Updated AWS monitors name with new best practice --- cloud/aws/apigateway/monitors-api.tf | 6 +++--- cloud/aws/elasticsearch/monitors-elasticsearch.tf | 4 ++-- cloud/aws/elb/monitors-elb.tf | 10 +++++----- cloud/aws/rds/monitors-rds.tf | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/cloud/aws/apigateway/monitors-api.tf b/cloud/aws/apigateway/monitors-api.tf index 2ed22ad..9466e82 100644 --- a/cloud/aws/apigateway/monitors-api.tf +++ b/cloud/aws/apigateway/monitors-api.tf @@ -1,6 +1,6 @@ # Monitoring Api Gateway latency resource "datadog_monitor" "API_Gateway_latency" { - name = "[${var.environment}] API Gateway latency {{comparator}} {{#is_alert}}{{threshold}}ms{{/is_alert}}{{#is_warning}}{{warn_threshold}}ms{{/is_warning}} ({{value}}ms)" + name = "[${var.environment}] API Gateway latency {{#is_alert}}{{comparator}}{{threshold}}ms ({{value}}ms){{/is_alert}}{{#is_warning}}{{comparator}}{{warn_threshold}}ms ({{value}}ms){{/is_warning}}" type = "metric alert" message = "${var.message}" @@ -29,7 +29,7 @@ resource "datadog_monitor" "API_Gateway_latency" { # Monitoring API Gateway 5xx errors percent resource "datadog_monitor" "API_http_5xx_errors_count" { - name = "[${var.environment}] API Gateway HTTP 5xx errors {{comparator}} {{#is_alert}}{{threshold}}%{{/is_alert}}{{#is_warning}}{{warn_threshold}}%{{/is_warning}} ({{value}}%)" + name = "[${var.environment}] API Gateway HTTP 5xx errors {{#is_alert}}{{comparator}}{{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{comparator}}{{warn_threshold}}% ({{value}}%){{/is_warning}}" type = "metric alert" message = "${var.message}" @@ -59,7 +59,7 @@ resource "datadog_monitor" "API_http_5xx_errors_count" { # Monitoring API Gateway 4xx errors percent resource "datadog_monitor" "API_http_4xx_errors_count" { - name = "[${var.environment}] API Gateway HTTP 4xx errors {{comparator}} {{#is_alert}}{{threshold}}%{{/is_alert}}{{#is_warning}}{{warn_threshold}}%{{/is_warning}} ({{value}}%)" + name = "[${var.environment}] API Gateway HTTP 4xx errors {{#is_alert}}{{comparator}}{{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{comparator}}{{warn_threshold}}% ({{value}}%){{/is_warning}}" type = "metric alert" message = "${var.message}" diff --git a/cloud/aws/elasticsearch/monitors-elasticsearch.tf b/cloud/aws/elasticsearch/monitors-elasticsearch.tf index b665926..de02a9d 100644 --- a/cloud/aws/elasticsearch/monitors-elasticsearch.tf +++ b/cloud/aws/elasticsearch/monitors-elasticsearch.tf @@ -42,7 +42,7 @@ EOF ### Elasticsearch cluster free storage space monitor ### resource "datadog_monitor" "es_free_space_low" { - name = "[${var.environment}] ElasticSearch cluster free storage space {{comparator}} {{#is_alert}}{{threshold}}%{{/is_alert}}{{#is_warning}}{{warn_threshold}}%{{/is_warning}} ({{value}}%)" + name = "[${var.environment}] ElasticSearch cluster free storage space {{#is_alert}}{{comparator}}{{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{comparator}}{{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${var.message}" type = "query alert" @@ -75,7 +75,7 @@ EOF ### Elasticsearch cluster CPU monitor ### resource "datadog_monitor" "es_cpu_90_15min" { - name = "[${var.environment}] ElasticSearch cluster CPU high {{comparator}} {{#is_alert}}{{threshold}}%{{/is_alert}}{{#is_warning}}{{warn_threshold}}%{{/is_warning}} ({{value}}%)" + name = "[${var.environment}] ElasticSearch cluster CPU high {{#is_alert}}{{comparator}}{{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{comparator}}{{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${var.message}" type = "query alert" diff --git a/cloud/aws/elb/monitors-elb.tf b/cloud/aws/elb/monitors-elb.tf index 70a316e..f9d6249 100644 --- a/cloud/aws/elb/monitors-elb.tf +++ b/cloud/aws/elb/monitors-elb.tf @@ -33,7 +33,7 @@ resource "datadog_monitor" "ELB_no_healthy_instances" { } resource "datadog_monitor" "ELB_too_much_4xx" { - name = "[${var.environment}] ELB 4xx errors too high {{comparator}} {{#is_alert}}{{threshold}}%{{/is_alert}}{{#is_warning}}{{warn_threshold}}%{{/is_warning}} ({{value}}%)" + name = "[${var.environment}] ELB 4xx errors too high {{#is_alert}}{{comparator}}{{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{comparator}}{{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${var.message}" query = < Date: Tue, 20 Mar 2018 17:37:58 +0100 Subject: [PATCH 3/4] MON-139 - Updated remaining monitors name with new best practice --- middleware/php-fpm/monitors-fpm.tf | 2 +- system/generic/monitors-system.tf | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/middleware/php-fpm/monitors-fpm.tf b/middleware/php-fpm/monitors-fpm.tf index 5b1568b..1a9afb6 100644 --- a/middleware/php-fpm/monitors-fpm.tf +++ b/middleware/php-fpm/monitors-fpm.tf @@ -7,7 +7,7 @@ data "template_file" "filter" { } resource "datadog_monitor" "datadog_php_fpm_process_idle" { - name = "[${var.environment}] php_fpm busy worker {{comparator}} {{#is_alert}}{{threshold}}%{{/is_alert}}{{#is_warning}}{{warn_threshold}}%{{/is_warning}} ({{value}}%)" + name = "[${var.environment}] php_fpm busy worker {{#is_alert}}{{comparator}}{{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{comparator}}{{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${var.message}" type = "metric alert" diff --git a/system/generic/monitors-system.tf b/system/generic/monitors-system.tf index 0a09ffd..c0fdf25 100644 --- a/system/generic/monitors-system.tf +++ b/system/generic/monitors-system.tf @@ -7,7 +7,7 @@ data "template_file" "filter" { } resource "datadog_monitor" "datadog_cpu_too_high" { - name = "[${var.environment}] CPU usage {{comparator}} {{#is_alert}}{{threshold}}%{{/is_alert}}{{#is_warning}}{{warn_threshold}}%{{/is_warning}} ({{value}}%)" + name = "[${var.environment}] CPU usage {{#is_alert}}{{comparator}}{{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{comparator}}{{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${var.message}" query = < Date: Thu, 22 Mar 2018 20:12:27 +0100 Subject: [PATCH 4/4] MON-139 fix missing space in templating name --- cloud/aws/apigateway/monitors-api.tf | 6 ++--- .../elasticsearch/monitors-elasticsearch.tf | 4 +-- cloud/aws/elb/monitors-elb.tf | 10 +++---- cloud/aws/rds/monitors-rds.tf | 4 +-- .../monitors-azure-apimanagement.tf | 8 +++--- .../app-services/monitors-app_services.tf | 10 +++---- cloud/azure/eventhub/monitors-eventhub.tf | 4 +-- cloud/azure/iothubs/monitors-iothubs.tf | 26 +++++++++---------- cloud/azure/redis/monitors-azure-redis.tf | 6 ++--- .../monitors-sql-database-basics.tf | 8 +++--- cloud/azure/storage/monitors-azure-storage.tf | 16 ++++++------ .../monitors-stream-analytics.tf | 8 +++--- middleware/php-fpm/monitors-fpm.tf | 2 +- system/generic/monitors-system.tf | 8 +++--- 14 files changed, 60 insertions(+), 60 deletions(-) diff --git a/cloud/aws/apigateway/monitors-api.tf b/cloud/aws/apigateway/monitors-api.tf index 9466e82..54e6bee 100644 --- a/cloud/aws/apigateway/monitors-api.tf +++ b/cloud/aws/apigateway/monitors-api.tf @@ -1,6 +1,6 @@ # Monitoring Api Gateway latency resource "datadog_monitor" "API_Gateway_latency" { - name = "[${var.environment}] API Gateway latency {{#is_alert}}{{comparator}}{{threshold}}ms ({{value}}ms){{/is_alert}}{{#is_warning}}{{comparator}}{{warn_threshold}}ms ({{value}}ms){{/is_warning}}" + name = "[${var.environment}] API Gateway latency {{#is_alert}}{{comparator}} {{threshold}}ms ({{value}}ms){{/is_alert}}{{#is_warning}}{{comparator}} {{warn_threshold}}ms ({{value}}ms){{/is_warning}}" type = "metric alert" message = "${var.message}" @@ -29,7 +29,7 @@ resource "datadog_monitor" "API_Gateway_latency" { # Monitoring API Gateway 5xx errors percent resource "datadog_monitor" "API_http_5xx_errors_count" { - name = "[${var.environment}] API Gateway HTTP 5xx errors {{#is_alert}}{{comparator}}{{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{comparator}}{{warn_threshold}}% ({{value}}%){{/is_warning}}" + name = "[${var.environment}] API Gateway HTTP 5xx errors {{#is_alert}}{{comparator}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{comparator}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" type = "metric alert" message = "${var.message}" @@ -59,7 +59,7 @@ resource "datadog_monitor" "API_http_5xx_errors_count" { # Monitoring API Gateway 4xx errors percent resource "datadog_monitor" "API_http_4xx_errors_count" { - name = "[${var.environment}] API Gateway HTTP 4xx errors {{#is_alert}}{{comparator}}{{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{comparator}}{{warn_threshold}}% ({{value}}%){{/is_warning}}" + name = "[${var.environment}] API Gateway HTTP 4xx errors {{#is_alert}}{{comparator}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{comparator}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" type = "metric alert" message = "${var.message}" diff --git a/cloud/aws/elasticsearch/monitors-elasticsearch.tf b/cloud/aws/elasticsearch/monitors-elasticsearch.tf index de02a9d..a9f2173 100644 --- a/cloud/aws/elasticsearch/monitors-elasticsearch.tf +++ b/cloud/aws/elasticsearch/monitors-elasticsearch.tf @@ -42,7 +42,7 @@ EOF ### Elasticsearch cluster free storage space monitor ### resource "datadog_monitor" "es_free_space_low" { - name = "[${var.environment}] ElasticSearch cluster free storage space {{#is_alert}}{{comparator}}{{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{comparator}}{{warn_threshold}}% ({{value}}%){{/is_warning}}" + name = "[${var.environment}] ElasticSearch cluster free storage space {{#is_alert}}{{comparator}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{comparator}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${var.message}" type = "query alert" @@ -75,7 +75,7 @@ EOF ### Elasticsearch cluster CPU monitor ### resource "datadog_monitor" "es_cpu_90_15min" { - name = "[${var.environment}] ElasticSearch cluster CPU high {{#is_alert}}{{comparator}}{{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{comparator}}{{warn_threshold}}% ({{value}}%){{/is_warning}}" + name = "[${var.environment}] ElasticSearch cluster CPU high {{#is_alert}}{{comparator}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{comparator}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${var.message}" type = "query alert" diff --git a/cloud/aws/elb/monitors-elb.tf b/cloud/aws/elb/monitors-elb.tf index f9d6249..441d207 100644 --- a/cloud/aws/elb/monitors-elb.tf +++ b/cloud/aws/elb/monitors-elb.tf @@ -33,7 +33,7 @@ resource "datadog_monitor" "ELB_no_healthy_instances" { } resource "datadog_monitor" "ELB_too_much_4xx" { - name = "[${var.environment}] ELB 4xx errors too high {{#is_alert}}{{comparator}}{{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{comparator}}{{warn_threshold}}% ({{value}}%){{/is_warning}}" + name = "[${var.environment}] ELB 4xx errors too high {{#is_alert}}{{comparator}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{comparator}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${var.message}" query = <