Skip to content

Commit 4356961

Browse files
committed
- Mark 'trigger_conditions' as a beta feature
- Remove deprecation tag from 'triggers' - Restore use of 'triggers' in examples
1 parent 73d4251 commit 4356961

File tree

1 file changed

+53
-102
lines changed

1 file changed

+53
-102
lines changed

website/docs/r/monitor.html.markdown

Lines changed: 53 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,23 @@ resource "sumologic_monitor" "tf_logs_monitor_1" {
2323
row_id = "A"
2424
query = "_sourceCategory=event-action info"
2525
}
26-
trigger_conditions {
27-
logs_static_condition {
28-
critical {
29-
time_range = "15m"
30-
alert {
31-
threshold = 40.0
32-
threshold_type = "GreaterThan"
33-
}
34-
resolution {
35-
threshold = 40.0
36-
threshold_type = "LessThanOrEqual"
37-
}
38-
}
39-
}
26+
triggers {
27+
threshold_type = "GreaterThan"
28+
threshold = 40.0
29+
time_range = "15m"
30+
occurrence_type = "ResultCount"
31+
trigger_source = "AllResults"
32+
trigger_type = "Critical"
33+
detection_method = "StaticCondition"
4034
}
35+
triggers {
36+
threshold_type = "LessThanOrEqual"
37+
threshold = 40.0
38+
time_range = "15m"
39+
occurrence_type = "ResultCount"
40+
trigger_source = "AllResults"
41+
trigger_type = "ResolvedCritical"
42+
detection_method = "StaticCondition" }
4143
notifications {
4244
notification {
4345
connection_type = "Email"
@@ -74,21 +76,23 @@ resource "sumologic_monitor" "tf_metrics_monitor_1" {
7476
row_id = "A"
7577
query = "metric=CPU_Idle _sourceCategory=event-action"
7678
}
77-
trigger_conditions {
78-
metrics_static_condition {
79-
critical {
80-
time_range = "15m"
81-
occurrence_type = "AtLeastOnce"
82-
alert {
83-
threshold = 40.0
84-
threshold_type = "GreaterThan"
85-
}
86-
resolution {
87-
threshold = 40.0
88-
threshold_type = "LessThanOrEqual"
89-
}
90-
}
91-
}
79+
triggers {
80+
threshold_type = "GreaterThan"
81+
threshold = 40.0
82+
time_range = "15m"
83+
occurrence_type = "ResultCount"
84+
trigger_source = "AllResults"
85+
trigger_type = "Critical"
86+
detection_method = "StaticCondition"
87+
}
88+
triggers {
89+
threshold_type = "LessThanOrEqual"
90+
threshold = 40.0
91+
time_range = "15m"
92+
occurrence_type = "ResultCount"
93+
trigger_source = "AllResults"
94+
trigger_type = "ResolvedCritical"
95+
detection_method = "StaticCondition"
9296
}
9397
notifications {
9498
notification {
@@ -140,20 +144,23 @@ resource "sumologic_monitor" "tf_logs_monitor_2" {
140144
row_id = "A"
141145
query = "_sourceCategory=event-action info"
142146
}
143-
trigger_conditions {
144-
logs_static_condition {
145-
critical {
146-
time_range = "15m"
147-
alert {
148-
threshold = 40.0
149-
threshold_type = "GreaterThan"
150-
}
151-
resolution {
152-
threshold = 40.0
153-
threshold_type = "LessThanOrEqual"
154-
}
155-
}
156-
}
147+
triggers {
148+
threshold_type = "GreaterThan"
149+
threshold = 40.0
150+
time_range = "15m"
151+
occurrence_type = "ResultCount"
152+
trigger_source = "AllResults"
153+
trigger_type = "Critical"
154+
detection_method = "StaticCondition"
155+
}
156+
triggers {
157+
threshold_type = "LessThanOrEqual"
158+
threshold = 40.0
159+
time_range = "15m"
160+
occurrence_type = "ResultCount"
161+
trigger_source = "AllResults"
162+
trigger_type = "ResolvedCritical"
163+
detection_method = "StaticCondition"
157164
}
158165
notifications {
159166
notification {
@@ -213,8 +220,8 @@ The following arguments are supported:
213220
- `Logs`: A logs query monitor.
214221
- `Metrics`: A metrics query monitor.
215222
- `queries` - (Required) All queries from the monitor.
216-
- `trigger_conditions` - (Required if not using `triggers`) Defines the conditions of when to send notifications. NOTE: `trigger_conditions` supplants the `triggers` argument.
217-
- `triggers` - (Deprecated) Defines the conditions of when to send notifications.
223+
- `trigger_conditions` - (Beta) (Required if not using `triggers`) Defines the conditions of when to send notifications. NOTE: `trigger_conditions` supplants the `triggers` argument.
224+
- `triggers` - Defines the conditions of when to send notifications.
218225
- `notifications` - (Optional) The notifications the monitor will send when the respective trigger condition is met.
219226
- `group_notifications` - (Optional) Whether or not to group notifications for individual items that meet the trigger condition. Defaults to true.
220227

@@ -228,7 +235,7 @@ Additional data provided in state:
228235
- `Normal`
229236
- `Disabled`
230237

231-
## The `trigger_conditions` block
238+
## The `trigger_conditions` block (Beta)
232239
A `trigger_conditions` block configures conditions for sending notifications.
233240
### Example
234241
```hcl
@@ -337,62 +344,6 @@ and at most 1 missing-data condition:
337344
- `logs_missing_data_condition`
338345
- `metrics_missing_data_condition`
339346

340-
## The `triggers` block
341-
The `triggers` block is deprecated. Please use `trigger_conditions` to specify notification conditions.
342-
343-
Here's an example logs monitor that uses `triggers` to specify trigger conditions:
344-
```hcl
345-
resource "sumologic_monitor" "tf_logs_monitor_1" {
346-
name = "Terraform Logs Monitor"
347-
description = "tf logs monitor"
348-
type = "MonitorsLibraryMonitor"
349-
is_disabled = false
350-
content_type = "Monitor"
351-
monitor_type = "Logs"
352-
queries {
353-
row_id = "A"
354-
query = "_sourceCategory=event-action info"
355-
}
356-
triggers {
357-
threshold_type = "GreaterThan"
358-
threshold = 40.0
359-
time_range = "15m"
360-
occurrence_type = "ResultCount"
361-
trigger_source = "AllResults"
362-
trigger_type = "Critical"
363-
detection_method = "StaticCondition"
364-
}
365-
triggers {
366-
threshold_type = "LessThanOrEqual"
367-
threshold = 40.0
368-
time_range = "15m"
369-
occurrence_type = "ResultCount"
370-
trigger_source = "AllResults"
371-
trigger_type = "ResolvedCritical"
372-
detection_method = "StaticCondition"
373-
}
374-
notifications {
375-
notification {
376-
connection_type = "Email"
377-
recipients = [
378-
379-
]
380-
subject = "Monitor Alert: {{TriggerType}} on {{Name}}"
381-
time_zone = "PST"
382-
message_body = "Triggered {{TriggerType}} Alert on {{Name}}: {{QueryURL}}"
383-
}
384-
run_for_trigger_types = ["Critical", "ResolvedCritical"]
385-
}
386-
notifications {
387-
notification {
388-
connection_type = "Webhook"
389-
connection_id = "0000000000ABC123"
390-
}
391-
run_for_trigger_types = ["Critical", "ResolvedCritical"]
392-
}
393-
}
394-
```
395-
396347
## Import
397348

398349
Monitors can be imported using the monitor ID, such as:

0 commit comments

Comments
 (0)