Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decrease cache_hit_rate criticity #297

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/severity.md
Original file line number Diff line number Diff line change
Expand Up @@ -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|-|-|-|


Expand Down
2 changes: 1 addition & 1 deletion modules/smart-agent_varnish/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
20 changes: 10 additions & 10 deletions modules/smart-agent_varnish/detectors-varnish.tf
Original file line number Diff line number Diff line change
Expand Up @@ -112,27 +112,27 @@ 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 {
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
Expand Down
8 changes: 4 additions & 4 deletions modules/smart-agent_varnish/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -220,14 +220,14 @@ 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_major" {
description = "Varnish cache hit rate threshold major"
variable "cache_hit_rate_threshold_warn" {
description = "Varnish cache hit rate threshold warning"
type = number
default = 80
}
Expand Down