-
Notifications
You must be signed in to change notification settings - Fork 2
/
hitratio.tf
32 lines (28 loc) · 1.22 KB
/
hitratio.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
locals {
hitratio_filter = coalesce(
var.hitratio_filter_override,
var.filter_str
)
}
module "hitratio" {
source = "kabisa/generic-monitor/datadog"
version = "1.0.0"
name = "Hitratio"
query = "avg(${var.hitratio_evaluation_period}):( avg:redis.stats.keyspace_hits{${local.hitratio_filter}} / ( avg:redis.stats.keyspace_hits{${local.hitratio_filter}} + avg:redis.stats.keyspace_misses{${local.hitratio_filter}} ) ) * 100 <= ${var.hitratio_critical}"
alert_message = "Hit Ratio on ${var.service} has dropped below {{threshold}}% and is {{value}}%."
recovery_message = "Hit Ratio on ${var.service} has recovered to {{value}}%"
# monitor level vars
enabled = var.hitratio_enabled
alerting_enabled = var.hitratio_alerting_enabled
critical_threshold = var.hitratio_critical
warning_threshold = var.hitratio_warning
priority = var.hitratio_priority
docs = var.hitratio_docs
note = var.hitratio_note
# module level vars
env = var.alert_env
service = var.service
notification_channel = var.notification_channel
additional_tags = var.additional_tags
locked = var.locked
}