pub struct Condition {
pub condition_absent: Option<MetricAbsence>,
pub condition_matched_log: Option<LogMatch>,
pub condition_monitoring_query_language: Option<MonitoringQueryLanguageCondition>,
pub condition_prometheus_query_language: Option<PrometheusQueryLanguageCondition>,
pub condition_threshold: Option<MetricThreshold>,
pub display_name: Option<String>,
pub name: Option<String>,
}
Expand description
A condition is a true/false test that determines when an alerting policy should open an incident. If a condition evaluates to true, it signifies that something is wrong.
This type is not used in any activity, and only used as part of another schema.
Fields§
§condition_absent: Option<MetricAbsence>
A condition that checks that a time series continues to receive new data points.
condition_matched_log: Option<LogMatch>
A condition that checks for log messages matching given constraints. If set, no other conditions can be present.
condition_monitoring_query_language: Option<MonitoringQueryLanguageCondition>
A condition that uses the Monitoring Query Language to define alerts.
condition_prometheus_query_language: Option<PrometheusQueryLanguageCondition>
A condition that uses the Prometheus query language to define alerts.
condition_threshold: Option<MetricThreshold>
A condition that compares a time series against a threshold.
display_name: Option<String>
A short name or phrase used to identify the condition in dashboards, notifications, and incidents. To avoid confusion, don’t use the same display name for multiple conditions in the same policy.
name: Option<String>
Required if the condition exists. The unique resource name for this condition. Its format is: projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID]/conditions/[CONDITION_ID] [CONDITION_ID] is assigned by Cloud Monitoring when the condition is created as part of a new or updated alerting policy.When calling the alertPolicies.create method, do not include the name field in the conditions of the requested alerting policy. Cloud Monitoring creates the condition identifiers and includes them in the new policy.When calling the alertPolicies.update method to update a policy, including a condition name causes the existing condition to be updated. Conditions without names are added to the updated policy. Existing conditions are deleted if they are not updated.Best practice is to preserve [CONDITION_ID] if you make only small changes, such as those to condition thresholds, durations, or trigger values. Otherwise, treat the change as a new condition and let the existing condition be deleted.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Condition
impl<'de> Deserialize<'de> for Condition
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Part for Condition
Auto Trait Implementations§
impl Freeze for Condition
impl RefUnwindSafe for Condition
impl Send for Condition
impl Sync for Condition
impl Unpin for Condition
impl UnwindSafe for Condition
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more