-
Notifications
You must be signed in to change notification settings - Fork 0
/
datadog_monitors.tf
61 lines (48 loc) · 1.87 KB
/
datadog_monitors.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Monitors
resource "datadog_monitor" "acme_web_alb" {
name = "ACME Web ALB healthy hosts"
type = "metric alert"
message = "Monitor triggered. Notify: @pagerduty-${datadog_integration_pagerduty_service_object.ruleset_example.service_name}"
query = "avg(last_5m):avg:aws.applicationelb.un_healthy_host_count{name:acme-web-lb} >= 2"
monitor_thresholds {
ok = 0
warning = 1
critical = 2
}
evaluation_delay = 60
tags = ["pdservice:web_app"]
}
resource "datadog_monitor" "acme_web_asg" {
name = "ACME Web ASG in-service hosts"
type = "metric alert"
message = "Monitor triggered. Notify: @pagerduty-${datadog_integration_pagerduty_service_object.ruleset_example.service_name}"
query = "avg(last_5m):avg:aws.autoscaling.group_in_service_instances{name:acme-web-frontends} <= 1"
monitor_thresholds {
ok = 2
warning = 2
critical = 1
}
evaluation_delay = 60
tags = ["pdservice:web_app"]
}
resource "datadog_monitor" "acme_db" {
name = "ACME Web RDS free storage space"
type = "metric alert"
message = "Monitor triggered. Notify: @pagerduty-${datadog_integration_pagerduty_service_object.ruleset_example.service_name}"
query = "avg(last_5m):avg:aws.rds.free_storage_space{name:acmewebdb-postgres} <= 1000000000"
monitor_thresholds {
ok = 4000000000
warning = 2000000000
critical = 1000000000
}
evaluation_delay = 60
tags = ["pdservice:web_db"]
}
resource "datadog_monitor" "acme_service_example" {
name = "ACME Datadog Agent alert"
type = "service check"
message = "Datadog agent is down on {{host.name}}. Notify: @pagerduty-${datadog_integration_pagerduty_service_object.service_example.service_name}"
query = "\"datadog.agent.up\".over(\"*\").by(\"host\").last(2).count_by_status()"
evaluation_delay = 60
notify_no_data = true
}