-
Notifications
You must be signed in to change notification settings - Fork 5
/
logs-ingestion.tf
30 lines (26 loc) · 1.41 KB
/
logs-ingestion.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
locals {
logs_ingestion_filter = var.logs_ingestion_filter_override != "" ? var.logs_ingestion_filter_override : var.filter_str
logs_ingestion_notification_channel = var.logs_ingestion_alerting_enabled ? var.notification_channel : ""
}
module "logs_ingestion" {
source = "kabisa/generic-monitor/datadog"
version = "1.0.0"
name = "Daily Logs Ingestion"
query = "sum(${var.logs_ingestion_evaluation_period}):sum:custom_datadog.estimated_usage.logs.ingested_bytes{${local.logs_ingestion_filter}}.as_count() > ${var.logs_ingestion_critical}"
alert_message = "The amount of logs ingested ${var.logs_ingestion_evaluation_period} is relatively high {{value}} and crosses threshold {{threshold}}"
recovery_message = "Logs ingestion amount has recovered below {{threshold}} ({{value}})"
# monitor level vars
enabled = var.logs_ingestion_enabled
alerting_enabled = var.logs_ingestion_alerting_enabled
critical_threshold = var.logs_ingestion_critical
warning_threshold = var.logs_ingestion_warning
priority = var.logs_ingestion_priority
docs = var.logs_ingestion_docs
note = var.logs_ingestion_note
# module level vars
env = var.env
service = var.service
notification_channel = var.notification_channel
additional_tags = var.additional_tags
locked = var.locked
}