Notification policies

更新时间:
复制 MD 格式

By creating a notification policy, you can define matching rules for alert events. When a matching rule is triggered, the system sends alert notifications to specified notification objects using your configured methods. This prompts recipients to resolve the issue.

Prerequisites

You have created a notification object. For more information, see notification object.

Create a notification policy

  1. Log on to the Managed Service for OpenTelemetry console. In the left-side navigation pane, choose Alert Management > Alert policy.

  2. Click the Notification Policies tab, click Create Notification Policy, and then enter a name for the policy.

  3. In the Matching Rule section, configure the matching rules for alert events.

    Important

    Silence policies take precedence over notification policies. An alert event that matches a silence policy is suppressed and is not evaluated against notification policies. To learn how to create a silence policy, see silence policy.

    1. Select a data source.

      • Specified source: The policy sends notifications only for alert events from the specified integration.

      • No preset source: The policy sends notifications for alert events from all sources.

    2. Set the matching rule expression. You can define custom tags or select from existing tags.

      Existing tags include:

      • Tags from the metrics in an alert rule expression. For information about how to create tags for alert rules in Managed Service for Prometheus, see Prometheus alert rules.

      • Default tags provided by ARMS. The default tags are described in the following table.

        Category

        Tag

        Description

        Common fields

        alertname

        The alert name.

        clustername

        The cluster name.

        severity

        The alert severity.

        • P1

        • P2

        • P3

        • P4

        • Default

        namespace

        The namespace.

        pod_name

        The pod name.

        System-preset fields

        _aliyun_arms_integration_name

        The integration name. The default integration name for alerts reported by ARMS is ARMS-DEFAULT.

        _aliyun_arms_involvedObject_id

        The ID of the involved object.

        _aliyun_arms_involvedObject_name

        The name of the involved object.

        _aliyun_arms_region_id

        The region ID.

        _aliyun_arms_alert_rule_id

        The alert rule ID.

        _aliyun_arms_alert_type

        The alert rule type:

        • 101: Prometheus alert

        • 5: Application Monitoring alert

        • 4: Browser Monitoring alert

      Note
      • To trigger an alert only when all conditions are met (AND logic), click Add Condition.

      • To trigger an alert when any of the rules is met (OR logic), click Add Rule.

    3. Click Next.

  4. In the Event Group section, configure how alert events are grouped, and then click Next.

    • Do not group: Each alert event triggers a separate notification.

    • Set group-by fields: Alert events with the same field values are aggregated into a single alert notification.

  5. In the Notification Objects section, configure the following parameters.

    1. Click + Add notification object to select notification objects.

      Notification object types:

      • Contact: After you select a contact, you also need to select a notification method, such as phone call, SMS, or email.

      • Contact group: After you select a contact group, you also need to select a notification method, such as phone call, SMS, or email.

      • Shift: After you select a shift, you also need to select a notification method, such as phone call, SMS, or email.

      • DingTalk/Lark/WeCom: Send alert notifications to DingTalk, Lark, or WeCom.

      • Webhook: Send alert notifications to a webhook URL.

    2. Choose whether to send a clearing notification when an alert is cleared.

      Send clearing notification: If enabled, the system sends a notification to the specified recipients when the alert is cleared. An alert is cleared when all its related events are resolved, and its status is automatically changed to Resolved.

    3. Configure a notification template. For more information, see Configure notification templates and webhook templates.

    4. Set a notification time range. Alert notifications are sent only during the specified period.

    5. Optional: Select a ticketing system to send alerts to. For information about how to integrate a ticketing system, see action integration.

    6. Click Next.

  6. In the Policy to Repeat/Escalate/Clear Alerts section, configure repeat notifications or an escalation policy, and then click Next.

    • Repeat notifications: If an alert remains unresolved, the system resends notifications at the specified interval until the alert is cleared.

    • Use escalation policy: If an alert remains unresolved, notifications are sent to other notification objects based on the selected escalation policy.

    • Enable manual recovery: If enabled, an alert is not automatically cleared even if no new alert events are triggered within the auto-recovery period defined in the alert integration. You must manually update the alert status.

  7. In the Action Integration section, you can configure actions that run automatically when an alert is triggered or cleared. For more information, see Execute an alert playbook by using action integrations.

  8. After you complete the configuration, click Save.

Manage notification policies

After a notification policy is created, it is displayed on the Notification Policies page. On the Notification Policies page, you can perform the following operations:

  • Edit a notification policy: Click the policy name, or find the policy in the list and click Edit in the Actions column. After making your changes, click Save.

  • Enable or disable a notification policy: Toggle the switch in the policy's Status column.

  • Delete a notification policy: Click Delete in the policy's Actions column, and then click Confirm in the confirmation dialog box that appears.

  • Copy a notification policy: Click Copy in the policy's Actions column to create a duplicate.