From bee08a584b2134595817f56eadb1b1453aef5af7 Mon Sep 17 00:00:00 2001 From: Benjamin Rabiller Date: Fri, 18 Jun 2021 16:30:45 +0200 Subject: [PATCH 1/3] Decrease cache_hit_rate criticity --- modules/smart-agent_varnish/README.md | 2 +- modules/smart-agent_varnish/detectors-varnish.tf | 4 ++-- modules/smart-agent_varnish/variables.tf | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/smart-agent_varnish/README.md b/modules/smart-agent_varnish/README.md index 172bb5329..6c272eeb5 100644 --- a/modules/smart-agent_varnish/README.md +++ b/modules/smart-agent_varnish/README.md @@ -81,7 +81,7 @@ This module creates the following SignalFx detectors which could contain one or |Varnish backend Failed|X|-|-|-|-| |Varnish threads number|X|-|-|-|-| |Varnish session dropped|X|-|-|-|-| -|Varnish hit rate|-|X|X|-|-| +|Varnish hit rate|-|-|-|X|X| |Varnish memory usage|X|X|-|-|-| ## How to collect required metrics? diff --git a/modules/smart-agent_varnish/detectors-varnish.tf b/modules/smart-agent_varnish/detectors-varnish.tf index 9224b746f..ce5c26c4e 100644 --- a/modules/smart-agent_varnish/detectors-varnish.tf +++ b/modules/smart-agent_varnish/detectors-varnish.tf @@ -112,8 +112,8 @@ resource "signalfx_detector" "cache_hit_rate" { A = data('varnish.cache_hit', filter=filter('plugin', 'telegraf/varnish') and ${module.filtering.signalflow}, rollup='delta')${var.cache_hit_rate_aggregation_function}${var.cache_hit_rate_transformation_function}.publish('A') B = data('varnish.cache_miss', filter=filter('plugin', 'telegraf/varnish') and ${module.filtering.signalflow}, rollup='delta')${var.cache_hit_rate_aggregation_function}${var.cache_hit_rate_transformation_function}.publish('B') signal = (A/(A+B)).fill(0).scale(100).publish('signal') - detect(when(signal < ${var.cache_hit_rate_threshold_minor})).publish('MINOR') - detect(when(signal < ${var.cache_hit_rate_threshold_major}) and (signal > ${var.cache_hit_rate_threshold_minor})).publish('MAJOR') + detect(when(signal < ${var.cache_hit_rate_threshold_info})).publish('INFO') + detect(when(signal < ${var.cache_hit_rate_threshold_warn}) and (signal > ${var.cache_hit_rate_threshold_info})).publish('WARN') EOF rule { diff --git a/modules/smart-agent_varnish/variables.tf b/modules/smart-agent_varnish/variables.tf index a7aebed5d..8d815e192 100644 --- a/modules/smart-agent_varnish/variables.tf +++ b/modules/smart-agent_varnish/variables.tf @@ -226,8 +226,8 @@ variable "cache_hit_rate_threshold_minor" { default = 90 } -variable "cache_hit_rate_threshold_major" { - description = "Varnish cache hit rate threshold major" +variable "cache_hit_rate_threshold_warning" { + description = "Varnish cache hit rate threshold warning" type = number default = 80 } From 06e61f351ad5451447f0c3c91285543df934a6df Mon Sep 17 00:00:00 2001 From: Benjamin Rabiller Date: Fri, 2 Jul 2021 12:08:03 +0200 Subject: [PATCH 2/3] Fix forgotten vars --- modules/smart-agent_varnish/detectors-varnish.tf | 16 ++++++++-------- modules/smart-agent_varnish/variables.tf | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/modules/smart-agent_varnish/detectors-varnish.tf b/modules/smart-agent_varnish/detectors-varnish.tf index ce5c26c4e..be79e8d67 100644 --- a/modules/smart-agent_varnish/detectors-varnish.tf +++ b/modules/smart-agent_varnish/detectors-varnish.tf @@ -117,22 +117,22 @@ resource "signalfx_detector" "cache_hit_rate" { EOF rule { - description = "is too low > ${var.cache_hit_rate_threshold_major}" - severity = "Major" - detect_label = "MAJOR" + description = "is too low > ${var.cache_hit_rate_threshold_warn}" + severity = "Warning" + detect_label = "WARN" disabled = coalesce(var.cache_hit_rate_disabled_major, var.cache_hit_rate_disabled, var.detectors_disabled) - notifications = coalescelist(lookup(var.cache_hit_rate_notifications, "major", []), var.notifications.major) + notifications = coalescelist(lookup(var.cache_hit_rate_notifications, "warn", []), var.notifications.major) runbook_url = try(coalesce(var.cache_hit_rate_runbook_url, var.runbook_url), "") tip = var.cache_hit_rate_tip parameterized_subject = var.message_subject == "" ? local.rule_subject : var.message_subject parameterized_body = var.message_body == "" ? local.rule_body : var.message_body } rule { - description = "is too low > ${var.cache_hit_rate_threshold_minor}" - severity = "Minor" - detect_label = "MINOR" + description = "is too low > ${var.cache_hit_rate_threshold_info}" + severity = "Info" + detect_label = "INFO" disabled = coalesce(var.cache_hit_rate_disabled_minor, var.cache_hit_rate_disabled, var.detectors_disabled) - notifications = coalescelist(lookup(var.cache_hit_rate_notifications, "minor", []), var.notifications.minor) + notifications = coalescelist(lookup(var.cache_hit_rate_notifications, "info", []), var.notifications.minor) runbook_url = try(coalesce(var.cache_hit_rate_runbook_url, var.runbook_url), "") tip = var.cache_hit_rate_tip parameterized_subject = var.message_subject == "" ? local.rule_subject : var.message_subject diff --git a/modules/smart-agent_varnish/variables.tf b/modules/smart-agent_varnish/variables.tf index 8d815e192..45c4a3221 100644 --- a/modules/smart-agent_varnish/variables.tf +++ b/modules/smart-agent_varnish/variables.tf @@ -220,13 +220,13 @@ variable "cache_hit_rate_transformation_function" { default = ".min(over='5m')" } -variable "cache_hit_rate_threshold_minor" { - description = "Varnish cache hit rate threshold minor" +variable "cache_hit_rate_threshold_info" { + description = "Varnish cache hit rate threshold info" type = number default = 90 } -variable "cache_hit_rate_threshold_warning" { +variable "cache_hit_rate_threshold_warn" { description = "Varnish cache hit rate threshold warning" type = number default = 80 From 93ac8884bc868ea1007716fe1c18c8e58236f922 Mon Sep 17 00:00:00 2001 From: Benjamin Rabiller Date: Fri, 2 Jul 2021 12:18:53 +0200 Subject: [PATCH 3/3] Fix severity file for varnish --- docs/severity.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/severity.md b/docs/severity.md index fbdfec111..f716682e4 100644 --- a/docs/severity.md +++ b/docs/severity.md @@ -1000,7 +1000,7 @@ |Varnish backend Failed|X|-|-|-|-| |Varnish threads number|X|-|-|-|-| |Varnish session dropped|X|-|-|-|-| -|Varnish hit rate|-|X|X|-|-| +|Varnish hit rate|-|-|-|X|X| |Varnish memory usage|X|X|-|-|-|