Skip to content

ResourceMetricRuleProps

Properties for defining a ResourceMetricRule.

See https://www.alibabacloud.com/help/ros/developer-reference/aliyun-cms-resourcemetricrule

Initializer

import "github.com/alibabacloud-go/ros-cdk/alicloudroscdkcms"
&alicloudroscdkcms.ResourceMetricRuleProps {
    ContactGroups: interface{},
    Escalations: interface{},
    MetricName: interface{},
    Namespace: interface{},
    Resources: interface{},
    CompositeExpression: interface{},
    DeletionForce: interface{},
    EffectiveInterval: interface{},
    EmailSubject: interface{},
    Interval: interface{},
    Labels: interface{},
    NoDataPolicy: interface{},
    NoEffectiveInterval: interface{},
    Period: interface{},
    Prometheus: interface{},
    RuleId: interface{},
    RuleName: interface{},
    SilenceTime: interface{},
    Webhook: interface{},
}

Properties

Name Type Description
ContactGroups interface{} Property contactGroups: The alert contact group.
Escalations interface{} Property escalations: You must select at least one of the Critical, Warn, and Info alert levels.
MetricName interface{} Property metricName: The name of the metric.
Namespace interface{} Property namespace: The namespace of the cloud service.
Resources interface{} Property resources: The information about the resource.
CompositeExpression interface{} Property compositeExpression: The trigger conditions for multiple metrics.
DeletionForce interface{} Property deletionForce: Whether to delete rule even if it is not created by ROS.
EffectiveInterval interface{} Property effectiveInterval: The time period during which the alert rule is effective.
EmailSubject interface{} Property emailSubject: The subject of the alert notification email.
Interval interface{} Property interval: The interval at which the alert is triggered.
Labels interface{} Property labels:.
NoDataPolicy interface{} Property noDataPolicy: The processing method of alerts when no monitoring data is found.
NoEffectiveInterval interface{} Property noEffectiveInterval: The time period during which the alert rule is ineffective.
Period interface{} Property period: The statistical period of the metric.
Prometheus interface{} Property prometheus: The Prometheus alert rule.
RuleId interface{} Property ruleId: The ID of the alert rule.
RuleName interface{} Property ruleName: The name of the alert rule.
SilenceTime interface{} Property silenceTime: The mute period during which new alerts are not sent even if the trigger conditions are met.
Webhook interface{} Property webhook: The callback URL to which a POST request is sent when an alert is triggered based on the alert rule.

ContactGroupsRequired

ContactGroups interface{}
  • Type: interface{}

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.


EscalationsRequired

Escalations interface{}
  • Type: interface{}

Property escalations: You must select at least one of the Critical, Warn, and Info alert levels.


MetricNameRequired

MetricName interface{}
  • Type: interface{}

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.


NamespaceRequired

Namespace interface{}
  • Type: interface{}

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.


ResourcesRequired

Resources interface{}
  • Type: interface{}

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.


CompositeExpressionOptional

CompositeExpression interface{}
  • Type: interface{}

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.


DeletionForceOptional

DeletionForce interface{}
  • Type: interface{}

Property deletionForce: Whether to delete rule even if it is not created by ROS.

Default is false


EffectiveIntervalOptional

EffectiveInterval interface{}
  • Type: interface{}

Property effectiveInterval: The time period during which the alert rule is effective.


EmailSubjectOptional

EmailSubject interface{}
  • Type: interface{}

Property emailSubject: The subject of the alert notification email.


IntervalOptional

Interval interface{}
  • Type: interface{}

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.


LabelsOptional

Labels interface{}
  • Type: interface{}

Property labels:.


NoDataPolicyOptional

NoDataPolicy interface{}
  • Type: interface{}

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.

NoEffectiveIntervalOptional

NoEffectiveInterval interface{}
  • Type: interface{}

Property noEffectiveInterval: The time period during which the alert rule is ineffective.


PeriodOptional

Period interface{}
  • Type: interface{}

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.


PrometheusOptional

Prometheus interface{}
  • Type: interface{}

Property prometheus: The Prometheus alert rule.

Note: This parameter is required only when you create a Prometheus alert rule for Hybrid Cloud Monitoring.


RuleIdOptional

RuleId interface{}
  • Type: interface{}

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.


RuleNameOptional

RuleName interface{}
  • Type: interface{}

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.


SilenceTimeOptional

SilenceTime interface{}
  • Type: interface{}

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.


WebhookOptional

Webhook interface{}
  • Type: interface{}

Property webhook: The callback URL to which a POST request is sent when an alert is triggered based on the alert rule.