Class AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder (3.36.0)

public static final class AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder extends GeneratedMessageV3.Builder<AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder> implements AlertPolicy.Condition.PrometheusQueryLanguageConditionOrBuilder

A condition type that allows alert policies to be defined using Prometheus Query Language (PromQL).

The PrometheusQueryLanguageCondition message contains information from a Prometheus alerting rule and its associated rule group.

A Prometheus alerting rule is described here. The semantics of a Prometheus alerting rule is described here.

A Prometheus rule group is described here. The semantics of a Prometheus rule group is described here.

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).

Protobuf type google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition

Inheritance

Object > AbstractMessageLite.Builder<MessageType,BuilderType> > AbstractMessage.Builder<BuilderType> > GeneratedMessageV3.Builder > AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder
Overrides

build()

public AlertPolicy.Condition.PrometheusQueryLanguageCondition build()
Returns
TypeDescription
AlertPolicy.Condition.PrometheusQueryLanguageCondition

buildPartial()

public AlertPolicy.Condition.PrometheusQueryLanguageCondition buildPartial()
Returns
TypeDescription
AlertPolicy.Condition.PrometheusQueryLanguageCondition

clear()

public AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder clear()
Returns
TypeDescription
AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder
Overrides

clearAlertRule()

public AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder clearAlertRule()

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. This field may not exceed 2048 Unicode characters in length.

string alert_rule = 6 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder

This builder for chaining.

clearDuration()

public AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder clearDuration()

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
TypeDescription
AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder

clearEvaluationInterval()

public AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder clearEvaluationInterval()

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
TypeDescription
AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder

clearField(Descriptors.FieldDescriptor field)

public AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder
Overrides

clearLabels()

public AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder clearLabels()
Returns
TypeDescription
AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder

clearOneof(Descriptors.OneofDescriptor oneof)

public AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder
Overrides

clearQuery()

public AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder clearQuery()

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
TypeDescription
AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder

This builder for chaining.

clearRuleGroup()

public AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder clearRuleGroup()

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
TypeDescription
AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder

This builder for chaining.

clone()

public AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder clone()
Returns
TypeDescription
AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder
Overrides

containsLabels(String key)

public boolean containsLabels(String key)

Optional. Labels to add to or overwrite in the PromQL query result. Label names must be valid. Label values can be templatized by using 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];

Parameter
NameDescription
keyString
Returns
TypeDescription
boolean

getAlertRule()

public 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. This field may not exceed 2048 Unicode characters in length.

string alert_rule = 6 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
String

The alertRule.

getAlertRuleBytes()

public 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. This field may not exceed 2048 Unicode characters in length.

string alert_rule = 6 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
ByteString

The bytes for alertRule.

getDefaultInstanceForType()

public AlertPolicy.Condition.PrometheusQueryLanguageCondition getDefaultInstanceForType()
Returns
TypeDescription
AlertPolicy.Condition.PrometheusQueryLanguageCondition

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getDuration()

public 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
TypeDescription
Duration

The duration.

getDurationBuilder()

public Duration.Builder getDurationBuilder()

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
TypeDescription
Builder

getDurationOrBuilder()

public 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];

Returns
TypeDescription
DurationOrBuilder

getEvaluationInterval()

public 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
TypeDescription
Duration

The evaluationInterval.

getEvaluationIntervalBuilder()

public Duration.Builder getEvaluationIntervalBuilder()

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
TypeDescription
Builder

getEvaluationIntervalOrBuilder()

public 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];

Returns
TypeDescription
DurationOrBuilder

getLabels() (deprecated)

public Map<String,String> getLabels()

Use #getLabelsMap() instead.

Returns
TypeDescription
Map<String,String>

getLabelsCount()

public int getLabelsCount()

Optional. Labels to add to or overwrite in the PromQL query result. Label names must be valid. Label values can be templatized by using 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];

Returns
TypeDescription
int

getLabelsMap()

public Map<String,String> getLabelsMap()

Optional. Labels to add to or overwrite in the PromQL query result. Label names must be valid. Label values can be templatized by using 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];

Returns
TypeDescription
Map<String,String>

getLabelsOrDefault(String key, String defaultValue)

public String getLabelsOrDefault(String key, String defaultValue)

Optional. Labels to add to or overwrite in the PromQL query result. Label names must be valid. Label values can be templatized by using 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];

Parameters
NameDescription
keyString
defaultValueString
Returns
TypeDescription
String

getLabelsOrThrow(String key)

public String getLabelsOrThrow(String key)

Optional. Labels to add to or overwrite in the PromQL query result. Label names must be valid. Label values can be templatized by using 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];

Parameter
NameDescription
keyString
Returns
TypeDescription
String

getMutableLabels() (deprecated)

public Map<String,String> getMutableLabels()

Use alternate mutation accessors instead.

Returns
TypeDescription
Map<String,String>

getQuery()

public 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
TypeDescription
String

The query.

getQueryBytes()

public 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
TypeDescription
ByteString

The bytes for query.

getRuleGroup()

public 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
TypeDescription
String

The ruleGroup.

getRuleGroupBytes()

public 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
TypeDescription
ByteString

The bytes for ruleGroup.

hasDuration()

public 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
TypeDescription
boolean

Whether the duration field is set.

hasEvaluationInterval()

public 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
TypeDescription
boolean

Whether the evaluationInterval field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

internalGetMapFieldReflection(int number)

protected MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
Parameter
NameDescription
numberint
Returns
TypeDescription
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMapFieldReflection(int)

internalGetMutableMapFieldReflection(int number)

protected MapFieldReflectionAccessor internalGetMutableMapFieldReflection(int number)
Parameter
NameDescription
numberint
Returns
TypeDescription
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMutableMapFieldReflection(int)

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeDuration(Duration value)

public AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder mergeDuration(Duration value)

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];

Parameter
NameDescription
valueDuration
Returns
TypeDescription
AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder

mergeEvaluationInterval(Duration value)

public AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder mergeEvaluationInterval(Duration value)

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];

Parameter
NameDescription
valueDuration
Returns
TypeDescription
AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder

mergeFrom(AlertPolicy.Condition.PrometheusQueryLanguageCondition other)

public AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder mergeFrom(AlertPolicy.Condition.PrometheusQueryLanguageCondition other)
Parameter
NameDescription
otherAlertPolicy.Condition.PrometheusQueryLanguageCondition
Returns
TypeDescription
AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder
Overrides

putAllLabels(Map<String,String> values)

public AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder putAllLabels(Map<String,String> values)

Optional. Labels to add to or overwrite in the PromQL query result. Label names must be valid. Label values can be templatized by using 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];

Parameter
NameDescription
valuesMap<String,String>
Returns
TypeDescription
AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder

putLabels(String key, String value)

public AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder putLabels(String key, String value)

Optional. Labels to add to or overwrite in the PromQL query result. Label names must be valid. Label values can be templatized by using 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];

Parameters
NameDescription
keyString
valueString
Returns
TypeDescription
AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder

removeLabels(String key)

public AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder removeLabels(String key)

Optional. Labels to add to or overwrite in the PromQL query result. Label names must be valid. Label values can be templatized by using 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];

Parameter
NameDescription
keyString
Returns
TypeDescription
AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder

setAlertRule(String value)

public AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder setAlertRule(String value)

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. This field may not exceed 2048 Unicode characters in length.

string alert_rule = 6 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
valueString

The alertRule to set.

Returns
TypeDescription
AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder

This builder for chaining.

setAlertRuleBytes(ByteString value)

public AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder setAlertRuleBytes(ByteString value)

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. This field may not exceed 2048 Unicode characters in length.

string alert_rule = 6 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
valueByteString

The bytes for alertRule to set.

Returns
TypeDescription
AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder

This builder for chaining.

setDuration(Duration value)

public AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder setDuration(Duration value)

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];

Parameter
NameDescription
valueDuration
Returns
TypeDescription
AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder

setDuration(Duration.Builder builderForValue)

public AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder setDuration(Duration.Builder builderForValue)

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];

Parameter
NameDescription
builderForValueBuilder
Returns
TypeDescription
AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder

setEvaluationInterval(Duration value)

public AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder setEvaluationInterval(Duration value)

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];

Parameter
NameDescription
valueDuration
Returns
TypeDescription
AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder

setEvaluationInterval(Duration.Builder builderForValue)

public AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder setEvaluationInterval(Duration.Builder builderForValue)

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];

Parameter
NameDescription
builderForValueBuilder
Returns
TypeDescription
AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder
Overrides

setQuery(String value)

public AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder setQuery(String value)

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];

Parameter
NameDescription
valueString

The query to set.

Returns
TypeDescription
AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder

This builder for chaining.

setQueryBytes(ByteString value)

public AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder setQueryBytes(ByteString value)

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];

Parameter
NameDescription
valueByteString

The bytes for query to set.

Returns
TypeDescription
AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder
Overrides

setRuleGroup(String value)

public AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder setRuleGroup(String value)

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];

Parameter
NameDescription
valueString

The ruleGroup to set.

Returns
TypeDescription
AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder

This builder for chaining.

setRuleGroupBytes(ByteString value)

public AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder setRuleGroupBytes(ByteString value)

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];

Parameter
NameDescription
valueByteString

The bytes for ruleGroup to set.

Returns
TypeDescription
AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder
Overrides