You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add support for active timings to notification policies (#2249)
* add support for active timings
* update schema
* add exclusion to TestAccNotificationPolicy_inheritContactPoint
* run notificaiton policies only for 12.1
* fix one more test
* Update internal/resources/grafana/resource_alerting_notification_policy.go
Co-authored-by: Alexander Akhmetov <[email protected]>
---------
Co-authored-by: Alexander Akhmetov <[email protected]>
-`active_timings` (List of String) A list of time interval names to apply to alerts that match this policy to suppress them unless they are sent at the specified time. Supported in Grafana 12.1.0 and later
125
137
-`contact_point` (String) The contact point to route notifications that match this rule to.
126
138
-`continue` (Boolean) Whether to continue matching subsequent rules if an alert matches the current rule. Otherwise, the rule will be 'consumed' by the first policy to match it.
127
139
-`group_by` (List of String) A list of alert labels to group alerts into notifications by. Use the special label `...` to group alerts by all labels, effectively disabling grouping. Required for root policy only. If empty, the parent grouping is used.
128
140
-`group_interval` (String) Minimum time interval between two notifications for the same group. Default is 5 minutes.
129
141
-`group_wait` (String) Time to wait to buffer alerts of the same group before sending a notification. Default is 30 seconds.
130
142
-`matcher` (Block Set) Describes which labels this rule should match. When multiple matchers are supplied, an alert must match ALL matchers to be accepted by this policy. When no matchers are supplied, the rule will match all alert instances. (see [below for nested schema](#nestedblock--policy--matcher))
131
-
-`mute_timings` (List of String) A list of mute timing names to apply to alerts that match this policy.
143
+
-`mute_timings` (List of String) A list of time intervals to apply to alerts that match this policy to mute them for the specified time.
132
144
-`policy` (Block List) Routing rules for specific label sets. (see [below for nested schema](#nestedblock--policy--policy))
133
145
-`repeat_interval` (String) Minimum time interval for re-sending a notification if an alert is still firing. Default is 4 hours.
134
146
@@ -147,13 +159,14 @@ Required:
147
159
148
160
Optional:
149
161
162
+
-`active_timings` (List of String) A list of time interval names to apply to alerts that match this policy to suppress them unless they are sent at the specified time. Supported in Grafana 12.1.0 and later
150
163
-`contact_point` (String) The contact point to route notifications that match this rule to.
151
164
-`continue` (Boolean) Whether to continue matching subsequent rules if an alert matches the current rule. Otherwise, the rule will be 'consumed' by the first policy to match it.
152
165
-`group_by` (List of String) A list of alert labels to group alerts into notifications by. Use the special label `...` to group alerts by all labels, effectively disabling grouping. Required for root policy only. If empty, the parent grouping is used.
153
166
-`group_interval` (String) Minimum time interval between two notifications for the same group. Default is 5 minutes.
154
167
-`group_wait` (String) Time to wait to buffer alerts of the same group before sending a notification. Default is 30 seconds.
155
168
-`matcher` (Block Set) Describes which labels this rule should match. When multiple matchers are supplied, an alert must match ALL matchers to be accepted by this policy. When no matchers are supplied, the rule will match all alert instances. (see [below for nested schema](#nestedblock--policy--policy--matcher))
156
-
-`mute_timings` (List of String) A list of mute timing names to apply to alerts that match this policy.
169
+
-`mute_timings` (List of String) A list of time intervals to apply to alerts that match this policy to mute them for the specified time.
157
170
-`policy` (Block List) Routing rules for specific label sets. (see [below for nested schema](#nestedblock--policy--policy--policy))
158
171
-`repeat_interval` (String) Minimum time interval for re-sending a notification if an alert is still firing. Default is 4 hours.
159
172
@@ -172,13 +185,14 @@ Required:
172
185
173
186
Optional:
174
187
188
+
-`active_timings` (List of String) A list of time interval names to apply to alerts that match this policy to suppress them unless they are sent at the specified time. Supported in Grafana 12.1.0 and later
175
189
-`contact_point` (String) The contact point to route notifications that match this rule to.
176
190
-`continue` (Boolean) Whether to continue matching subsequent rules if an alert matches the current rule. Otherwise, the rule will be 'consumed' by the first policy to match it.
177
191
-`group_by` (List of String) A list of alert labels to group alerts into notifications by. Use the special label `...` to group alerts by all labels, effectively disabling grouping. Required for root policy only. If empty, the parent grouping is used.
178
192
-`group_interval` (String) Minimum time interval between two notifications for the same group. Default is 5 minutes.
179
193
-`group_wait` (String) Time to wait to buffer alerts of the same group before sending a notification. Default is 30 seconds.
180
194
-`matcher` (Block Set) Describes which labels this rule should match. When multiple matchers are supplied, an alert must match ALL matchers to be accepted by this policy. When no matchers are supplied, the rule will match all alert instances. (see [below for nested schema](#nestedblock--policy--policy--policy--matcher))
181
-
-`mute_timings` (List of String) A list of mute timing names to apply to alerts that match this policy.
195
+
-`mute_timings` (List of String) A list of time intervals to apply to alerts that match this policy to mute them for the specified time.
182
196
-`policy` (Block List) Routing rules for specific label sets. (see [below for nested schema](#nestedblock--policy--policy--policy--policy))
183
197
-`repeat_interval` (String) Minimum time interval for re-sending a notification if an alert is still firing. Default is 4 hours.
184
198
@@ -201,12 +215,13 @@ Required:
201
215
202
216
Optional:
203
217
218
+
-`active_timings` (List of String) A list of time interval names to apply to alerts that match this policy to suppress them unless they are sent at the specified time. Supported in Grafana 12.1.0 and later
204
219
-`contact_point` (String) The contact point to route notifications that match this rule to.
205
220
-`continue` (Boolean) Whether to continue matching subsequent rules if an alert matches the current rule. Otherwise, the rule will be 'consumed' by the first policy to match it.
206
221
-`group_interval` (String) Minimum time interval between two notifications for the same group. Default is 5 minutes.
207
222
-`group_wait` (String) Time to wait to buffer alerts of the same group before sending a notification. Default is 30 seconds.
208
223
-`matcher` (Block Set) Describes which labels this rule should match. When multiple matchers are supplied, an alert must match ALL matchers to be accepted by this policy. When no matchers are supplied, the rule will match all alert instances. (see [below for nested schema](#nestedblock--policy--policy--policy--policy--matcher))
209
-
-`mute_timings` (List of String) A list of mute timing names to apply to alerts that match this policy.
224
+
-`mute_timings` (List of String) A list of time intervals to apply to alerts that match this policy to mute them for the specified time.
210
225
-`repeat_interval` (String) Minimum time interval for re-sending a notification if an alert is still firing. Default is 4 hours.
testutils.CheckOSSTestsEnabled(t, ">=11.0.0") // Only run on latest OSS version. The examples should be updated to reflect their latest working config.
testutils.CheckOSSTestsEnabled(t, ">=12.1.0") // Only run on latest OSS version. The examples should be updated to reflect their latest working config.
34
+
} else {
35
+
testutils.CheckOSSTestsEnabled(t, ">=11.0.0") // Only run on latest OSS version. The examples should be updated to reflect their latest working config.
Description: "A list of mute timing names to apply to alerts that match this policy.",
154
+
Description: "A list of time intervals to apply to alerts that match this policy to mute them for the specified time.",
155
+
Elem: &schema.Schema{
156
+
Type: schema.TypeString,
157
+
},
158
+
},
159
+
"active_timings": {
160
+
Type: schema.TypeList,
161
+
Optional: true,
162
+
Description: "A list of time interval names to apply to alerts that match this policy to suppress them unless they are sent at the specified time. Supported in Grafana 12.1.0 and later",
0 commit comments