Updated on 2024-09-27 GMT+08:00

Monitoring CCE Metrics

Cloud Container Engine (CCE) is an enterprise-level cluster hosting service. It allows you to quickly build reliable container clusters based on cloud servers, and easily create and manage different containerized workloads. AOM is a one-stop, multi-dimensional O&M platform for cloud applications. It enables you to monitor real-time running of applications, resources, and services and detect faults in a timely manner, improving O&M automation capability and efficiency. After CCE is interconnected with AOM, CCE cluster information can be reported to AOM. AOM can monitor the status and performance of CCE clusters and provide alarm notifications in real time.

You can set alarm rules in AOM to check whether resources in CCE clusters are normal and learn about real-time cluster running. This section uses aom_container_cpu_usage as an example to describe how to set an alarm rule.

Procedure

  1. Subscribing to AOM 2.0 for the First Time and Granting Permissions
  2. Monitoring Containers: Purchase a cluster and node on CCE. The ICAgent is then automatically installed to report cluster metrics to AOM.
  3. Setting an Alarm Action Rule: Create an alarm action rule and associate it with an SMN topic and a message template. If the CCE metric data meets the alarm condition, the system sends an alarm notification accordingly.
  4. Setting an Alarm Rule: Create an alarm rule for the CCE metric. If the metric data meets the alarm condition, an alarm is generated.

Preparation

This section uses a CCE metric as an example. You need to purchase a cluster and node in CCE in advance. For details, see Buying a CCE Standard/Turbo Cluster and Creating a Node. If you already have a cluster and node, skip this step.

Subscribing to AOM 2.0 for the First Time and Granting Permissions

  1. Register an account and perform real-name authentication.

    Before using AOM 2.0, register a HUAWEI ID and perform real-name authentication. If you already have a HUAWEI ID, skip the following operations.

    1. Go to the Huawei Cloud official website, and click Sign Up in the upper right corner.
    2. Complete registration by referring to Signing up for a HUAWEI ID and Enabling Huawei Cloud Services.
    3. Complete real-name authentication by referring to Real-Name Authentication.
  2. Subscribe to AOM 2.0.

    Before using AOM 2.0, subscribe to it. If you have subscribed to AOM 2.0, skip the following operations.

    1. Go to the AOM official website.
    2. Click AOM 2.0 Console under the AOM introduction.
    3. On the displayed dialog box, read the billing changes for switching AOM 1.0 to AOM 2.0.
    4. Click Authorize. On the displayed Service Authorization page, read the Authorization Statement and select "I have read and agreed to the Authorization Statement".
    5. Click Subscribe and Authorize for Free for AOM 2.0.
  3. Grant the AOM and CCE permissions to the user.

    You must have the AOM FullAccess and CCE FullAccess permissions. For details, see Creating a User and Granting Permissions and Granting Cluster Permissions to an IAM User.

Monitoring Containers

  1. Log in to the AOM 2.0 console.
  2. In the navigation pane, choose Infrastructure Monitoring > Workload Monitoring.
  3. Click a workload on any workload tab page. The workload details such as the name, status, cluster, and namespace are displayed. Figure 1 shows the details about the coredns workload in the aom-doc-test cluster.

    You can also create more workloads to monitor by referring to Creating a Workload.
    Figure 1 Workload details

Setting an Alarm Action Rule

  1. In the navigation pane, choose Alarm Management > Alarm Action Rules.
  2. On the Action Rules tab page, click Create and set parameters by referring to Table 1.

    Table 1 Alarm action rule parameters

    Parameter

    Description

    Example

    Rule Name

    Name of an action rule. Enter up to 200 characters and do not start or end with an underscore (_) or hyphen (-). Only digits, letters, underscores, and hyphens are allowed.

    Mon_aom

    Enterprise Project

    Select the required enterprise project. The default value is default.

    default

    Description

    Description of the action rule. Enter up to 1,024 characters. In this example, leave this parameter blank.

    -

    Rule Type

    Type of an alarm action rule. Select Metric/Event.

    Metric/Event: If a metric or an event meets the alarm condition, the system sends an alarm notification based on the associated SMN topic and message template.

    Metric/Event

    Action

    Type of action that is associated with the SMN topic and message template. Select a desired action from the drop-down list. Only Notification is supported.

    Notification

    Topic

    SMN topic. Select a desired topic from the drop-down list.

    If there is no topic you want to select, create one on the SMN console.

    -

    Message Template

    Notification message template. Select a desired template from the drop-down list.

    If there is no message template you want to select, create one.

    -

  3. Click OK.

Setting an Alarm Rule

Metric alarm rules can be created using the following modes: Select from all metrics, and PromQL.

The following uses Select from all metrics as an example.

  1. In the navigation pane, choose Alarm Management > Alarm Rules. Then, click Create.
  2. Set basic information about the alarm rule by referring to Table 2.

    Table 2 Basic information

    Parameter

    Description

    Example

    Rule Name

    Name of the rule. Enter a maximum of 256 characters and do not start or end with any special character. Only letters, digits, underscores (_), and hyphens (-) are allowed.

    monitor_cce

    Enterprise Project

    Select the required enterprise project. The default value is default.

    default

    Description

    Description of the rule. Enter up to 1,024 characters. In this example, leave this parameter blank.

    -

  3. Set the detailed information about the alarm rule.

    1. Rule Type: Metric alarm rule.
    2. Configuration Mode: Select from all metrics. Then you can set alarm conditions for different types of resources.
    3. Select a target Prometheus instance from the drop-down list. In this example, select Prometheus_AOM_Default.
    4. Set alarm rule details by referring to Table 3.

      After the setting is complete, the monitored metric data is displayed in a line graph above the alarm conditions. You can click Add Metric to add more metrics and set the statistical period and detection rules for them.

      Figure 2 Setting alarm rule details
      Table 3 Alarm rule details

      Parameter

      Description

      Example

      Multiple Metrics

      Calculation is performed based on the preset alarm conditions one by one. An alarm is triggered when one of the conditions is met.

      Multiple Metrics

      Metric

      Metric to be monitored. Click the Metric text box. In the resource tree on the right, you can select a target metric by resource type.

      aom_container_cpu_usage

      Statistical Period

      Interval at which metric data is collected.

      1 minute

      Conditions

      Metric monitoring scope. If this parameter is left blank, all resources are covered. Set the condition based on the workload mentioned in 3.

      Cluster name=aom-doc-test AND Workload name=coredns

      Grouping Condition

      Aggregate metric data by the specified field and calculate the aggregation result.

      Not grouped

      Rule

      Detection rule of a metric alarm, which consists of the statistical mode (Avg, Min, Max, Sum, and Samples), determination criterion (, , >, and <), and threshold value.

      Avg > 10

      Trigger Condition

      When the metric value meets the alarm condition for a specified number of consecutive periods, a metric alarm will be generated.

      3

      Alarm Severity

      Severity of a metric alarm.

  4. Click Advanced Settings and set information such as Check Interval and Alarm Clearance. For details about the parameters, see Table 4.

    Table 4 Advanced settings

    Parameter

    Description

    Example

    Check Interval

    Interval at which metric query and analysis results are checked.

    Custom interval: 1 minute

    Alarm Clearance

    The alarm will be cleared when the alarm condition is not met for a specified number of consecutive periods.

    1

    Action Taken for Insufficient Data

    Action to be taken if there is no or insufficient metric data within the monitoring period. Enable this option if needed.

    Enabled: If the data is insufficient for 1 period, the status will change to Insufficient data and an alarm will be sent.

    Alarm Tag

    Click to add an alarm tag. It is an alarm identification attribute in the format of "key:value". It is used in alarm noise reduction scenarios. In this example, leave this parameter blank.

    For details, see Alarm Tags and Annotations.

    NOTE:

    If tag policies related to AOM have already been set, add alarm tags based on these policies. If a tag does not comply with the policies, tag addition may fail. Contact your organization administrator to learn more about tag policies.

    -

    Alarm Annotation

    Click to add an alarm annotation. Alarm non-identification attribute in the format of "key:value". It is used in alarm notification and message template scenarios. In this example, leave this parameter blank.

    For details, see Alarm Tags and Annotations.

    -

  5. Set an alarm notification policy. For details, see Table 5.

    Figure 3 Setting an alarm notification policy
    Table 5 Alarm notification policy parameters

    Parameter

    Description

    Example

    Notify When

    Set the scenario for sending alarm notifications. By default, Alarm triggered and Alarm cleared are selected.

    • Alarm triggered: If the alarm trigger condition is met, the system sends an alarm notification to the specified personnel by email or SMS.
    • Alarm cleared: If the alarm clearance condition is met, the system sends an alarm notification to the specified personnel by email or SMS.

    Retain the default value.

    Alarm Mode

    • Direct alarm reporting: An alarm is directly sent when the alarm condition is met. If you select this mode, set an interval for notification and specify whether to enable an action rule.
    • Frequency: frequency for sending alarm notifications. Select a desire value from the drop-down list.
    • Action Rule: If you enable this function, the system sends notifications based on the associated SMN topic and message template. If there is no alarm action rule you want to select, click Create Rule in the drop-down list to create one. For details about how to set alarm action rules, see Setting an Alarm Action Rule.

    Alarm Mode: Select Direct alarm reporting.

    Frequency: Select Once.

    Action Rule: Select Mon_aom.

  6. Click Confirm. Then click View Rule to view the created rule.

    In the expanded list, if a metric value meets the configured alarm condition, a metric alarm is generated on the alarm page. To view the alarm, choose Alarm Management > Alarm List in the navigation pane. If a metric value meets the preset notification policy, the system sends an alarm notification to the specified personnel by email or SMS.

    Figure 4 Creating a metric alarm rule

Related Information

After an alarm rule is configured, you can perform the following operations if needed:

  • On the workload details page, click the Alarms tab to check alarms. Alternatively, choose Alarm Management > Alarm List to check alarms. For details, see Checking Alarms.
    Figure 5 Checking alarms
  • Create metric alarm rules using other methods. For details, see Creating a Metric Alarm Rule.