proto_docs/google/monitoring/v3/alert.rb in google-cloud-monitoring-v3-0.12.1 vs proto_docs/google/monitoring/v3/alert.rb in google-cloud-monitoring-v3-0.13.0
- old
+ new
@@ -41,10 +41,16 @@
# @return [::String]
# A short name or phrase used to identify the policy in dashboards,
# notifications, and incidents. To avoid confusion, don't use the same
# display name for multiple policies in the same project. The name is
# limited to 512 Unicode characters.
+ #
+ # The convention for the display_name of a PrometheusQueryLanguageCondition
+ # is "\\{rule group name}/\\{alert name}", where the \\{rule group name} and
+ # \\{alert name} should be taken from the corresponding Prometheus
+ # configuration file. This convention is not enforced.
+ # In any case the display_name is not a unique key of the AlertPolicy.
# @!attribute [rw] documentation
# @return [::Google::Cloud::Monitoring::V3::AlertPolicy::Documentation]
# Documentation that is included with notifications and incidents related to
# this policy. Best practice is for the documentation to include information
# to help responders understand, mitigate, escalate, and correct the
@@ -57,18 +63,27 @@
#
# The field can contain up to 64 entries. Each key and value is limited to
# 63 Unicode characters or 128 bytes, whichever is smaller. Labels and
# values can contain only lowercase letters, numerals, underscores, and
# dashes. Keys must begin with a letter.
+ #
+ # Note that Prometheus \\{alert name} is a
+ # [valid Prometheus label
+ # names](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels),
+ # whereas Prometheus \\{rule group} is an unrestricted UTF-8 string.
+ # This means that they cannot be stored as-is in user labels, because
+ # they may contain characters that are not allowed in user-label values.
# @!attribute [rw] conditions
# @return [::Array<::Google::Cloud::Monitoring::V3::AlertPolicy::Condition>]
# A list of conditions for the policy. The conditions are combined by AND or
# OR according to the `combiner` field. If the combined conditions evaluate
# to true, then an incident is created. A policy can have from one to six
# conditions.
# If `condition_time_series_query_language` is present, it must be the only
# `condition`.
+ # If `condition_monitoring_query_language` is present, it must be the only
+ # `condition`.
# @!attribute [rw] combiner
# @return [::Google::Cloud::Monitoring::V3::AlertPolicy::ConditionCombinerType]
# How to combine the results of multiple conditions to determine if an
# incident should be opened.
# If `condition_time_series_query_language` is present, this must be
@@ -80,12 +95,13 @@
# any assumption about the state if it has not been populated. The
# field should always be populated on List and Get operations, unless
# a field projection has been specified that strips it out.
# @!attribute [rw] validity
# @return [::Google::Rpc::Status]
- # Read-only description of how the alert policy is invalid. OK if the alert
- # policy is valid. If not OK, the alert policy will not generate incidents.
+ # Read-only description of how the alert policy is invalid. This field is
+ # only set when the alert policy is invalid. An invalid alert policy will not
+ # generate incidents.
# @!attribute [rw] notification_channels
# @return [::Array<::String>]
# Identifies the notification channels to which notifications should be sent
# when incidents are opened or closed or when new violations occur on
# an already opened incident. Each element of this array corresponds to
@@ -113,20 +129,35 @@
# A content string and a MIME type that describes the content string's
# format.
# @!attribute [rw] content
# @return [::String]
- # The text of the documentation, interpreted according to `mime_type`.
+ # The body of the documentation, interpreted according to `mime_type`.
# The content may not exceed 8,192 Unicode characters and may not exceed
# more than 10,240 bytes when encoded in UTF-8 format, whichever is
# smaller. This text can be [templatized by using
# variables](https://cloud.google.com/monitoring/alerts/doc-variables).
# @!attribute [rw] mime_type
# @return [::String]
# The format of the `content` field. Presently, only the value
# `"text/markdown"` is supported. See
# [Markdown](https://en.wikipedia.org/wiki/Markdown) for more information.
+ # @!attribute [rw] subject
+ # @return [::String]
+ # Optional. The subject line of the notification. The subject line may not
+ # exceed 10,240 bytes. In notifications generated by this policy, the
+ # contents of the subject line after variable expansion will be truncated
+ # to 255 bytes or shorter at the latest UTF-8 character boundary. The
+ # 255-byte limit is recommended by [this
+ # thread](https://stackoverflow.com/questions/1592291/what-is-the-email-subject-length-limit).
+ # It is both the limit imposed by some third-party ticketing products and
+ # it is common to define textual fields in databases as VARCHAR(255).
+ #
+ # The contents of the subject line can be [templatized by using
+ # variables](https://cloud.google.com/monitoring/alerts/doc-variables).
+ # If this field is missing or empty, a default subject line will be
+ # generated.
class Documentation
include ::Google::Protobuf::MessageExts
extend ::Google::Protobuf::MessageExts::ClassMethods
end
@@ -178,10 +209,13 @@
# set, no other conditions can be present.
# @!attribute [rw] condition_monitoring_query_language
# @return [::Google::Cloud::Monitoring::V3::AlertPolicy::Condition::MonitoringQueryLanguageCondition]
# A condition that uses the Monitoring Query Language to define
# alerts.
+ # @!attribute [rw] condition_prometheus_query_language
+ # @return [::Google::Cloud::Monitoring::V3::AlertPolicy::Condition::PrometheusQueryLanguageCondition]
+ # A condition that uses the Prometheus query language to define alerts.
class Condition
include ::Google::Protobuf::MessageExts
extend ::Google::Protobuf::MessageExts::ClassMethods
# Specifies how many time series must fail a predicate to trigger a
@@ -201,11 +235,12 @@
# A condition type that compares a collection of time series
# against a threshold.
# @!attribute [rw] filter
# @return [::String]
- # Required. A [filter](https://cloud.google.com/monitoring/api/v3/filters) that
+ # Required. A
+ # [filter](https://cloud.google.com/monitoring/api/v3/filters) that
# identifies which time series should be compared with the threshold.
#
# The filter is similar to the one that is specified in the
# [`ListTimeSeries`
# request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list)
@@ -247,10 +282,17 @@
# members of a group of resources).
#
# When computing ratios, the `aggregations` and
# `denominator_aggregations` fields must use the same alignment period
# and produce time series that have the same periodicity and labels.
+ # @!attribute [rw] forecast_options
+ # @return [::Google::Cloud::Monitoring::V3::AlertPolicy::Condition::MetricThreshold::ForecastOptions]
+ # When this field is present, the `MetricThreshold` condition forecasts
+ # whether the time series is predicted to violate the threshold within
+ # the `forecast_horizon`. When this field is not set, the
+ # `MetricThreshold` tests the current value of the timeseries against the
+ # threshold.
# @!attribute [rw] comparison
# @return [::Google::Cloud::Monitoring::V3::ComparisonType]
# The comparison to apply between the time series (indicated by `filter`
# and `aggregation`) and the threshold (indicated by `threshold_value`).
# The comparison is applied on each time series, with the time series
@@ -285,20 +327,35 @@
# A condition control that determines how metric-threshold conditions
# are evaluated when data stops arriving.
class MetricThreshold
include ::Google::Protobuf::MessageExts
extend ::Google::Protobuf::MessageExts::ClassMethods
+
+ # Options used when forecasting the time series and testing
+ # the predicted value against the threshold.
+ # @!attribute [rw] forecast_horizon
+ # @return [::Google::Protobuf::Duration]
+ # Required. The length of time into the future to forecast whether a
+ # time series will violate the threshold. If the predicted value is
+ # found to violate the threshold, and the violation is observed in all
+ # forecasts made for the configured `duration`, then the time series is
+ # considered to be failing.
+ class ForecastOptions
+ include ::Google::Protobuf::MessageExts
+ extend ::Google::Protobuf::MessageExts::ClassMethods
+ end
end
# 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`.
# @!attribute [rw] filter
# @return [::String]
- # Required. A [filter](https://cloud.google.com/monitoring/api/v3/filters) that
+ # Required. A
+ # [filter](https://cloud.google.com/monitoring/api/v3/filters) that
# identifies which time series should be compared with the threshold.
#
# The filter is similar to the one that is specified in the
# [`ListTimeSeries`
# request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list)
@@ -408,10 +465,114 @@
class MonitoringQueryLanguageCondition
include ::Google::Protobuf::MessageExts
extend ::Google::Protobuf::MessageExts::ClassMethods
end
+ # 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).
+ # @!attribute [rw] query
+ # @return [::String]
+ # Required. The PromQL expression to evaluate. Every evaluation cycle
+ # this expression is evaluated at the current time, and all resultant
+ # time series become pending/firing alerts. This field must not be empty.
+ # @!attribute [rw] duration
+ # @return [::Google::Protobuf::Duration]
+ # Optional. Alerts are considered firing once their PromQL expression was
+ # evaluated to be "true" for this long.
+ # Alerts whose PromQL expression was not evaluated to be "true" for
+ # long enough are considered pending.
+ # Must be a non-negative duration or missing.
+ # This field is optional. Its default value is zero.
+ # @!attribute [rw] evaluation_interval
+ # @return [::Google::Protobuf::Duration]
+ # Optional. How often this rule should be evaluated.
+ # Must be a positive multiple of 30 seconds or missing.
+ # This field is optional. Its default value is 30 seconds.
+ # If this PrometheusQueryLanguageCondition was generated from a
+ # Prometheus alerting rule, then this value should be taken from the
+ # enclosing rule group.
+ # @!attribute [rw] labels
+ # @return [::Google::Protobuf::Map{::String => ::String}]
+ # Optional. Labels to add to or overwrite in the PromQL query result.
+ # Label names [must be
+ # valid](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels).
+ # Label values can be [templatized by using
+ # variables](https://cloud.google.com/monitoring/alerts/doc-variables).
+ # The only available variable names are the names of the labels in the
+ # PromQL result, including "__name__" and "value". "labels" may be empty.
+ # @!attribute [rw] rule_group
+ # @return [::String]
+ # Optional. The rule group name of this alert in the corresponding
+ # Prometheus configuration file.
+ #
+ # Some external tools may require this field to be populated correctly
+ # in order to refer to the original Prometheus configuration file.
+ # The rule group name and the alert name are necessary to update the
+ # relevant AlertPolicies in case the definition of the rule group changes
+ # in the future.
+ #
+ # This field is optional. If this field is not empty, then it must
+ # contain a valid UTF-8 string.
+ # This field may not exceed 2048 Unicode characters in length.
+ # @!attribute [rw] alert_rule
+ # @return [::String]
+ # Optional. The alerting rule name of this alert in the corresponding
+ # Prometheus configuration file.
+ #
+ # Some external tools may require this field to be populated correctly
+ # in order to refer to the original Prometheus configuration file.
+ # The rule group name and the alert name are necessary to update the
+ # relevant AlertPolicies in case the definition of the rule group changes
+ # in the future.
+ #
+ # This field is optional. If this field is not empty, then it must be a
+ # [valid Prometheus label
+ # name](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels).
+ # This field may not exceed 2048 Unicode characters in length.
+ class PrometheusQueryLanguageCondition
+ include ::Google::Protobuf::MessageExts
+ extend ::Google::Protobuf::MessageExts::ClassMethods
+
+ # @!attribute [rw] key
+ # @return [::String]
+ # @!attribute [rw] value
+ # @return [::String]
+ class LabelsEntry
+ include ::Google::Protobuf::MessageExts
+ extend ::Google::Protobuf::MessageExts::ClassMethods
+ end
+ end
+
# A condition control that determines how metric-threshold conditions
# are evaluated when data stops arriving.
# This control doesn't affect metric-absence policies.
module EvaluationMissingData
# An unspecified evaluation missing data option. Equivalent to
@@ -440,19 +601,42 @@
# This limit is not implemented for alert policies that are not log-based.
# @!attribute [rw] auto_close
# @return [::Google::Protobuf::Duration]
# If an alert policy that was active has no data for this long, any open
# incidents will close
+ # @!attribute [rw] notification_channel_strategy
+ # @return [::Array<::Google::Cloud::Monitoring::V3::AlertPolicy::AlertStrategy::NotificationChannelStrategy>]
+ # Control how notifications will be sent out, on a per-channel basis.
class AlertStrategy
include ::Google::Protobuf::MessageExts
extend ::Google::Protobuf::MessageExts::ClassMethods
# Control over the rate of notifications sent to this alert policy's
# notification channels.
# @!attribute [rw] period
# @return [::Google::Protobuf::Duration]
# Not more than one notification per `period`.
class NotificationRateLimit
+ include ::Google::Protobuf::MessageExts
+ extend ::Google::Protobuf::MessageExts::ClassMethods
+ end
+
+ # Control over how the notification channels in `notification_channels`
+ # are notified when this alert fires, on a per-channel basis.
+ # @!attribute [rw] notification_channel_names
+ # @return [::Array<::String>]
+ # The full REST resource name for the notification channels that these
+ # settings apply to. Each of these correspond to the name field in one
+ # of the NotificationChannel objects referenced in the
+ # notification_channels field of this AlertPolicy.
+ # The format is:
+ #
+ # projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID]
+ # @!attribute [rw] renotify_interval
+ # @return [::Google::Protobuf::Duration]
+ # The frequency at which to send reminder notifications for open
+ # incidents.
+ class NotificationChannelStrategy
include ::Google::Protobuf::MessageExts
extend ::Google::Protobuf::MessageExts::ClassMethods
end
end