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
Managed Threat Detection
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

Configuring a Recording Rule

Updated on 2024-08-05 GMT+08:00

Recording rules can be used for secondary development of metric data. Some queries may require a large amount of computing on the query end, resulting in high pressure on this end. By setting recording rules, you can move the computing process to the write end, reducing resource usage on the query end. Especially in large-scale clusters and complex service scenarios, recording rules can reduce PromQL complexity, thereby improving the query performance and preventing slow user configuration and queries.

Prerequisite

Both your service and CCE cluster have been connected to a Prometheus instance for CCE. For details, see Prometheus Instance for CCE.

Configuring a Recording Rule

  1. Log in to the AOM 2.0 console.
  2. In the navigation pane on the left, choose Metric Analysis > Prometheus Monitoring.
  3. In the instance list, click a Prometheus instance for CCE.
  4. In the navigation pane on the left, choose Settings. In the Recording Rules area, click Edit RecordingRule.yaml.
  5. In the dialog box that is displayed, delete the default content and enter a custom recording rule.

    NOTE:

    Only one RecordingRule.yaml file needs to be configured for a cluster. Each rule group name must be unique.

    Table 1 Recording rule parameters

    Parameter

    Description

    groups

    Rule group. You can set multiple rule groups in one RecordingRule.yaml file.

    name

    Rule group name. Each rule group name must be unique.

    interval

    (Optional) Execution interval of a rule group. The default value is 60s.

    rules

    Rule. A rule group can contain multiple rules.

    record

    Name of a rule. The name must comply with Prometheus metric name specifications.

    expr

    Calculation expression. It is used to calculate metric values. It must comply with PromQL requirements.

    labels

    (Optional) Label of a metric.

    Example of a recording rule:

    groups:
      - name: apiserver_request_total
        interval: 60s
        rules:
          - record: apiserver_request_rate
            expr: avg by (job, instance, mode) (rate(apiserver_request_total[5m]))
            labels:
              team: operations
          - record: job:apiserver_request_total:sum_rate10m
            expr: sum by (job)(rate(apiserver_request_total[10m]))
            labels:
              team: operations

  6. Click OK.

Viewing Recording Rule Metrics

After a recording rule is configured, you can view its metrics on the Metric Browsing page of AOM or using Grafana.

Method 1: Viewing Metrics on the Metric Browsing Page of AOM

  1. On the Metric Analysis > Metric Browsing page, select a Prometheus instance for which a recording rule has been configured from the drop-down list.
  2. Click All metrics and enter the name of a recording rule metric in the search box to view its details.

Method 2: Viewing Metrics Using Grafana

For details, see Viewing Metric Data in AOM Using Grafana.

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