All Products
Search
Document Center

Elastic Compute Service:Use CloudMonitor to monitor and configure alert rules for websites

Last Updated:Dec 02, 2024

In most cases, cloud-based business involves various cloud services and a large number of cloud resources. You must monitor the real-time running status of services in the business system. This helps you identify potential issues, prevent possible business failures, and improve business continuity. To achieve the preceding goals, you must build monitoring capabilities for your business. This topic describes how to use CloudMonitor to build website monitoring capabilities. In this topic, a regular website architecture is used as an example.

Background information

Alibaba Cloud provides various cloud services, such as Elastic Compute Service (ECS), Application Load Balancer (ALB), NAT, IPv6 Gateway, Object Storage Service (OSS), and ApsaraDB RDS. If you want to quickly build a complete monitoring system that covers all cloud services, you can use CloudMonitor.

CloudMonitor provides a one-stop, out-of-the-box, and enterprise-grade monitoring solution. CloudMonitor supports IT infrastructure monitoring and Internet quality monitoring by using events, custom metrics, and logs, and provides efficient, comprehensive, and cost-effective monitoring services. CloudMonitor helps you improve system service availability and reduce the O&M costs of IT infrastructure.

Prerequisites

Before you use CloudMonitor, make sure that the following requirements are met:

Workflow

This topic uses a website service as an example to describe how to build website monitoring capabilities. In this example, ECS, ApsaraDB RDS, OSS, and Server Load Balancer (SLB) are used.

image

To build monitoring capabilities for the simple website architecture shown in the preceding figure, you can use the following workflow:

  • Monitor and configure alert rules for ECS instances.

  • Monitor and configure alert rules for ApsaraDB RDS for MySQL instances.

  • Monitor and configure alert rules for SLB instances.

  • Build site monitoring capabilities.

  • Detect the performance and user experience of webpages related to the website service.

  • Manage the system event service.

  • Build a custom monitoring dashboard.

Procedure

Build monitoring capabilities for the preceding sample website application by using Alibaba Cloud CloudMonitor based on the preceding workflow.

Monitor ECS instances

View ECS monitoring metrics

Use CloudMonitor to view the monitoring metrics of ECS instances.

image

Alert rule configuration example

Note

We recommend that you configure alert thresholds for monitoring metrics based on your business requirements. A lower-than-expected threshold may result in frequent triggering of alerts and affect user experience. A higher-than-expected threshold may lead to insufficient response time to alerts.

Define alert levels and metric thresholds to trigger and send notifications for alerts. We recommend that you configure alert rules for the ECS instances that you want to monitor based on your business requirements. For example, you can configure an alert rule for CPU utilization. This ensures that a specific amount of CPU resources is reserved to guarantee the running of ECS instances. In this example, set the alert threshold for the CPU utilization of ECS instances to 70% and trigger an alert after the threshold is exceeded three consecutive times.

设置CPU告警阈值

Monitor ApsaraDB RDS for MySQL instances

View RDS monitoring metrics

Use CloudMonitor to view the monitoring metrics of ApsaraDB RDS for MySQL instances. The following figure shows the monitoring metrics.

image

Alert rule configuration example

Define alert levels and metric thresholds to trigger and send notifications for alerts. We recommend that you configure alert rules for the ApsaraDB RDS for MySQL instances that you want to monitor based on your business requirements. For example, set the alert threshold for the CPU utilization of ApsaraDB RDS for MySQL instances to 70% and trigger an alert when the threshold is exceeded three consecutive times. You can also configure alert rules for other monitoring metrics, such as the disk usage, IOPS utilization, and the total number of connections, based on your business requirements.

设置RDS监控

Monitor SLB instances

View SLB monitoring metrics

Use CloudMonitor to view the monitoring metrics of different SLB services. The following figure shows the monitoring metrics.

image

Alert rule configuration example

Define alert levels and metric thresholds to trigger and send notifications for alerts. We recommend that you configure alert rules for the SLB instances that you want to monitor based on your business requirements. Before you use CloudMonitor to monitor SLB instances, make sure that health check is enabled for the SLB instances and configure alert rules for the SLB instances based on your business requirements. For example, you can set the alert threshold for the bandwidth of SLB instances to 7 Mbit/s, as shown in the following figure.设置负载均衡监控

Note

For more information about how to view monitoring metrics and configure alert rules for cloud services, see Cloud service monitoring.

Build site monitoring capabilities

Site monitoring is an external monitoring service provided for cloud resources and is used to simulate real user access scenarios and test business availability in real time. The monitoring data can also be used to troubleshoot issues.

Site monitoring configuration example

image

Example of viewing the site monitoring data

image

Detect the performance and user experience of a webpage

If you want to analyze the network quality of your website for subsequent development, optimization, quality check, and operation, you can configure browser detection for your website. For more information, see Detect the performance of a site.

Manage the system event service

CloudMonitor provides the event monitoring feature to help you query and analyze system events that are generated for different Alibaba Cloud services. The feature allows you to track the use of Alibaba Cloud services. This way, you can analyze and identify issues at the earliest opportunity when business failures occur. For more information about the Alibaba Cloud services and related system events supported by CloudMonitor, see Supported cloud services and their system events.

Build a custom monitoring dashboard

If you want to view the custom core metrics of all cloud services on the dashboard page, use the dashboard feature of CloudMonitor. The dashboard feature allows you to configure monitoring overview for all cloud resources in the business system. This way, you can check the health status of the resources at any time. For more information about how to use a custom monitoring dashboard, see Overview of custom monitoring dashboard.

image

View alerts related to monitoring metrics

If a metric meets the predefined alert conditions, CloudMonitor sends alert notifications to the recipients that you configured, such as phone numbers, email addresses, and DingTalk chatbots. You can also view historical alerts in the CloudMonitor console.

image

References