From 3ed551d2a18d32c6884b3ffb3371f4f9aed0417d Mon Sep 17 00:00:00 2001 From: Rafael Romero Carmona Date: Tue, 31 Jul 2018 15:30:11 +0200 Subject: [PATCH] MON-230 Monitors fixed acording to what is deployed on Hubside's Datadog --- cloud/gcp/big-query/README.md | 18 +++++++-------- cloud/gcp/big-query/inputs.tf | 28 ++++++----------------- cloud/gcp/big-query/monitors-big-query.tf | 18 +++++++-------- 3 files changed, 25 insertions(+), 39 deletions(-) diff --git a/cloud/gcp/big-query/README.md b/cloud/gcp/big-query/README.md index 7964f96..b3f985c 100644 --- a/cloud/gcp/big-query/README.md +++ b/cloud/gcp/big-query/README.md @@ -16,15 +16,15 @@ module "datadog-monitors-cloud-gcp-big-query" { Creates DataDog monitors with the following checks: -- GCP Big Query Available Slots close to the limit -- GCP Big Query Concurrent Queries close to the limit -- GCP Big Query Execution Time too high -- GCP Big Query Scanned Bytes Billed too high -- GCP Big Query Scanned Bytes too high -- GCP Big Query Stored Bytes too high -- GCP Big Query Table Count too high -- GCP Big Query Uploaded Bytes Billed too high -- GCP Big Query Uploaded Bytes too high +- GCP Big Query Available Slots +- GCP Big Query Concurrent Queries +- GCP Big Query Execution Time +- GCP Big Query Scanned Bytes Billed +- GCP Big Query Scanned Bytes +- GCP Big Query Stored Bytes +- GCP Big Query Table Count +- GCP Big Query Uploaded Bytes Billed +- GCP Big Query Uploaded Bytes ## Inputs diff --git a/cloud/gcp/big-query/inputs.tf b/cloud/gcp/big-query/inputs.tf index c390b22..c1ab176 100644 --- a/cloud/gcp/big-query/inputs.tf +++ b/cloud/gcp/big-query/inputs.tf @@ -115,9 +115,7 @@ variable "execution_time_silenced" { description = "Groups to mute for GCP Big Query Execution Time monitor. Muted by default." type = "map" - default = { - "*" = 0 - } + default = {} } variable "execution_time_extra_tags" { @@ -163,9 +161,7 @@ variable "scanned_bytes_silenced" { description = "Groups to mute for GCP Big Query Scanned Bytes monitor. Muted by default." type = "map" - default = { - "*" = 0 - } + default = {} } variable "scanned_bytes_extra_tags" { @@ -211,9 +207,7 @@ variable "scanned_bytes_billed_silenced" { description = "Groups to mute for GCP Big Query Scanned Bytes Billed monitor. Muted by default." type = "map" - default = { - "*" = 0 - } + default = {} } variable "scanned_bytes_billed_extra_tags" { @@ -304,9 +298,7 @@ variable "stored_bytes_silenced" { description = "Groups to mute for GCP Big Query Stored Bytes monitor. Muted by default." type = "map" - default = { - "*" = 0 - } + default = {} } variable "stored_bytes_extra_tags" { @@ -352,9 +344,7 @@ variable "table_count_silenced" { description = "Groups to mute for GCP Big Query Table Count monitor. Muted by default." type = "map" - default = { - "*" = 0 - } + default = {} } variable "table_count_extra_tags" { @@ -400,9 +390,7 @@ variable "uploaded_bytes_silenced" { description = "Groups to mute for GCP Big Query Uploaded Bytes monitor. Muted by default." type = "map" - default = { - "*" = 0 - } + default = {} } variable "uploaded_bytes_extra_tags" { @@ -448,9 +436,7 @@ variable "uploaded_bytes_billed_silenced" { description = "Groups to mute for GCP Big Query Uploaded Bytes Billed monitor. Muted by default." type = "map" - default = { - "*" = 0 - } + default = {} } variable "uploaded_bytes_billed_extra_tags" { diff --git a/cloud/gcp/big-query/monitors-big-query.tf b/cloud/gcp/big-query/monitors-big-query.tf index 0a87403..4e16a84 100644 --- a/cloud/gcp/big-query/monitors-big-query.tf +++ b/cloud/gcp/big-query/monitors-big-query.tf @@ -17,7 +17,7 @@ data "template_file" "filter" { resource "datadog_monitor" "concurrent_queries" { count = "${var.concurrent_queries_enabled == "true" ? 1 : 0}" - name = "[${var.environment}] GCP Big Query Concurrent Queries close to the limit {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" + name = "[${var.environment}] GCP Big Query Concurrent Queries {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" message = "${coalesce(var.concurrent_queries_message, var.message)}" type = "metric alert" @@ -61,7 +61,7 @@ EOF resource "datadog_monitor" "execution_time" { count = "${var.execution_time_enabled == "true" ? 1 : 0}" - name = "[${var.environment}] GCP Big Query Execution Time too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" + name = "[${var.environment}] GCP Big Query Execution Time {{#is_alert}}{{{comparator}}} {{threshold}}s ({{value}}s){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}s ({{value}}s){{/is_warning}}" message = "${coalesce(var.execution_time_message, var.message)}" type = "metric alert" @@ -105,7 +105,7 @@ EOF resource "datadog_monitor" "scanned_bytes" { count = "${var.scanned_bytes_enabled == "true" ? 1 : 0}" - name = "[${var.environment}] GCP Big Query Scanned Bytes too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" + name = "[${var.environment}] GCP Big Query Scanned Bytes {{#is_alert}}{{{comparator}}} {{threshold}}B/mn ({{value}}B/mn){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}B/mn ({{value}}B/mn){{/is_warning}}" message = "${coalesce(var.scanned_bytes_message, var.message)}" type = "metric alert" @@ -149,7 +149,7 @@ EOF resource "datadog_monitor" "scanned_bytes_billed" { count = "${var.scanned_bytes_billed_enabled == "true" ? 1 : 0}" - name = "[${var.environment}] GCP Big Query Scanned Bytes Billed too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" + name = "[${var.environment}] GCP Big Query Scanned Bytes Billed {{#is_alert}}{{{comparator}}} {{threshold}}B/mn ({{value}}B/mn){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}B/mn ({{value}}B/mn){{/is_warning}}" message = "${coalesce(var.scanned_bytes_billed_message, var.message)}" type = "metric alert" @@ -193,7 +193,7 @@ EOF resource "datadog_monitor" "available_slots" { count = "${var.available_slots_enabled == "true" ? 1 : 0}" - name = "[${var.environment}] GCP Big Query Available Slots close to the limit {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" + name = "[${var.environment}] GCP Big Query Available Slots {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" message = "${coalesce(var.available_slots_message, var.message)}" type = "metric alert" @@ -237,7 +237,7 @@ EOF resource "datadog_monitor" "stored_bytes" { count = "${var.stored_bytes_enabled == "true" ? 1 : 0}" - name = "[${var.environment}] GCP Big Query Stored Bytes too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" + name = "[${var.environment}] GCP Big Query Stored Bytes {{#is_alert}}{{{comparator}}} {{threshold}}B ({{value}}B){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}B ({{value}}B){{/is_warning}}" message = "${coalesce(var.stored_bytes_message, var.message)}" type = "metric alert" @@ -282,7 +282,7 @@ EOF resource "datadog_monitor" "table_count" { count = "${var.table_count_enabled == "true" ? 1 : 0}" - name = "[${var.environment}] GCP Big Query Table Count too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" + name = "[${var.environment}] GCP Big Query Table Count {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" message = "${coalesce(var.table_count_message, var.message)}" type = "metric alert" @@ -327,7 +327,7 @@ EOF resource "datadog_monitor" "uploaded_bytes" { count = "${var.uploaded_bytes_enabled == "true" ? 1 : 0}" - name = "[${var.environment}] GCP Big Query Uploaded Bytes too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" + name = "[${var.environment}] GCP Big Query Uploaded Bytes {{#is_alert}}{{{comparator}}} {{threshold}}B/mn ({{value}}B/mn){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}B/mn ({{value}}B/mn){{/is_warning}}" message = "${coalesce(var.uploaded_bytes_message, var.message)}" type = "metric alert" @@ -372,7 +372,7 @@ EOF resource "datadog_monitor" "uploaded_bytes_billed" { count = "${var.uploaded_bytes_billed_enabled == "true" ? 1 : 0}" - name = "[${var.environment}] GCP Big Query Uploaded Bytes Billed too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" + name = "[${var.environment}] GCP Big Query Uploaded Bytes Billed {{#is_alert}}{{{comparator}}} {{threshold}}B/mn ({{value}}B/mn){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}B/mn ({{value}}B/mn){{/is_warning}}" message = "${coalesce(var.uploaded_bytes_billed_message, var.message)}" type = "metric alert"