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

Key vault latency detector: remove critical status #465

Merged
merged 5 commits into from
Apr 18, 2023
Merged
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 @@ -517,7 +517,7 @@
|Detector|Critical|Major|Minor|Warning|Info|
|---|---|---|---|---|---|
|Azure Key Vault API result rate|X|X|-|-|-|
|Azure Key Vault API latency|X|X|-|-|-|
|Azure Key Vault API latency|-|X|X|-|-|


## integration_azure-load-balancer
Expand Down
2 changes: 1 addition & 1 deletion modules/integration_azure-key-vault/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ This module creates the following SignalFx detectors which could contain one or
|Detector|Critical|Major|Minor|Warning|Info|
|---|---|---|---|---|---|
|Azure Key Vault API result rate|X|X|-|-|-|
|Azure Key Vault API latency|X|X|-|-|-|
|Azure Key Vault API latency|-|X|X|-|-|

## How to collect required metrics?

Expand Down
24 changes: 12 additions & 12 deletions modules/integration_azure-key-vault/detectors-keyvault.tf
Original file line number Diff line number Diff line change
Expand Up @@ -51,28 +51,28 @@ resource "signalfx_detector" "api_latency" {
program_text = <<-EOF
base_filter = filter('resource_type', 'Microsoft.KeyVault/vaults') and filter('primary_aggregation_type', 'true')
signal = data('ServiceApiLatency', extrapolation="zero", filter=base_filter and not filter('activityname', 'secretlist') and ${module.filtering.signalflow})${var.api_latency_aggregation_function}.publish('signal')
detect(when(signal > threshold(${var.api_latency_threshold_critical}), lasting="${var.api_latency_lasting_duration_critical}")).publish('CRIT')
detect(when(signal > threshold(${var.api_latency_threshold_major}), lasting="${var.api_latency_lasting_duration_major}") and (not when(signal > ${var.api_latency_threshold_critical}, lasting="${var.api_latency_lasting_duration_critical}"))).publish('MAJOR')
detect(when(signal > threshold(${var.api_latency_threshold_major}), lasting="${var.api_latency_lasting_duration_major}")).publish('MAJOR')
detect(when(signal > threshold(${var.api_latency_threshold_minor}), lasting="${var.api_latency_lasting_duration_minor}") and (not when(signal > ${var.api_latency_threshold_major}, lasting="${var.api_latency_lasting_duration_major}"))).publish('MINOR')
EOF

rule {
description = "is too high > ${var.api_latency_threshold_critical}ms"
severity = "Critical"
detect_label = "CRIT"
disabled = coalesce(var.api_latency_disabled_critical, var.api_latency_disabled, var.detectors_disabled)
notifications = try(coalescelist(lookup(var.api_latency_notifications, "critical", []), var.notifications.critical), null)
description = "is too high > ${var.api_latency_threshold_major}ms"
severity = "Major"
detect_label = "MAJOR"
disabled = coalesce(var.api_latency_disabled_major, var.api_latency_disabled, var.detectors_disabled)
notifications = try(coalescelist(lookup(var.api_latency_notifications, "major", []), var.notifications.major), null)
runbook_url = try(coalesce(var.api_latency_runbook_url, var.runbook_url), "")
tip = var.api_latency_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 high > ${var.api_latency_threshold_major}ms"
severity = "Major"
detect_label = "MAJOR"
disabled = coalesce(var.api_latency_disabled_major, var.api_latency_disabled, var.detectors_disabled)
notifications = try(coalescelist(lookup(var.api_latency_notifications, "major", []), var.notifications.major), null)
description = "is too high > ${var.api_latency_threshold_minor}ms"
severity = "Minor"
detect_label = "MINOR"
disabled = coalesce(var.api_latency_disabled_minor, var.api_latency_disabled, var.detectors_disabled)
notifications = try(coalescelist(lookup(var.api_latency_notifications, "minor", []), var.notifications.minor), null)
runbook_url = try(coalesce(var.api_latency_runbook_url, var.runbook_url), "")
tip = var.api_latency_tip
parameterized_subject = var.message_subject == "" ? local.rule_subject : var.message_subject
Expand Down
22 changes: 11 additions & 11 deletions modules/integration_azure-key-vault/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ variable "api_latency_disabled" {
default = null
}

variable "api_latency_disabled_critical" {
description = "Disable critical alerting rule for api_latency detector"
variable "api_latency_disabled_minor" {
description = "Disable minor alerting rule for api_latency detector"
type = bool
default = null
}
Expand All @@ -124,22 +124,22 @@ variable "api_latency_aggregation_function" {
default = ".mean(by=['azure_resource_name', 'azure_resource_group_name', 'azure_region'])"
}

variable "api_latency_lasting_duration_critical" {
variable "api_latency_lasting_duration_minor" {
description = "Evaluation window for api_latency detector (i.e. 5m, 20m, 1h, 1d)"
type = string
default = "1h"
}

variable "api_latency_threshold_critical" {
description = "Critical threshold for api_latency detector"
type = number
default = 500
default = "30m"
}

variable "api_latency_lasting_duration_major" {
description = "Evaluation window for api_latency detector (i.e. 5m, 20m, 1h, 1d)"
type = string
default = "30m"
default = "1h"
}

variable "api_latency_threshold_minor" {
description = "Minor threshold for api_latency detector"
type = number
default = 500
}

variable "api_latency_threshold_major" {
Expand Down