Esta página ainda não está disponível no idioma selecionado. Estamos trabalhando para adicionar mais opções de idiomas. Agradecemos sua compreensão.
- Service Overview
- Billing
- Getting Started
-
User Guide
- Overview
- Permissions Management
- Environment Management
- Application Management
- Component Management
- Instance Management
- Component Configurations
- Component O&M
- System Settings
- Key Operations Recorded by CTS
-
Best Practices
- CAE Best Practices
- Using CAE to Host Nginx Static File Servers
- Interconnecting GitLab with Jenkins for Automatic Build and Deployment on CAE
- Deploying Components Based on the Dependency Sequence Using the Jenkins Pipeline
- Deploying Spring Cloud Applications to CAE to Automatically Connect to the Nacos Engine
- Graceful Startup of a Spring Cloud Application
- Health Check
- Lifecycle Management
- Sending Event Alarms to WeCom
-
Connecting to the CodeArts Pipeline to Automatically Upgrade CAE Components
- Overview
- Upgrading a CAE Component After Uploading a Software Package Built Using the Pipeline to a CodeArts Release Repo
- Upgrading a CAE Component After Uploading a Software Package Built Using the Pipeline to the OBS Bucket
- Upgrading a CAE Component After Uploading an Image Built Using the Pipeline to the SWR Image Repository
- Configuring PromQL to Implement Custom Auto Scaling
- Configuring the Interconnection Between CAE and DEW to Help Applications Obtain Encrypted Secrets from DEW
- Deploying ASP.NET Core Applications to CAE
- Connecting the Network Through Enterprise Routes
- API Reference
-
FAQs
- Component Management FAQs
- Environment Management
-
Component Configuration FAQs
- Is Manual Scaling Still Effective When a Scaling Policy Is Configured?
- Can Components Be Scaled Without a Scaling Policy?
- Why Is My Instance Abnormal After Cloud Storage Is Configured?
- What Do I Do If a Component Becomes Not Ready?
- How Does CAE Support Dark Launch?
- How Do I Provide Prometheus Metrics for a Java Application?
- System Configuration FAQs
- Service Resources FAQs
- General Reference
Copied.
Configuring PromQL to Implement Custom Auto Scaling
Assume that there is a component named my_component, its environment is my_environment, and the application is my_application.
Assume that the component provides the custom metric http_requests_total, which indicates the total number of HTTP requests. This section uses this metric as an example to describe how to use PromQL.
Querying Metrics
Run the following PromQL statement to query the latest metric:
http_requests_total{environment_name="my_environment",application_name="my_application",component_name="my_component"}
Run the following command to query all metrics in the last 5 minutes:
http_requests_total{environment_name="my_environment",application_name="my_application",component_name="my_component"}[5m]
Processing Queried Metrics
Querying Metrics contains multiple metrics queried. For example, if a component has multiple instances, there are multiple pieces of metrics; if metrics have been queried for a period of time, there are multiple pieces of metrics.
PromQL in an AS policy must return a single value. Therefore, you need to process the queried metrics to obtain a single value. Example:
Query the latest metric and calculate the average value to obtain the average value of the total number of HTTP requests of all instances.
avg(http_requests_total{environment_name="my_environment",application_name="my_application",component_name="my_component"})
Query all metrics in the last 5 minutes, obtain the change (increased value), and calculate the average value to obtain the average number of increased HTTP requests of each instance in the last 5 minutes.
avg(delta(http_requests_total{environment_name="my_environment",application_name="my_application",component_name="my_component"}[5m]))
For more information, see PromQL document and PromQL example.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot