From efad440d62068ed4cbee85d914579c18f5c961f3 Mon Sep 17 00:00:00 2001 From: Quentin Manfroi Date: Fri, 3 Nov 2017 20:28:05 +0100 Subject: [PATCH] MON-78 add subscription_id and tags --- cloud/azure/stream-analytics/README.md | 9 ++++----- cloud/azure/stream-analytics/inputs.tf | 10 ++++++++-- .../stream-analytics/monitors-stream-analytics.tf | 11 +++++++---- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/cloud/azure/stream-analytics/README.md b/cloud/azure/stream-analytics/README.md index f115e70..28e3e2b 100644 --- a/cloud/azure/stream-analytics/README.md +++ b/cloud/azure/stream-analytics/README.md @@ -19,14 +19,13 @@ Inputs | Name | Description | Type | Default | Required | |------|-------------|:----:|:-----:|:-----:| -| conversion_errors_threshold_critical | | string | `10` | no | -| conversion_errors_threshold_warning | | string | `0` | no | +| conversion_errors_threshold_critical | Conversion errors limit (critical threshold) | string | `10` | no | +| conversion_errors_threshold_warning | Conversion errors limit (warning threshold) | string | `0` | no | | delay | Delay in seconds for the metric evaluation | string | `600` | no | | environment | Architecture environment | string | - | yes | -| function_requests_threshold_critical | | string | `10` | no | -| function_requests_threshold_warning | | string | `0` | no | +| function_requests_threshold_critical | Failed Function Request rate limit (critical threshold) | string | `10` | no | +| function_requests_threshold_warning | Failed Function Request rate limit (warning threshold) | string | `0` | no | | message | Message sent when a monitor is triggered | string | - | yes | -| notify_no_data | | string | `false` | no | | runtime_errors_threshold_critical | | string | `10` | no | | runtime_errors_threshold_warning | | string | `0` | no | | su_utilization_threshold_critical | | string | `80` | no | diff --git a/cloud/azure/stream-analytics/inputs.tf b/cloud/azure/stream-analytics/inputs.tf index 8160547..16807c8 100644 --- a/cloud/azure/stream-analytics/inputs.tf +++ b/cloud/azure/stream-analytics/inputs.tf @@ -26,8 +26,6 @@ variable "service" { } # Global DataDog - - variable "message" { description = "Message sent when a Redis monitor is triggered" } @@ -44,33 +42,41 @@ variable "use_filter_tags" { # Azure Stream Analytics specific variable "su_utilization_threshold_warning" { + description = "Streaming Unit utilization rate limit (warning threshold)" default = 60 } variable "su_utilization_threshold_critical" { + description = "Streaming Unit utilization rate limit (critical threshold)" default = 80 } variable "function_requests_threshold_warning" { + description = "Failed Function Request rate limit (warning threshold)" default = 0 } variable "function_requests_threshold_critical" { + description = "Failed Function Request rate limit (critical threshold)" default = 10 } variable "conversion_errors_threshold_warning" { + description = "Conversion errors limit (warning threshold)" default = 0 } variable "conversion_errors_threshold_critical" { + description = "Conversion errors limit (critical threshold)" default = 10 } variable "runtime_errors_threshold_warning" { + description = "Runtime errors limit (warning threshold)" default = 0 } variable "runtime_errors_threshold_critical" { + description = "Runtime errors limit (critical threshold)" default = 10 } diff --git a/cloud/azure/stream-analytics/monitors-stream-analytics.tf b/cloud/azure/stream-analytics/monitors-stream-analytics.tf index e464dd4..0ecb513 100644 --- a/cloud/azure/stream-analytics/monitors-stream-analytics.tf +++ b/cloud/azure/stream-analytics/monitors-stream-analytics.tf @@ -41,8 +41,9 @@ resource "datadog_monitor" "failed_function_requests" { query = < ${var.function_requests_threshold_critical} + avg:azure.streamanalytics_streamingjobs.aml_callout_failed_requests{${data.template_file.filter.rendered}} by {name,resource_group}.as_count() / + avg:azure.streamanalytics_streamingjobs.aml_callout_requests{${data.template_file.filter.rendered}} by {name,resource_group}.as_count() + ) * 100 > ${var.function_requests_threshold_critical} EOF type = "query alert" @@ -66,7 +67,8 @@ resource "datadog_monitor" "failed_function_requests" { resource "datadog_monitor" "conversion_errors" { name = "[${var.environment}] Stream Analytics more than ${var.conversion_errors_threshold_critical} conversion errors on {{name}}" - message = "${var.message}" + # Hard Coded Message while we don't know how to configure warning and critical thresholds + message = "@FR-CloudPublic-run@fr.clara.net" query = <