Skip to content

ResourceMetricRuleProps

Properties for defining a ResourceMetricRule.

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

Initializer

import ros_cdk_cms
ros_cdk_cms.ResourceMetricRuleProps(
  contact_groups: typing.Union[IResolvable, typing.List[typing.Union[str, IResolvable]]],
  escalations: typing.Union[IResolvable, EscalationsProperty],
  metric_name: typing.Union[str, IResolvable],
  namespace: typing.Union[str, IResolvable],
  resources: typing.Union[IResolvable, typing.List[typing.Mapping[typing.Any]]],
  composite_expression: typing.Union[IResolvable, CompositeExpressionProperty] = None,
  deletion_force: typing.Union[bool, IResolvable] = None,
  effective_interval: typing.Union[str, IResolvable] = None,
  email_subject: typing.Union[str, IResolvable] = None,
  interval: typing.Union[typing.Union[int, float], IResolvable] = None,
  labels: typing.Union[IResolvable, typing.List[typing.Union[IResolvable, LabelsProperty]]] = None,
  no_data_policy: typing.Union[str, IResolvable] = None,
  no_effective_interval: typing.Union[str, IResolvable] = None,
  period: typing.Union[typing.Union[int, float], IResolvable] = None,
  prometheus: typing.Union[IResolvable, PrometheusProperty] = None,
  rule_id: typing.Union[str, IResolvable] = None,
  rule_name: typing.Union[str, IResolvable] = None,
  silence_time: typing.Union[typing.Union[int, float], IResolvable] = None,
  webhook: typing.Union[str, IResolvable] = None
)

Properties

Name Type Description
contact_groups typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[str, ros_cdk_core.IResolvable]]] Property contactGroups: The alert contact group.
escalations typing.Union[ros_cdk_core.IResolvable, EscalationsProperty] Property escalations: You must select at least one of the Critical, Warn, and Info alert levels.
metric_name typing.Union[str, ros_cdk_core.IResolvable] Property metricName: The name of the metric.
namespace typing.Union[str, ros_cdk_core.IResolvable] Property namespace: The namespace of the cloud service.
resources typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Mapping[typing.Any]]] Property resources: The information about the resource.
composite_expression typing.Union[ros_cdk_core.IResolvable, CompositeExpressionProperty] Property compositeExpression: The trigger conditions for multiple metrics.
deletion_force typing.Union[bool, ros_cdk_core.IResolvable] Property deletionForce: Whether to delete rule even if it is not created by ROS.
effective_interval typing.Union[str, ros_cdk_core.IResolvable] Property effectiveInterval: The time period during which the alert rule is effective.
email_subject typing.Union[str, ros_cdk_core.IResolvable] Property emailSubject: The subject of the alert notification email.
interval typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property interval: The interval at which the alert is triggered.
labels typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[ros_cdk_core.IResolvable, LabelsProperty]]] Property labels:.
no_data_policy typing.Union[str, ros_cdk_core.IResolvable] Property noDataPolicy: The processing method of alerts when no monitoring data is found.
no_effective_interval typing.Union[str, ros_cdk_core.IResolvable] Property noEffectiveInterval: The time period during which the alert rule is ineffective.
period typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property period: The statistical period of the metric.
prometheus typing.Union[ros_cdk_core.IResolvable, PrometheusProperty] Property prometheus: The Prometheus alert rule.
rule_id typing.Union[str, ros_cdk_core.IResolvable] Property ruleId: The ID of the alert rule.
rule_name typing.Union[str, ros_cdk_core.IResolvable] Property ruleName: The name of the alert rule.
silence_time typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property silenceTime: The mute period during which new alerts are not sent even if the trigger conditions are met.
webhook typing.Union[str, 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.

contact_groupsRequired

contact_groups: typing.Union[IResolvable, typing.List[typing.Union[str, IResolvable]]]
  • Type: typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[str, ros_cdk_core.IResolvable]]]

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: typing.Union[IResolvable, EscalationsProperty]

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


metric_nameRequired

metric_name: typing.Union[str, IResolvable]
  • Type: typing.Union[str, 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.


namespaceRequired

namespace: typing.Union[str, IResolvable]
  • Type: typing.Union[str, 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.


resourcesRequired

resources: typing.Union[IResolvable, typing.List[typing.Mapping[typing.Any]]]
  • Type: typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Mapping[typing.Any]]]

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.


composite_expressionOptional

composite_expression: typing.Union[IResolvable, 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.


deletion_forceOptional

deletion_force: typing.Union[bool, IResolvable]
  • Type: typing.Union[bool, ros_cdk_core.IResolvable]

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

Default is false


effective_intervalOptional

effective_interval: typing.Union[str, IResolvable]
  • Type: typing.Union[str, ros_cdk_core.IResolvable]

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


email_subjectOptional

email_subject: typing.Union[str, IResolvable]
  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property emailSubject: The subject of the alert notification email.


intervalOptional

interval: typing.Union[typing.Union[int, float], IResolvable]
  • Type: typing.Union[typing.Union[int, float], 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.


labelsOptional

labels: typing.Union[IResolvable, typing.List[typing.Union[IResolvable, LabelsProperty]]]
  • Type: typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[ros_cdk_core.IResolvable, LabelsProperty]]]

Property labels:.


no_data_policyOptional

no_data_policy: typing.Union[str, IResolvable]
  • Type: typing.Union[str, 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.

no_effective_intervalOptional

no_effective_interval: typing.Union[str, IResolvable]
  • Type: typing.Union[str, ros_cdk_core.IResolvable]

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


periodOptional

period: typing.Union[typing.Union[int, float], IResolvable]
  • Type: typing.Union[typing.Union[int, float], 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.


prometheusOptional

prometheus: typing.Union[IResolvable, PrometheusProperty]

Property prometheus: The Prometheus alert rule.

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


rule_idOptional

rule_id: typing.Union[str, IResolvable]
  • Type: typing.Union[str, 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.


rule_nameOptional

rule_name: typing.Union[str, IResolvable]
  • Type: typing.Union[str, 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.


silence_timeOptional

silence_time: typing.Union[typing.Union[int, float], IResolvable]
  • Type: typing.Union[typing.Union[int, float], 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.


webhookOptional

webhook: typing.Union[str, IResolvable]
  • Type: typing.Union[str, 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.