Managed Service for Prometheus can provide monitoring data of Application Load Balancer (ALB) instances, including metrics, alerts, and dashboards. This topic describes how to integrate ALB with Managed Service for Prometheus.
Overview
Managed Service for Prometheus is a managed monitoring service that is fully interfaced with the open source Prometheus ecosystem. Managed Service for Prometheus monitors a wide array of components and provides multiple ready-to-use dashboards. For more information, see What is Managed Service for Prometheus?
You can use Hybrid Cloud Monitoring to integrate ALB with Managed Service for Prometheus. You are charged for using Hybrid Cloud Monitoring, as described in the following table.
Integration type | Description | Billing | Storage fee |
Hybrid Cloud Monitoring (charged) | Managed Service for Prometheus calls the CloudMonitor API to collect ALB metrics. If ALB is integrated with Managed Service for Prometheus and alert rules are created, Managed Service for Prometheus displays the monitoring data and alerts on dashboards. | The data transfer fee generated by metric collection is charged by CloudMonitor. | Managed Service for Prometheus stores collected metrics free of charge. |
Example:
The following figure shows an example. The example is for reference only. The information on the buy page shall prevail.
Two listeners and three forwarding rules are created for the ALB instance. Each listener has 27 metrics, each instance has 27 metrics, each forwarding rule has 16 metrics, and each server group has 11 metrics.
Total number of metrics per minute = 27 × 1 ALB instance + 27 × 2 listeners + 16 × 3 forwarding rules + 11 × 2 server groups = 151.
Total number of data entries per day = 151 × 60 × 24 = 217,440.
Prerequisites
Application Real-Time Monitoring Service (ARMS) is activated. For more information, see Activate ARMS.
Managed Service for Prometheus is activated. For more information, see Activate Managed Service for Prometheus Pro Edition.
Integrate ALB with Managed Service for Prometheus
- Log on to the Managed Service for Prometheus console.
In the top navigation bar, select a region. On the Managed Service for Prometheus page, click Create Prometheus Instance.
On the Create Prometheus Instance page, click Prometheus Instances for Cloud Services.
In the Monitor Cloud Services panel, complete the following configurations:
Enter an instance name. Example: Hybrid Cloud Monitoring for ALB.
Set a retention duration.
Use the default value Hybrid Cloud Monitoring for the Select Data Source parameter.
Select Application Load Balancer (ALB) and click OK.
After the Prometheus instance is created, you are redirected to the Integration Center page, which displays that ALB is integrated with Managed Service for Prometheus.
View ALB metrics
On the Integration Center page, click the Application Load Balancer (ALB) card to view the ALB metrics, alerts, and dashboards.
The monitoring data is collected every minute. Data at 1-second intervals refers to the average value within a minute. The average value is for reference only. If you want to view data at 1-second intervals, enable the access log feature for the ALB instance. For more information, see Access logs.
Metric
You can view ALB metrics on the Metrics tab.
NotePercentage: the ratio of data entries generated by the metric to the total number of data entries.
Data entries: the number of data entries that are generated by the metric and persisted within the last 10 minutes.
Dashboard
On the Dashboards tab, you can view ALB metrics in the dashboard. You can also click the dashboard to view detailed ALB metrics in the ARMS console.
Alerts
On the Alerts tab, you can create Prometheus alert rules and view alert information. For more information, see Create an alert rule for a Prometheus instance.
Use a third-party Prometheus library
After ALB is integrated with Managed Service for Prometheus, you can use the remote write feature to load a third-party Prometheus library. For more information, see Create a Prometheus instance for remote write.
Disable monitoring on ALB
On the Integration Center page, click Uninstall in the Application Load Balancer (ALB) card in the Integrated section. In the message that appears, click OK.
If you no longer use the Prometheus instance, you can go to the Managed Service for Prometheus page, find the Prometheus instance, click Uninstall in the Actions column, and then click OK in the message that appears.