Skip to content

Commit eec9e9a

Browse files
modular-magicianJames Edouardc2thorn
authored
Make condition_prometheus_query_language.evaluation_interval optional (#8564) (#6028)
* Add support for retriggering notifications in AlertPolicy * Add support for forecast options in AlertPolicy * Move tests for forecast alerts into the handwritten file * Add support for PromQL condition type in AlertPolicy * Added test for promql alerts into the handwritten file * Add test for condition_prometheus_query_language.labels * Remove trailing whitespace * Update mmv1/products/monitoring/AlertPolicy.yaml * Make condition_prometheus_query_language.evaluation_interval optional * Remove test for condition_prometheus_query_language.evaluation_interval --------- Signed-off-by: Modular Magician <[email protected]> Co-authored-by: James Edouard <[email protected]> Co-authored-by: Cameron Thornton <[email protected]>
1 parent aa7fa8d commit eec9e9a

File tree

4 files changed

+13
-11
lines changed

4 files changed

+13
-11
lines changed

.changelog/8564.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:bug
2+
monitoring: updated `evaluation_interval` on `condition_prometheus_query_language` to be optional
3+
```

google-beta/resource_monitoring_alert_policy_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,6 @@ resource "google_monitoring_alert_policy" "promql" {
432432
condition_prometheus_query_language {
433433
query = "vector(1)"
434434
duration = "60s"
435-
evaluation_interval = "60s"
436435
labels = {
437436
"severity" = "page"
438437
}

google-beta/services/monitoring/resource_monitoring_alert_policy.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -370,15 +370,6 @@ from a Prometheus alerting rule and its associated rule group.`,
370370
MaxItems: 1,
371371
Elem: &schema.Resource{
372372
Schema: map[string]*schema.Schema{
373-
"evaluation_interval": {
374-
Type: schema.TypeString,
375-
Required: true,
376-
Description: `How often this rule should be evaluated. Must be a positive multiple
377-
of 30 seconds or missing. The default value is 30 seconds. If this
378-
PrometheusQueryLanguageCondition was generated from a Prometheus
379-
alerting rule, then this value should be taken from the enclosing
380-
rule group.`,
381-
},
382373
"query": {
383374
Type: schema.TypeString,
384375
Required: true,
@@ -408,6 +399,15 @@ valid Prometheus label name.`,
408399
to be "true" for this long. Alerts whose PromQL expression was not
409400
evaluated to be "true" for long enough are considered pending. The
410401
default value is zero. Must be zero or positive.`,
402+
},
403+
"evaluation_interval": {
404+
Type: schema.TypeString,
405+
Optional: true,
406+
Description: `How often this rule should be evaluated. Must be a positive multiple
407+
of 30 seconds or missing. The default value is 30 seconds. If this
408+
PrometheusQueryLanguageCondition was generated from a Prometheus
409+
alerting rule, then this value should be taken from the enclosing
410+
rule group.`,
411411
},
412412
"labels": {
413413
Type: schema.TypeMap,

website/docs/r/monitoring_alert_policy.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,7 @@ The following arguments are supported:
773773
default value is zero. Must be zero or positive.
774774

775775
* `evaluation_interval` -
776-
(Required)
776+
(Optional)
777777
How often this rule should be evaluated. Must be a positive multiple
778778
of 30 seconds or missing. The default value is 30 seconds. If this
779779
PrometheusQueryLanguageCondition was generated from a Prometheus

0 commit comments

Comments
 (0)