Class: Google::Apis::MonitoringV3::Condition
- Inherits:
-
Object
- Object
- Google::Apis::MonitoringV3::Condition
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- lib/google/apis/monitoring_v3/classes.rb,
lib/google/apis/monitoring_v3/representations.rb,
lib/google/apis/monitoring_v3/representations.rb
Overview
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.
Instance Attribute Summary collapse
-
#condition_absent ⇒ Google::Apis::MonitoringV3::MetricAbsence
A condition type that checks that monitored resources are reporting data.
-
#condition_matched_log ⇒ Google::Apis::MonitoringV3::LogMatch
A condition type that checks whether a log message in the scoping project ( https://cloud.google.com/monitoring/api/v3#project_name) satisfies the given filter.
-
#condition_monitoring_query_language ⇒ Google::Apis::MonitoringV3::MonitoringQueryLanguageCondition
A condition type that allows alert policies to be defined using Monitoring Query Language (https://cloud.google.com/monitoring/mql).
-
#condition_prometheus_query_language ⇒ Google::Apis::MonitoringV3::PrometheusQueryLanguageCondition
A condition type that allows alert policies to be defined using Prometheus Query Language (PromQL) (https://prometheus.io/docs/prometheus/latest/querying/ basics/).The PrometheusQueryLanguageCondition message contains information from a Prometheus alerting rule and its associated rule group.A Prometheus alerting rule is described here (https://prometheus.io/docs/prometheus/latest/ configuration/alerting_rules/).
-
#condition_threshold ⇒ Google::Apis::MonitoringV3::MetricThreshold
A condition type that compares a collection of time series against a threshold.
-
#display_name ⇒ String
A short name or phrase used to identify the condition in dashboards, notifications, and incidents.
-
#name ⇒ String
Required if the condition exists.
Instance Method Summary collapse
-
#initialize(**args) ⇒ Condition
constructor
A new instance of Condition.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ Condition
Returns a new instance of Condition.
875 876 877 |
# File 'lib/google/apis/monitoring_v3/classes.rb', line 875 def initialize(**args) update!(**args) end |
Instance Attribute Details
#condition_absent ⇒ Google::Apis::MonitoringV3::MetricAbsence
A condition type that checks that monitored resources are reporting data. The
configuration defines a metric and a set of monitored resources. The predicate
is considered in violation when a time series for the specified metric of a
monitored resource does not include any data in the specified duration.
Corresponds to the JSON property conditionAbsent
804 805 806 |
# File 'lib/google/apis/monitoring_v3/classes.rb', line 804 def condition_absent @condition_absent end |
#condition_matched_log ⇒ Google::Apis::MonitoringV3::LogMatch
A condition type that checks whether a log message in the scoping project (
https://cloud.google.com/monitoring/api/v3#project_name) satisfies the given
filter. Logs from other projects in the metrics scope are not evaluated.
Corresponds to the JSON property conditionMatchedLog
811 812 813 |
# File 'lib/google/apis/monitoring_v3/classes.rb', line 811 def condition_matched_log @condition_matched_log end |
#condition_monitoring_query_language ⇒ Google::Apis::MonitoringV3::MonitoringQueryLanguageCondition
A condition type that allows alert policies to be defined using Monitoring
Query Language (https://cloud.google.com/monitoring/mql).
Corresponds to the JSON property conditionMonitoringQueryLanguage
817 818 819 |
# File 'lib/google/apis/monitoring_v3/classes.rb', line 817 def condition_monitoring_query_language @condition_monitoring_query_language end |
#condition_prometheus_query_language ⇒ Google::Apis::MonitoringV3::PrometheusQueryLanguageCondition
A condition type that allows alert policies to be defined using Prometheus
Query Language (PromQL) (https://prometheus.io/docs/prometheus/latest/querying/
basics/).The PrometheusQueryLanguageCondition message contains information
from a Prometheus alerting rule and its associated rule group.A Prometheus
alerting rule is described here (https://prometheus.io/docs/prometheus/latest/
configuration/alerting_rules/). The semantics of a Prometheus alerting rule is
described here (https://prometheus.io/docs/prometheus/latest/configuration/
recording_rules/#rule).A Prometheus rule group is described here (https://
prometheus.io/docs/prometheus/latest/configuration/recording_rules/). The
semantics of a Prometheus rule group is described here (https://prometheus.io/
docs/prometheus/latest/configuration/recording_rules/#rule_group).Because
Cloud Alerting has no representation of a Prometheus rule group resource, we
must embed the information of the parent rule group inside each of the
conditions that refer to it. We must also update the contents of all
Prometheus alerts in case the information of their rule group changes.The
PrometheusQueryLanguageCondition protocol buffer combines the information of
the corresponding rule group and alerting rule. The structure of the
PrometheusQueryLanguageCondition protocol buffer does NOT mimic the structure
of the Prometheus rule group and alerting rule YAML declarations. The
PrometheusQueryLanguageCondition protocol buffer may change in the future to
support future rule group and/or alerting rule features. There are no new such
features at the present time (2023-06-26).
Corresponds to the JSON property conditionPrometheusQueryLanguage
843 844 845 |
# File 'lib/google/apis/monitoring_v3/classes.rb', line 843 def condition_prometheus_query_language @condition_prometheus_query_language end |
#condition_threshold ⇒ Google::Apis::MonitoringV3::MetricThreshold
A condition type that compares a collection of time series against a threshold.
Corresponds to the JSON property conditionThreshold
848 849 850 |
# File 'lib/google/apis/monitoring_v3/classes.rb', line 848 def condition_threshold @condition_threshold end |
#display_name ⇒ 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.
Corresponds to the JSON property displayName
855 856 857 |
# File 'lib/google/apis/monitoring_v3/classes.rb', line 855 def display_name @display_name end |
#name ⇒ 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.
Corresponds to the JSON property name
873 874 875 |
# File 'lib/google/apis/monitoring_v3/classes.rb', line 873 def name @name end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
880 881 882 883 884 885 886 887 888 |
# File 'lib/google/apis/monitoring_v3/classes.rb', line 880 def update!(**args) @condition_absent = args[:condition_absent] if args.key?(:condition_absent) @condition_matched_log = args[:condition_matched_log] if args.key?(:condition_matched_log) @condition_monitoring_query_language = args[:condition_monitoring_query_language] if args.key?(:condition_monitoring_query_language) @condition_prometheus_query_language = args[:condition_prometheus_query_language] if args.key?(:condition_prometheus_query_language) @condition_threshold = args[:condition_threshold] if args.key?(:condition_threshold) @display_name = args[:display_name] if args.key?(:display_name) @name = args[:name] if args.key?(:name) end |