Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ Application Operations Management/ Getting Started/ (New) Using Prometheus to Monitor ECS Metrics

(New) Using Prometheus to Monitor ECS Metrics

Updated on 2025-03-03 GMT+08:00

An Elastic Cloud Server (ECS) is a computing server consisting of the CPU, memory, OS, and Elastic Volume Service (EVS) disk. It supports on-demand allocation and auto scaling. ECSs integrate Virtual Private Cloud (VPC), security group, and Cloud Firewall (CFW) capabilities to create an efficient, reliable, and secure computing environment. This ensures stable and uninterrupted running of services. 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 an ECS is connected to AOM, AOM can monitor the ECS in real time and send alarm notifications.

This section uses the node_network_up metric of an ECS as an example to describe how to use AOM.

Constraints

The ECS must be in the same region as the AOM console.

Procedure

  1. Installing UniAgent on the ECS: Install UniAgent on the host in the region where the AOM console is located to centrally manage metric collection plug-ins.
  2. Creating a Host Group: Create a host group for better host management and more efficient data collection.
  3. Connecting the ECS to AOM: Connect an ECS to AOM. Then you can install Node Exporter and configure collection tasks for the host group. The collected metrics will be stored in the Prometheus instance for ECS for easy management.
  4. Setting a Metric Alarm Rule: Create an alarm rule for the ECS metric. If the metric data meets the alarm condition, an alarm will be generated.

Preparation

Installing UniAgent on the ECS

  1. Log in to the AOM 2.0 console.
  2. In the navigation pane, choose Settings > Collection Settings > UniAgent Installation and Configuration, and click Go to New Version in the upper right corner.
  3. On the displayed page, check the UniAgent status of the ECS.

    • If the UniAgent status is Running, UniAgent has been installed. In this case, go to Creating a Host Group.
    • If the UniAgent status is Abnormal, UniAgent is abnormal. In this case, contact technical support.
    • If the UniAgent status is Installing, UniAgent is being installed. Wait until the UniAgent is installed.
    • If the UniAgent status is Installation failed or Not installed, UniAgent fails to be installed or is not installed on the host. In this case, install it.

  4. Click Install UniAgent. On the displayed page, set related parameters.

    Figure 1 Installing UniAgent
    Table 1 Installation parameters

    Parameter

    Description

    Example

    Server Region

    Options: Current region and Outside current region. In this example, select Current region.

    Current region: The network between AOM and the server in the current region is connected.

    Current region

    Server Type

    Options: ECSs and Other Servers. Select ECSs.

    ECSs: hosts managed by the ECS service.

    ECSs

    Installation Mode

    Option: CLI.

    You need to remotely log in to the server to run the installation command provided on the console.

    CLI

    OS

    Option: Linux.

    Linux

    UniAgent Version

    Select a UniAgent version. The latest version is selected by default.

    Latest version

    Copy and Run Installation Command

    Click Copy to copy the installation command.

    Copy the Linux installation command.

  5. Log in to the ECS and run the Linux installation command copied in 4 as the root user.
  6. Check the UniAgent status in the UniAgent list. If the UniAgent status is Running, the installation is successful.

Creating a Host Group

You can create host groups of the IP address and custom identifier types. In this example, select the IP address type.

  1. In the navigation pane, choose Settings > Collection Settings > Host Groups and click Create Host Group.
  2. On the displayed page, set related parameters.

    Table 2 Parameters

    Parameter

    Description

    Example

    Host Group

    Name of a host group. Enter 1 to 64 characters. Do not start with a period (.) or underscore (_) or end with a period. Only letters, digits, hyphens (-), underscores, and periods are allowed.

    aom-ecs

    Host Group Type

    Type of the host group. Options: IP and Custom identifier. In this example, select IP.

    IP

    Host Type

    Host type. Default: Linux.

    Linux

    Remark

    Host group remarks. Enter up to 1,024 characters. In this example, leave this parameter blank.

    -

  3. In the host list, select one or more hosts to add to the group and click OK.

Connecting the ECS to AOM

  1. Log in to the AOM 2.0 console.
  2. In the navigation pane, choose Access > Access Center. Click Experience the new version in the upper right corner of the page.
  3. Locate the Elastic Cloud Server (ECS) card under Running environments and click Ingest Metric (AOM) on the card.
  4. Set parameters for connecting to the ECS.

    1. Select a Prometheus instance.
      1. Instance Type: Prometheus for ECS is selected by default and cannot be changed.
      2. Instance Name: Click Create Instance to create an instance by referring to Table 3. Then select the created instance from the drop-down list.
        Table 3 Parameters for creating a Prometheus instance for ECS

        Parameter

        Description

        Example

        Instance Name

        Prometheus instance name.

        Enter a maximum of 100 characters and do not start or end with an underscore (_) or hyphen (-). Only letters, digits, underscores, and hyphens are allowed.

        mon_ECS

        Enterprise Project

        Enterprise project.

        • If Enterprise Project is set to All on the global settings page, select an enterprise project from the drop-down list here.
        • If you have already selected an enterprise project on the global settings page, this option will be grayed and cannot be changed.

        default

        Instance Type

        Type of a Prometheus instance.

        Prometheus for ECS

    2. Select a host group.

      In the host group list, select the host group created in Creating a Host Group.

    3. Configure the collection.
      Under Configure Collection, set parameters by referring to the following table.
      Table 4 Collection configuration

      Category

      Parameter

      Description

      Example

      Basic Settings

      Configuration Name

      Name of a metric ingestion rule.

      Enter up to 50 characters starting with a letter. Only letters, digits, underscores (_), and hyphens (-) are allowed.

      ecs-rule

      Metric Collection Rule

      Metric Collection Interval (s)

      Interval for collecting metrics, in seconds. Options: 10, 30, and 60 (default).

      60

      Metric Collection Timeout (s)

      Timeout period for executing a metric collection task, in seconds. Options: 10, 30, and 60 (default). The timeout period cannot exceed the collection interval.

      60

      Executor

      User who executes the metric ingestion rule, that is, the user of the selected host group. Default: root.

      root

      Other

      Custom Dimensions

      Dimensions (key-value pairs) added to specify additional metric attributes. You can click Add Dimension to add multiple custom dimensions (key-value pairs). In this example, leave this parameter blank.

      -

      Import ECS Tags as Dimensions

      This function is disabled by default. If it is enabled, ECS tags (key-value pairs) will be written to metric dimensions and tag changes will be synchronized to AOM.

      Disable

  5. After the configuration is complete, click Next. The ECS is then connected.

Setting a Metric Alarm Rule

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

The following describes how to create an alarm rule when Configuration Mode is set to Select from all metrics.

  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 5.

    Table 5 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_ecs

    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 the target Prometheus instance from the drop-down list. In this example, select the instance created in 4.a.ii.
    4. Set alarm rule details. Table 6 describes the parameters.

      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 6 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, select a target metric by resource type.

      node_network_up

      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. In this example, leave this parameter blank.

      -

      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 > 1

      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.

      • : a critical alarm.
      • : a major alarm.
      • : a minor alarm.
      • : a warning.

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

    Table 7 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.

    -

    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 8.

    Figure 3 Setting an alarm notification policy
    Table 8 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, 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:

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback