1- // Copyright 2021 Google LLC
1+ // Copyright 2022 Google LLC
22//
33// Licensed under the Apache License, Version 2.0 (the "License");
44// you may not use this file except in compliance with the License.
@@ -51,7 +51,8 @@ message AlertPolicy {
5151 // The text of the documentation, interpreted according to `mime_type`.
5252 // The content may not exceed 8,192 Unicode characters and may not exceed
5353 // more than 10,240 bytes when encoded in UTF-8 format, whichever is
54- // smaller.
54+ // smaller. This text can be [templatized by using
55+ // variables](https://cloud.google.com/monitoring/alerts/doc-variables).
5556 string content = 1 ;
5657
5758 // The format of the `content` field. Presently, only the value
@@ -87,6 +88,26 @@ message AlertPolicy {
8788 }
8889 }
8990
91+ // A condition control that determines how metric-threshold conditions
92+ // are evaluated when data stops arriving.
93+ // This control doesn't affect metric-absence policies.
94+ enum EvaluationMissingData {
95+ // An unspecified evaluation missing data option. Equivalent to
96+ // EVALUATION_MISSING_DATA_NO_OP.
97+ EVALUATION_MISSING_DATA_UNSPECIFIED = 0 ;
98+
99+ // If there is no data to evaluate the condition, then evaluate the
100+ // condition as false.
101+ EVALUATION_MISSING_DATA_INACTIVE = 1 ;
102+
103+ // If there is no data to evaluate the condition, then evaluate the
104+ // condition as true.
105+ EVALUATION_MISSING_DATA_ACTIVE = 2 ;
106+
107+ // Do not evaluate the condition to any value if there is no data.
108+ EVALUATION_MISSING_DATA_NO_OP = 3 ;
109+ }
110+
90111 // A condition type that compares a collection of time series
91112 // against a threshold.
92113 message MetricThreshold {
@@ -168,6 +189,10 @@ message AlertPolicy {
168189 // or by the ratio, if `denominator_filter` and `denominator_aggregations`
169190 // are specified.
170191 Trigger trigger = 7 ;
192+
193+ // A condition control that determines how metric-threshold conditions
194+ // are evaluated when data stops arriving.
195+ EvaluationMissingData evaluation_missing_data = 11 ;
171196 }
172197
173198 // A condition type that checks that monitored resources
@@ -267,20 +292,24 @@ message AlertPolicy {
267292 // or by the ratio, if `denominator_filter` and `denominator_aggregations`
268293 // are specified.
269294 Trigger trigger = 3 ;
295+
296+ // A condition control that determines how metric-threshold conditions
297+ // are evaluated when data stops arriving.
298+ EvaluationMissingData evaluation_missing_data = 4 ;
270299 }
271300
272301 // Required if the condition exists. The unique resource name for this
273302 // condition. Its format is:
274303 //
275304 // projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID]/conditions/[CONDITION_ID]
276305 //
277- // `[CONDITION_ID]` is assigned by Stackdriver Monitoring when the
306+ // `[CONDITION_ID]` is assigned by Cloud Monitoring when the
278307 // condition is created as part of a new or updated alerting policy.
279308 //
280309 // When calling the
281310 // [alertPolicies.create][google.monitoring.v3.AlertPolicyService.CreateAlertPolicy]
282311 // method, do not include the `name` field in the conditions of the
283- // requested alerting policy. Stackdriver Monitoring creates the
312+ // requested alerting policy. Cloud Monitoring creates the
284313 // condition identifiers and includes them in the new policy.
285314 //
286315 // When calling the
@@ -320,26 +349,6 @@ message AlertPolicy {
320349 }
321350 }
322351
323- // Control over how the notification channels in `notification_channels`
324- // are notified when this alert fires.
325- message AlertStrategy {
326- // Control over the rate of notifications sent to this alert policy's
327- // notification channels.
328- message NotificationRateLimit {
329- // Not more than one notification per `period`.
330- google.protobuf.Duration period = 1 ;
331- }
332-
333- // Required for alert policies with a `LogMatch` condition.
334- //
335- // This limit is not implemented for alert policies that are not log-based.
336- NotificationRateLimit notification_rate_limit = 1 ;
337-
338- // If an alert policy that was active has no data for this long, any open
339- // incidents will close
340- google.protobuf.Duration auto_close = 3 ;
341- }
342-
343352 // Operators for combining conditions.
344353 enum ConditionCombinerType {
345354 // An unspecified combiner.
@@ -361,12 +370,32 @@ message AlertPolicy {
361370 AND_WITH_MATCHING_RESOURCE = 3 ;
362371 }
363372
373+ // Control over how the notification channels in `notification_channels`
374+ // are notified when this alert fires.
375+ message AlertStrategy {
376+ // Control over the rate of notifications sent to this alert policy's
377+ // notification channels.
378+ message NotificationRateLimit {
379+ // Not more than one notification per `period`.
380+ google.protobuf.Duration period = 1 ;
381+ }
382+
383+ // Required for alert policies with a `LogMatch` condition.
384+ //
385+ // This limit is not implemented for alert policies that are not log-based.
386+ NotificationRateLimit notification_rate_limit = 1 ;
387+
388+ // If an alert policy that was active has no data for this long, any open
389+ // incidents will close
390+ google.protobuf.Duration auto_close = 3 ;
391+ }
392+
364393 // Required if the policy exists. The resource name for this policy. The
365394 // format is:
366395 //
367396 // projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID]
368397 //
369- // `[ALERT_POLICY_ID]` is assigned by Stackdriver Monitoring when the policy
398+ // `[ALERT_POLICY_ID]` is assigned by Cloud Monitoring when the policy
370399 // is created. When calling the
371400 // [alertPolicies.create][google.monitoring.v3.AlertPolicyService.CreateAlertPolicy]
372401 // method, do not include the `name` field in the alerting policy passed as
0 commit comments