Package com.google.monitoring.v3
Interface AlertPolicy.Condition.PrometheusQueryLanguageConditionOrBuilder
-
- All Superinterfaces:
com.google.protobuf.MessageLiteOrBuilder
,com.google.protobuf.MessageOrBuilder
- All Known Implementing Classes:
AlertPolicy.Condition.PrometheusQueryLanguageCondition
,AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder
- Enclosing class:
- AlertPolicy.Condition
public static interface AlertPolicy.Condition.PrometheusQueryLanguageConditionOrBuilder extends com.google.protobuf.MessageOrBuilder
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description boolean
containsLabels(String key)
Optional.String
getAlertRule()
Optional.com.google.protobuf.ByteString
getAlertRuleBytes()
Optional.com.google.protobuf.Duration
getDuration()
Optional.com.google.protobuf.DurationOrBuilder
getDurationOrBuilder()
Optional.com.google.protobuf.Duration
getEvaluationInterval()
Optional.com.google.protobuf.DurationOrBuilder
getEvaluationIntervalOrBuilder()
Optional.Map<String,String>
getLabels()
Deprecated.int
getLabelsCount()
Optional.Map<String,String>
getLabelsMap()
Optional.String
getLabelsOrDefault(String key, String defaultValue)
Optional.String
getLabelsOrThrow(String key)
Optional.String
getQuery()
Required.com.google.protobuf.ByteString
getQueryBytes()
Required.String
getRuleGroup()
Optional.com.google.protobuf.ByteString
getRuleGroupBytes()
Optional.boolean
hasDuration()
Optional.boolean
hasEvaluationInterval()
Optional.-
Methods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getDefaultInstanceForType, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
-
-
-
Method Detail
-
getQuery
String getQuery()
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.
string query = 1 [(.google.api.field_behavior) = REQUIRED];
- Returns:
- The query.
-
getQueryBytes
com.google.protobuf.ByteString getQueryBytes()
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.
string query = 1 [(.google.api.field_behavior) = REQUIRED];
- Returns:
- The bytes for query.
-
hasDuration
boolean hasDuration()
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.
.google.protobuf.Duration duration = 2 [(.google.api.field_behavior) = OPTIONAL];
- Returns:
- Whether the duration field is set.
-
getDuration
com.google.protobuf.Duration getDuration()
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.
.google.protobuf.Duration duration = 2 [(.google.api.field_behavior) = OPTIONAL];
- Returns:
- The duration.
-
getDurationOrBuilder
com.google.protobuf.DurationOrBuilder getDurationOrBuilder()
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.
.google.protobuf.Duration duration = 2 [(.google.api.field_behavior) = OPTIONAL];
-
hasEvaluationInterval
boolean hasEvaluationInterval()
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.
.google.protobuf.Duration evaluation_interval = 3 [(.google.api.field_behavior) = OPTIONAL];
- Returns:
- Whether the evaluationInterval field is set.
-
getEvaluationInterval
com.google.protobuf.Duration getEvaluationInterval()
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.
.google.protobuf.Duration evaluation_interval = 3 [(.google.api.field_behavior) = OPTIONAL];
- Returns:
- The evaluationInterval.
-
getEvaluationIntervalOrBuilder
com.google.protobuf.DurationOrBuilder getEvaluationIntervalOrBuilder()
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.
.google.protobuf.Duration evaluation_interval = 3 [(.google.api.field_behavior) = OPTIONAL];
-
getLabelsCount
int getLabelsCount()
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.
map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL];
-
containsLabels
boolean containsLabels(String key)
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.
map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL];
-
getLabels
@Deprecated Map<String,String> getLabels()
Deprecated.UsegetLabelsMap()
instead.
-
getLabelsMap
Map<String,String> getLabelsMap()
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.
map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL];
-
getLabelsOrDefault
String getLabelsOrDefault(String key, String defaultValue)
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.
map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL];
-
getLabelsOrThrow
String getLabelsOrThrow(String key)
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.
map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL];
-
getRuleGroup
String getRuleGroup()
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.
string rule_group = 5 [(.google.api.field_behavior) = OPTIONAL];
- Returns:
- The ruleGroup.
-
getRuleGroupBytes
com.google.protobuf.ByteString getRuleGroupBytes()
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.
string rule_group = 5 [(.google.api.field_behavior) = OPTIONAL];
- Returns:
- The bytes for ruleGroup.
-
getAlertRule
String getAlertRule()
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.
string alert_rule = 6 [(.google.api.field_behavior) = OPTIONAL];
- Returns:
- The alertRule.
-
getAlertRuleBytes
com.google.protobuf.ByteString getAlertRuleBytes()
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.
string alert_rule = 6 [(.google.api.field_behavior) = OPTIONAL];
- Returns:
- The bytes for alertRule.
-
-