generated from kabisa/terraform-module-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
batches-compiled-percent.tf
35 lines (30 loc) · 1.56 KB
/
batches-compiled-percent.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
33
34
35
locals {
batches_compiled_percent_filter = coalesce(
var.batches_compiled_percent_filter_override,
var.filter_str
)
}
module "batches_compiled_percent" {
source = "kabisa/generic-monitor/datadog"
version = "1.0.0"
name = "SQL Server - Percentage of batches requiring compilation"
query = "avg(${var.batches_compiled_percent_evaluation_period}):(max:sqlserver.stats.sql_compilations{${local.batches_compiled_percent_filter}} by {host} / max:sqlserver.stats.batch_requests{${local.batches_compiled_percent_filter}} by {host}) * 100 >= ${var.batches_compiled_percent_critical}"
alert_message = "Database {{database.name}} on {{host.name}} has a high percent of batches requiring compilation"
recovery_message = "Database {{database.name}} on {{host.name}} has a normal percent of batches requiring compilation"
# monitor level vars
enabled = var.batches_compiled_percent_enabled
alerting_enabled = var.batches_compiled_percent_alerting_enabled
warning_threshold = var.batches_compiled_percent_warning
critical_threshold = var.batches_compiled_percent_critical
priority = var.batches_compiled_percent_priority
docs = var.batches_compiled_percent_docs
note = var.batches_compiled_percent_note
# module level vars
env = var.env
service = var.service
notification_channel = var.notification_channel
additional_tags = var.additional_tags
locked = var.locked
name_prefix = var.name_prefix
name_suffix = var.name_suffix
}