ResourceMetricRuleProps
Properties for defining a ResourceMetricRule
.
See https://www.alibabacloud.com/help/ros/developer-reference/aliyun-cms-resourcemetricrule
Initializer
import com.aliyun.ros.cdk.cms.ResourceMetricRuleProps;
ResourceMetricRuleProps.builder()
.contactGroups(IResolvable)
.contactGroups(java.util.List<java.lang.String)
.contactGroups(IResolvable>)
.escalations(IResolvable)
.escalations(EscalationsProperty)
.metricName(java.lang.String)
.metricName(IResolvable)
.namespace(java.lang.String)
.namespace(IResolvable)
.resources(IResolvable)
.resources(java.util.List<java.util.Map<java.lang.String, java.lang.Object>>)
// .compositeExpression(IResolvable)
// .compositeExpression(CompositeExpressionProperty)
// .deletionForce(java.lang.Boolean)
// .deletionForce(IResolvable)
// .effectiveInterval(java.lang.String)
// .effectiveInterval(IResolvable)
// .emailSubject(java.lang.String)
// .emailSubject(IResolvable)
// .interval(java.lang.Number)
// .interval(IResolvable)
// .labels(IResolvable)
// .labels(java.util.List<IResolvable)
// .labels(LabelsProperty>)
// .noDataPolicy(java.lang.String)
// .noDataPolicy(IResolvable)
// .noEffectiveInterval(java.lang.String)
// .noEffectiveInterval(IResolvable)
// .period(java.lang.Number)
// .period(IResolvable)
// .prometheus(IResolvable)
// .prometheus(PrometheusProperty)
// .ruleId(java.lang.String)
// .ruleId(IResolvable)
// .ruleName(java.lang.String)
// .ruleName(IResolvable)
// .silenceTime(java.lang.Number)
// .silenceTime(IResolvable)
// .webhook(java.lang.String)
// .webhook(IResolvable)
.build();
Properties
Name | Type | Description |
---|---|---|
contactGroups |
com.aliyun.ros.cdk.core.IResolvable OR java.util.List |
Property contactGroups: The alert contact group. |
escalations |
com.aliyun.ros.cdk.core.IResolvable OR EscalationsProperty |
Property escalations: You must select at least one of the Critical, Warn, and Info alert levels. |
metricName |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
Property metricName: The name of the metric. |
namespace |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
Property namespace: The namespace of the cloud service. |
resources |
com.aliyun.ros.cdk.core.IResolvable OR java.util.List |
Property resources: The information about the resource. |
compositeExpression |
com.aliyun.ros.cdk.core.IResolvable OR CompositeExpressionProperty |
Property compositeExpression: The trigger conditions for multiple metrics. |
deletionForce |
java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable |
Property deletionForce: Whether to delete rule even if it is not created by ROS. |
effectiveInterval |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
Property effectiveInterval: The time period during which the alert rule is effective. |
emailSubject |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
Property emailSubject: The subject of the alert notification email. |
interval |
java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable |
Property interval: The interval at which the alert is triggered. |
labels |
com.aliyun.ros.cdk.core.IResolvable OR java.util.List |
Property labels:. |
noDataPolicy |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
Property noDataPolicy: The processing method of alerts when no monitoring data is found. |
noEffectiveInterval |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
Property noEffectiveInterval: The time period during which the alert rule is ineffective. |
period |
java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable |
Property period: The statistical period of the metric. |
prometheus |
com.aliyun.ros.cdk.core.IResolvable OR PrometheusProperty |
Property prometheus: The Prometheus alert rule. |
ruleId |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
Property ruleId: The ID of the alert rule. |
ruleName |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
Property ruleName: The name of the alert rule. |
silenceTime |
java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable |
Property silenceTime: The mute period during which new alerts are not sent even if the trigger conditions are met. |
webhook |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
Property webhook: The callback URL to which a POST request is sent when an alert is triggered based on the alert rule. |
contactGroups
Required
public java.lang.Object getContactGroups();
- Type: com.aliyun.ros.cdk.core.IResolvable OR java.util.List
Property contactGroups: The alert contact group.
The alert notifications are sent to the contacts that belong to the alert contact group. Note: An alert contact group can contain one or more alert contacts. For information about how to create alert contacts and alert contact groups, see PutContact and PutContactGroup.
escalations
Required
public java.lang.Object getEscalations();
- Type: com.aliyun.ros.cdk.core.IResolvable OR EscalationsProperty
Property escalations: You must select at least one of the Critical, Warn, and Info alert levels.
metricName
Required
public java.lang.Object getMetricName();
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property metricName: The name of the metric.
For information about how to query the name of a metric, see Appendix 1: Metrics. Note: If you create a Prometheus alert rule for Hybrid Cloud Monitoring, you must set this parameter to the name of the namespace. For information about how to obtain the name of a namespace, see DescribeHybridMonitorNamespaceList.
namespace
Required
public java.lang.Object getNamespace();
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property namespace: The namespace of the cloud service.
For information about how to query the namespace of a cloud service, Appendix 1: Metrics. Note: If you create a Prometheus alert rule for Hybrid Cloud Monitoring, you must set this parameter to acs_prometheus.
resources
Required
public java.lang.Object getResources();
- Type: com.aliyun.ros.cdk.core.IResolvable OR java.util.List
>
Property resources: The information about the resource.
Examples: [{"instanceId":"i-uf6j91r34rnwawoo*"}] and [{"userId":"100931896542*"}]. For information about the supported dimensions that are used to query resources, see Appendix 1: Metrics.
compositeExpression
Optional
public java.lang.Object getCompositeExpression();
- Type: com.aliyun.ros.cdk.core.IResolvable OR CompositeExpressionProperty
Property compositeExpression: The trigger conditions for multiple metrics.
Note: The trigger conditions for a single metric and multiple metrics are mutually exclusive. You cannot specify trigger conditions for a single metric and multiple metrics at the same time.
deletionForce
Optional
public java.lang.Object getDeletionForce();
- Type: java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable
Property deletionForce: Whether to delete rule even if it is not created by ROS.
Default is false
effectiveInterval
Optional
public java.lang.Object getEffectiveInterval();
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property effectiveInterval: The time period during which the alert rule is effective.
emailSubject
Optional
public java.lang.Object getEmailSubject();
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property emailSubject: The subject of the alert notification email.
interval
Optional
public java.lang.Object getInterval();
- Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable
Property interval: The interval at which the alert is triggered.
Unit: seconds. Note: For information about how to query the statistical period of a metric, see Appendix 1: Metrics.
labels
Optional
public java.lang.Object getLabels();
- Type: com.aliyun.ros.cdk.core.IResolvable OR java.util.List
LabelsProperty>
Property labels:.
noDataPolicy
Optional
public java.lang.Object getNoDataPolicy();
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property noDataPolicy: The processing method of alerts when no monitoring data is found.
Valid values:
- KEEP_LAST_STATE (default value): No operation is performed.
- INSUFFICIENT_DATA: An alert whose content is "Insufficient data" is triggered.
- OK: The status is considered normal.
noEffectiveInterval
Optional
public java.lang.Object getNoEffectiveInterval();
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property noEffectiveInterval: The time period during which the alert rule is ineffective.
period
Optional
public java.lang.Object getPeriod();
- Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable
Property period: The statistical period of the metric.
Unit: seconds. The default value is the interval at which the monitoring data of the metric is collected. Note: For information about how to query the statistical period of a metric, see Appendix 1: Metrics.
prometheus
Optional
public java.lang.Object getPrometheus();
- Type: com.aliyun.ros.cdk.core.IResolvable OR PrometheusProperty
Property prometheus: The Prometheus alert rule.
Note: This parameter is required only when you create a Prometheus alert rule for Hybrid Cloud Monitoring.
ruleId
Optional
public java.lang.Object getRuleId();
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property ruleId: The ID of the alert rule.
If not specified, ROS will generate one. You can specify a new ID or the ID of an existing alert rule. For information about how to query the ID of an alert rule, see DescribeMetricRuleList. Note: If you specify a new ID, a threshold-triggered alert rule is created.
ruleName
Optional
public java.lang.Object getRuleName();
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property ruleName: The name of the alert rule.
If not specified and the rule is created by ROS, default to RuleId. You can specify a new name or the name of an existing alert rule. For information about how to query the name of an alert rule, see DescribeMetricRuleList. Note: If you specify a new name, a threshold-triggered alert rule is created.
silenceTime
Optional
public java.lang.Object getSilenceTime();
- Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable
Property silenceTime: The mute period during which new alerts are not sent even if the trigger conditions are met.
Unit: seconds. Default value: 86400. Note: If an alert is not cleared within the mute period, a new alert notification is sent when the mute period ends.
webhook
Optional
public java.lang.Object getWebhook();
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property webhook: The callback URL to which a POST request is sent when an alert is triggered based on the alert rule.