Class MonitoringAlertPolicyConditionsConditionPrometheusQueryLanguage.Builder
- java.lang.Object
-
- com.hashicorp.cdktf.providers.google.monitoring_alert_policy.MonitoringAlertPolicyConditionsConditionPrometheusQueryLanguage.Builder
-
- All Implemented Interfaces:
software.amazon.jsii.Builder<MonitoringAlertPolicyConditionsConditionPrometheusQueryLanguage>
- Enclosing interface:
- MonitoringAlertPolicyConditionsConditionPrometheusQueryLanguage
@Stability(Stable) public static final class MonitoringAlertPolicyConditionsConditionPrometheusQueryLanguage.Builder extends Object implements software.amazon.jsii.Builder<MonitoringAlertPolicyConditionsConditionPrometheusQueryLanguage>
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MonitoringAlertPolicyConditionsConditionPrometheusQueryLanguage.BuilderalertRule(String alertRule)MonitoringAlertPolicyConditionsConditionPrometheusQueryLanguagebuild()Builds the configured instance.MonitoringAlertPolicyConditionsConditionPrometheusQueryLanguage.Builderduration(String duration)MonitoringAlertPolicyConditionsConditionPrometheusQueryLanguage.BuilderevaluationInterval(String evaluationInterval)MonitoringAlertPolicyConditionsConditionPrometheusQueryLanguage.Builderlabels(Map<String,String> labels)MonitoringAlertPolicyConditionsConditionPrometheusQueryLanguage.Builderquery(String query)MonitoringAlertPolicyConditionsConditionPrometheusQueryLanguage.BuilderruleGroup(String ruleGroup)
-
-
-
Method Detail
-
query
@Stability(Stable) public MonitoringAlertPolicyConditionsConditionPrometheusQueryLanguage.Builder query(String query)
- Parameters:
query- The PromQL expression to evaluate. This parameter is required. 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. Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/google/5.43.1/docs/resources/monitoring_alert_policy#query MonitoringAlertPolicy#query}- Returns:
this
-
alertRule
@Stability(Stable) public MonitoringAlertPolicyConditionsConditionPrometheusQueryLanguage.Builder alertRule(String alertRule)
- Parameters:
alertRule- 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. Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/google/5.43.1/docs/resources/monitoring_alert_policy#alert_rule MonitoringAlertPolicy#alert_rule}- Returns:
this
-
duration
@Stability(Stable) public MonitoringAlertPolicyConditionsConditionPrometheusQueryLanguage.Builder duration(String duration)
- Parameters:
duration- Alerts are considered firing once their PromQL expression evaluated to be "true" for this long. Alerts whose PromQL expression was not evaluated to be "true" for long enough are considered pending. The default value is zero. Must be zero or positive. Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/google/5.43.1/docs/resources/monitoring_alert_policy#duration MonitoringAlertPolicy#duration}- Returns:
this
-
evaluationInterval
@Stability(Stable) public MonitoringAlertPolicyConditionsConditionPrometheusQueryLanguage.Builder evaluationInterval(String evaluationInterval)
Sets the value ofMonitoringAlertPolicyConditionsConditionPrometheusQueryLanguage.getEvaluationInterval()- Parameters:
evaluationInterval- How often this rule should be evaluated. Must be a positive multiple of 30 seconds or missing. The 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. Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/google/5.43.1/docs/resources/monitoring_alert_policy#evaluation_interval MonitoringAlertPolicy#evaluation_interval}- Returns:
this
-
labels
@Stability(Stable) public MonitoringAlertPolicyConditionsConditionPrometheusQueryLanguage.Builder labels(Map<String,String> labels)
- Parameters:
labels- 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. This field is intended to be used for organizing and identifying the AlertPolicy Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/google/5.43.1/docs/resources/monitoring_alert_policy#labels MonitoringAlertPolicy#labels}- Returns:
this
-
ruleGroup
@Stability(Stable) public MonitoringAlertPolicyConditionsConditionPrometheusQueryLanguage.Builder ruleGroup(String ruleGroup)
- Parameters:
ruleGroup- 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. Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/google/5.43.1/docs/resources/monitoring_alert_policy#rule_group MonitoringAlertPolicy#rule_group}- Returns:
this
-
build
@Stability(Stable) public MonitoringAlertPolicyConditionsConditionPrometheusQueryLanguage build()
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<MonitoringAlertPolicyConditionsConditionPrometheusQueryLanguage>- Returns:
- a new instance of
MonitoringAlertPolicyConditionsConditionPrometheusQueryLanguage - Throws:
NullPointerException- if any required attribute was not provided
-
-