MON-306 use normalized metric for load and replace percentage by ratio

This commit is contained in:
Quentin Manfroi 2018-09-26 11:39:39 +02:00
parent bbc695e491
commit 7af01c5bb1

View File

@ -32,13 +32,12 @@ resource "datadog_monitor" "datadog_cpu_too_high" {
resource "datadog_monitor" "datadog_load_too_high" { resource "datadog_monitor" "datadog_load_too_high" {
count = "${var.cpu_load_enabled ? 1 : 0}" count = "${var.cpu_load_enabled ? 1 : 0}"
name = "[${var.environment}] CPU load 5 {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" name = "[${var.environment}] CPU load 5 ratio {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}"
message = "${coalesce(var.cpu_load_message, var.message)}" message = "${coalesce(var.cpu_load_message, var.message)}"
query = <<EOF query = <<EOF
${var.cpu_load_time_aggregator}(${var.cpu_load_timeframe}): ( ${var.cpu_load_time_aggregator}(${var.cpu_load_timeframe}): (
avg:system.load.5${module.filter-tags.query_alert} by {region,host} / avg:system.load.norm.5${module.filter-tags.query_alert} by {region,host}
avg:system.core.count${module.filter-tags.query_alert} by {region,host}
) > ${var.cpu_load_threshold_critical} ) > ${var.cpu_load_threshold_critical}
EOF EOF