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

Prometheus Statements

Updated on 2023-05-26 GMT+08:00

AOM is interconnected with Prometheus Query Language (PromQL), which provides various built-in functions. These functions can be used to filter and aggregate metric data. You can run Prometheus statements to add metrics.

Prometheus Statement Syntax

For details about the Prometheus statement syntax, go to the Prometheus official website.

Examples of Using Prometheus Statements

  • Example 1: Memory usage of a specified pod in a node (excluding the control node)
    • Define variables:
      • Used memory of the containers in a pod (a pod may contain multiple containers or instances): aom_container_memory_used_megabytes
      • Total memory of the node: aom_node_memory_total_megabytes
    • Query logic:
      • For aom_container_memory_used_megabytes, use the aggregation function sum to calculate the actual used memory of a specified pod under a specified node based on the node IP address and pod ID.
      • For aom_node_memory_total_megabytes, use the aggregation function sum to calculate the total memory of a specified node based on the node IP address.
      • Both of them are filtered by node IP address. Therefore, the obtained metric values have the same metric dimension. (Only the values are different.)
      • The actual memory usage of the pod can be obtained by performing the "/" operation on the values of the preceding two metrics.
    • To query the actual memory usage of the pod, use the following statement:

      sum(aom_container_memory_used_megabytes{podID="****1461-41d8-****-bfeb-fc1213****",nodeIP="***.***.***.***"}) by (nodeIP) / sum(aom_node_memory_total_megabytes{nodeIP="***.***.***.***"}) by (nodeIP)

  • Example 2: CPU usage of a specified pod in a node (excluding the control node)
    • Define variables:
      • Used CPU cores of the containers in a pod: aom_container_cpu_used_core
      • Actual total number of CPU cores of the node: aom_node_cpu_limit_core
    • Query logic:
      • For aom_container_cpu_used_core, use the aggregation function sum to calculate the used CPU cores of a specified pod under a specified node based on the node IP address and pod ID.
      • For aom_node_cpu_limit_core, use the aggregation function sum to calculate the total CPU cores of a specified node based on the node IP address.
      • Both of them are filtered by node IP address. Therefore, the obtained metric values have the same metric dimension. (Only the values are different.)
      • The actual memory usage of the pod can be obtained by performing the "/" operation on the values of the preceding two metrics.
    • To obtain the actual CPU usage of the pod, use the following statement:

      sum(aom_container_cpu_used_core{nodeIP="***.***.***.***",podID="****1461-41d8-****-bfeb-***13******"}) by (nodeIP) / sum(aom_node_cpu_limit_core{nodeIP="***.***.***.***"}) by (nodeIP)

  • Example 3: Requested memory of a pod/Allocable memory of the node where the pod is located
    • Define variables:
      • Memory allocated to the containers in a pod: aom_container_memory_request_megabytes
      • Total memory of the node: aom_node_memory_total_megabytes
    • Query logic:
      • For aom_container_memory_request_megabytes, use the aggregation function sum to calculate the allocated memory of a specified pod under a specified node based on the node IP address and pod ID.
      • For aom_node_memory_total_megabytes, use the aggregation function sum to calculate the total memory of a specified node based on the node IP address.
      • Both of them are filtered by node IP address. Therefore, the obtained metric values have the same metric dimension. (Only the values are different.)
      • The actual memory usage of the pod can be obtained by performing the "/" operation on the values of the preceding two metrics.
    • To obtain the actual memory allocation ratio of the pod, use the following statement:

      sum(aom_container_memory_request_megabytes{podID="****1461-41d8-4403-****-f***35*****",nodeIP="***.***.***.***"}) by (nodeIP) / sum(aom_node_memory_total_megabytes{nodeIP="***.***.***.***"}) by (nodeIP)

  • Example 4: Requested CPU cores of a pod/Allocable CPU cores of the node where the pod is located
    • Define variables:
      • CPU cores allocated to the containers in the pod: aom_container_cpu_limit_core
      • CPU cores allocated to the node: aom_node_cpu_limit_core
    • Query logic:
      • For aom_container_cpu_limit_core, use the aggregation function sum to calculate the CPU cores allocated to a specified pod under a specified node based on the node IP address and pod ID.
      • For aom_node_cpu_limit_core, use the aggregation function sum to calculate the total CPU cores of a specified node based on the node IP address.
      • Both of them are filtered by node IP address. Therefore, the obtained metric values have the same metric dimension. (Only the values are different.)
      • The actual CPU usage of the pod can be obtained by performing the "/" operation on the values of the preceding two metrics.
    • To obtain the actual CPU allocation ratio of the pod, use the following statement:

      sum(aom_container_cpu_limit_core{podID="*****461-41d8-****-bfeb-****135*****",nodeIP="***.***.***.***"}) by (nodeIP) / sum(aom_node_cpu_limit_core{nodeIP="***.***.***.***"}) by (nodeIP)

Common Prometheus Commands

Table 1 lists the common Prometheus commands for querying metrics. You can modify parameters such as the IP address and ID based on site requirements.

Table 1 Common Prometheus commands

Metric

Tag Definition

PromQL

Host CPU usage

{nodeIP="", hostID=""}

aom_node_cpu_usage{nodeIP="192.168.57.93",hostID="ca76b63f-dbf8-4b60-9c71-7b9f13f5ad61"}

Host application request throughput

{aomApplicationID="",aomApplicationName=""}

http_requests_throughput{aomApplicationID="06dc9f3b0d8cb867453ecd273416ce2a",aomApplicationName="root"}

Success rate of host application requests

{appName="",serviceID="",clusterId=""}

http_requests_success_rate{aomApplicationID="06dc9f3b0d8cb867453ecd273416ce2a",aomApplicationName="root"

Host component CPU usage

{appName="",serviceID="",clusterId=""}

aom_process_cpu_usage{appName="icagent",serviceID="2d29673a69cd82fabe345be5f0f7dc5f",clusterId="00000000-0000-0000-0000-00000000"}

Host process threads

{processCmd=""}{processID=""}{processName=""}

aom_process_thread_count{processCmd="cdbc06c2c05b58d598e9430fa133aff7_b14ee84c-2b78-4f71-9ecc-2d06e053172c_ca4d29a846e9ad46a187ade88048825e",processName="icwatchdog"}

Cluster disk usage

{clusterId="",clusterName=""}

aom_cluster_disk_usage{clusterId="4ba8008c-b93c-11ec-894a-0255ac101afc",clusterName="servicestage-test"}

Cluster virtual memory usage

{clusterId="",clusterName=""}

aom_node_virtual_memory_usage{nodeIP="192.168.10.4",clusterId="af3cc895-bc5b-11ec-a642-0255ac101a0b",nameSpace="default"}

Available cluster virtual memory

{clusterId="",clusterName=""}

aom_cluster_virtual_memory_free_megabytes{clusterId="4ba8008c-b93c-11ec-894a-0255ac101afc",clusterName="servicestage-test"}

Workload file system usage

{appName="",serviceID="",clusterId="",nameSpace=""}

aom_container_filesystem_usage{appName="icagent",serviceID="cfebc2222b1ce1e29ad827628325400e",clusterId="af3cc895-bc5b-11ec-a642-0255ac101a0b",nameSpace="kube-system"}

Pod kernel usage

{podID="",podName=""}

aom_container_cpu_used_core{podID="573663db-4f09-4f30-a432-7f11bdb8fb2e",podName="icagent-bkm6q"}

Container uplink rate (BPS)

{containerID="",containerName=""}

aom_container_network_transmit_bytes{containerID="16bf66e9b62c08493ef58ff2b7056aae5d41496d5a2e4bac908c268518eb2cbc",containerName="coredns"}

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