Integrate ALB with Prometheus monitoring

Updated at:
Copy as MD

Managed Service for Prometheus monitors your Application Load Balancer (ALB) instances and provides metrics, dashboards, and alerts. This topic explains how to set up the integration and use Managed Service for Prometheus.

Overview

Alibaba Cloud Prometheus Service integrates with the open source Prometheus ecosystem. It monitors various components, includes a variety of out-of-the-box monitoring dashboards, and provides a hosted Prometheus service. For more information, see What is Prometheus Service?.

ALB integrates with Managed Service for Prometheus through Enterprise CloudMonitor Integration (Paid). For more information, see the table below.

Integration type

Description

Metric fee

Storage fee

Enterprise Cloud Monitor integration (paid)

Prometheus monitoring retrieves metrics through the Cloud Monitor API. After you integrate ALB with Prometheus monitoring, you can monitor the ALB service and configure alarms using the cloud service dashboard and alarm rules.

Cloud Monitor charges traffic fees for reporting ALB metrics.

Prometheus monitoring stores the reported metrics free of charge.

Billing example

The billing example in the following figure is for reference only. For actual fees, see the purchase page.

image..png

An ALB instance has 2 listeners and 3 forwarding rules. There are 27 metrics for the instance and for each listener, 16 for each forwarding rule, and 11 for each server group.

Total metrics per minute = 27 × 1 ALB instance + 27 × 2 listeners + 16 × 3 forwarding rules + 11 × 2 server groups = 151

Total data points per day for CloudMonitor pay-as-you-go = 151 × 60 × 24 = 217,440

Prerequisites

Create a Prometheus instance

Important

Monitoring data is available only at minute-level granularity. Displayed second-level metrics are one-minute averages and may not accurately reflect sudden changes within that minute. For second-level monitoring, enable the access log feature. For more information, see ALB access log.

  1. Log on to the Cloud Monitor console.

  2. In the top navigation bar, select a region, and then click Create Prometheus Instance.

  3. On the Create Instance page, configure the following parameters and then click Create.

    Parameter

    Description

    Instance type

    Select general-purpose instance or global aggregation instance.

    Note
    • general-purpose instance: A standard Prometheus instance suitable for various scenarios. It serves as remote write storage (Remote Write) for self-managed Prometheus services or ingests metrics from containers, cloud services, and hosts.

    • global aggregation instance: A virtual instance that aggregates data from multiple Alibaba Cloud Prometheus instances or self-managed Prometheus clusters. It provides unified metric queries, a single Grafana data source, and centralized alerting across all aggregated sources.

    Retention period

    Select a retention period of 90 days or 180 days.

ALB and Prometheus integration

  1. Log in to the ARMS console.

  2. In the left-side navigation pane, click Integration Center.

  3. On the Integration Center page, click the Middleware tab, and then click Alibaba Cloud ALB.

  4. In the Alibaba Cloud ALB panel, select the region to store your data and click OK. It takes about 1 to 2 minutes to integrate the ALB monitoring data.

  • Metrics

    You can view ALB monitoring metrics on the Metrics tab.

    ALB metrics in Prometheus

    Metric

    Description

    AliyunAlb_ListenerActiveConnection

    The number of active connections for the listener.

    AliyunAlb_ListenerClientTLSNegotiationError

    The number of failed client TLS handshakes for the listener. (count/s)

    AliyunAlb_ListenerHTTPCode2XX

    The number of 2xx status codes for the listener. (count/s)

    AliyunAlb_ListenerHTTPCode3XX

    The number of 3xx status codes for the listener. (count/s)

    AliyunAlb_ListenerHTTPCode4XX

    The number of 4xx status codes for the listener. (count/s)

    AliyunAlb_ListenerHTTPCode500

    The number of 500 status codes for the listener. (count/s)

    AliyunAlb_ListenerHTTPCode502

    The number of 502 status codes for the listener. (count/s)

    AliyunAlb_ListenerHTTPCode503

    The number of 503 status codes for the listener. (count/s)

    AliyunAlb_ListenerHTTPCode504

    The number of 504 status codes for the listener. (count/s)

    AliyunAlb_ListenerHTTPCode5XX

    The number of 5xx status codes for the listener. (count/s)

    AliyunAlb_ListenerHTTPCodeUpstream2XX

    The number of 2xx status codes from backend servers for the listener. (count/s)

    AliyunAlb_ListenerHTTPCodeUpstream3XX

    The number of 3xx status codes from backend servers for the listener. (count/s)

    AliyunAlb_ListenerHTTPCodeUpstream4XX

    The number of 4xx status codes from backend servers for the listener. (count/s)

    AliyunAlb_ListenerHTTPCodeUpstream5XX

    The number of 5xx status codes from backend servers for the listener. (count/s)

    AliyunAlb_ListenerHTTPFixedResponse

    The number of fixed responses for the listener. (count/s)

    AliyunAlb_ListenerHTTPRedirect

    The number of redirects for the listener. (count/s)

    AliyunAlb_ListenerHealthyHostCount

    The number of healthy backend servers for the listener.

    AliyunAlb_ListenerInBits

    The inbound bandwidth for the listener. (bits/s)

    AliyunAlb_ListenerInactiveConnection

    The number of inactive connections for the listener. (count/s)

    AliyunAlb_ListenerMaxConnection

    The maximum concurrent connections for the listener. (count/s)

    AliyunAlb_ListenerNewConnection

    The number of new connections for the listener. (count/s)

    AliyunAlb_ListenerNonStickyRequest

    The number of requests that did not use a sticky session for the listener. (count/s)

    AliyunAlb_ListenerOutBits

    The outbound bandwidth for the listener. (bits/s)

    AliyunAlb_ListenerQPS

    The number of requests per second (QPS) for the listener. (count/s)

    AliyunAlb_ListenerRejectedConnection

    The number of rejected connections for the listener. (count/s)

    AliyunAlb_ListenerRequestTime

    The request latency for the listener. (ms)

    AliyunAlb_ListenerUnHealthyHostCount

    The number of unhealthy backend servers for the listener.

    AliyunAlb_ListenerUpstreamConnectionError

    The number of backend connection errors for the listener. (count/s)

    AliyunAlb_ListenerUpstreamResponseTime

    The response time of backend servers for the listener. (ms)

    AliyunAlb_ListenerUpstreamTLSNegotiationError

    The number of failed TLS handshakes with backend servers for the listener. (count/s)

    AliyunAlb_LoadBalancerActiveConnection

    The number of active connections for the load balancer instance.

    AliyunAlb_LoadBalancerClientTLSNegotiationError

    The number of failed client TLS handshakes for the load balancer instance. (count/s)

    AliyunAlb_LoadBalancerHTTPCode2XX

    The number of 2xx status codes for the load balancer instance. (count/s)

    AliyunAlb_LoadBalancerHTTPCode3XX

    The number of 3xx status codes for the load balancer instance. (count/s)

    AliyunAlb_LoadBalancerHTTPCode4XX

    The number of 4xx status codes for the load balancer instance. (count/s)

    AliyunAlb_LoadBalancerHTTPCode500

    The number of 500 status codes for the load balancer instance. (count/s)

    AliyunAlb_LoadBalancerHTTPCode502

    The number of 502 status codes for the load balancer instance. (count/s)

    AliyunAlb_LoadBalancerHTTPCode503

    The number of 503 status codes for the load balancer instance. (count/s)

    AliyunAlb_LoadBalancerHTTPCode504

    The number of 504 status codes for the load balancer instance. (count/s)

    AliyunAlb_LoadBalancerHTTPCode5XX

    The number of 5xx status codes for the load balancer instance. (count/s)

    AliyunAlb_LoadBalancerHTTPCodeUpstream2XX

    The number of 2xx status codes from backend servers for the load balancer instance. (count/s)

    AliyunAlb_LoadBalancerHTTPCodeUpstream3XX

    The number of 3xx status codes from backend servers for the load balancer instance. (count/s)

    AliyunAlb_LoadBalancerHTTPCodeUpstream4XX

    The number of 4xx status codes from backend servers for the load balancer instance. (count/s)

    AliyunAlb_LoadBalancerHTTPCodeUpstream5XX

    The number of 5xx status codes from backend servers for the load balancer instance. (count/s)

    AliyunAlb_LoadBalancerHTTPFixedResponse

    The number of fixed responses for the load balancer instance. (count/s)

    AliyunAlb_LoadBalancerHTTPRedirect

    The number of redirects for the load balancer instance. (count/s)

    AliyunAlb_LoadBalancerHealthyHostCount

    The number of healthy backend servers for the load balancer instance.

    AliyunAlb_LoadBalancerInBits

    The inbound bandwidth for the load balancer instance. (bits/s)

    AliyunAlb_LoadBalancerInactiveConnection

    The number of inactive connections for the load balancer instance. (count/s)

    AliyunAlb_LoadBalancerMaxConnection

    The maximum concurrent connections for the load balancer instance. (count/s)

    AliyunAlb_LoadBalancerNewConnection

    The number of new connections for the load balancer instance. (count/s)

    AliyunAlb_LoadBalancerNonStickyRequest

    The number of requests that did not use a sticky session for the load balancer instance. (count/s)

    AliyunAlb_LoadBalancerOutBits

    The outbound bandwidth for the load balancer instance. (bits/s)

    AliyunAlb_LoadBalancerQPS

    The number of requests per second (QPS) for the load balancer instance. (count/s)

    AliyunAlb_LoadBalancerRejectedConnection

    The number of rejected connections for the load balancer instance. (count/s)

    AliyunAlb_LoadBalancerRequestTime

    The request latency for the load balancer instance. (ms)

    AliyunAlb_LoadBalancerUnHealthyHostCount

    The number of unhealthy backend servers for the load balancer instance.

    AliyunAlb_LoadBalancerUpstreamConnectionError

    The number of backend connection errors for the load balancer instance. (count/s)

    AliyunAlb_LoadBalancerUpstreamResponseTime

    The response time of backend servers for the load balancer instance. (ms)

    AliyunAlb_LoadBalancerUpstreamTLSNegotiationError

    The number of failed TLS handshakes with backend servers for the load balancer instance. (count/s)

    AliyunAlb_RuleHTTPCodeUpstream2XX

    The number of 2xx status codes from backend servers for the forwarding rule. (count/s)

    AliyunAlb_RuleHTTPCodeUpstream3XX

    The number of 3xx status codes from backend servers for the forwarding rule. (count/s)

    AliyunAlb_RuleHTTPCodeUpstream4XX

    The number of 4xx status codes from backend servers for the forwarding rule. (count/s)

    AliyunAlb_RuleHTTPCodeUpstream5XX

    The number of 5xx status codes from backend servers for the forwarding rule. (count/s)

    AliyunAlb_RuleHealthyHostCount

    The number of healthy backend servers for the forwarding rule.

    AliyunAlb_RuleNonStickyRequest

    The number of requests that did not use a sticky session for the forwarding rule. (count/s)

    AliyunAlb_RuleQPS

    The number of requests per second (QPS) for the forwarding rule. (count/s)

    AliyunAlb_RuleRequestTime

    The request latency for the forwarding rule. (ms)

    AliyunAlb_RuleUnHealthyHostCount

    The number of unhealthy backend servers for the forwarding rule.

    AliyunAlb_RuleUpstreamConnectionError

    The number of backend connection errors for the forwarding rule. (count/s)

    AliyunAlb_RuleUpstreamResponseTime

    The response time of backend servers for the forwarding rule. (ms)

    AliyunAlb_RuleUpstreamTLSNegotiationError

    The number of failed TLS handshakes with backend servers for the forwarding rule. (count/s)

    AliyunAlb_ServerGroupHTTPCodeUpstream2XX

    The number of 2xx status codes from backend servers for the server group. (count/s)

    AliyunAlb_ServerGroupHTTPCodeUpstream3XX

    The number of 3xx status codes from backend servers for the server group. (count/s)

    AliyunAlb_ServerGroupHTTPCodeUpstream4XX

    The number of 4xx status codes from backend servers for the server group. (count/s)

    AliyunAlb_ServerGroupHTTPCodeUpstream5XX

    The number of 5xx status codes from backend servers for the server group. (count/s)

    AliyunAlb_ServerGroupHealthyHostCount

    The number of healthy servers in the server group.

    AliyunAlb_ServerGroupNonStickyRequest

    The number of requests that did not use a sticky session for the server group. (count/s)

    AliyunAlb_ServerGroupRequestTime

    The request latency for the server group. (ms)

    AliyunAlb_ServerGroupQPS

    The number of requests per second (QPS) for the server group. (count/s)

    AliyunAlb_ServerGroupUnHealthyHostCount

    The number of unhealthy servers in the server group.

    AliyunAlb_ServerGroupUpstreamConnectionError

    The number of backend connection errors for the server group. (count/s)

    AliyunAlb_ServerGroupUpstreamResponseTime

    The response time of backend servers for the server group. (ms)

    AliyunAlb_ServerGroupUpstreamTLSNegotiationError

    The number of failed TLS handshakes with backend servers for the server group. (count/s)

    AliyunAlb_RuleHTTPCodeUpstream2XXRatio

    The percentage of 2xx status codes from backend servers for the forwarding rule.

    AliyunAlb_RuleHTTPCodeUpstream3XXRatio

    The percentage of 3xx status codes from backend servers for the forwarding rule.

    AliyunAlb_RuleHTTPCodeUpstream4XXRatio

    The percentage of 4xx status codes from backend servers for the forwarding rule.

    AliyunAlb_RuleHTTPCodeUpstream5XXRatio

    The percentage of 5xx status codes from backend servers for the forwarding rule.

    AliyunAlb_VipActiveConnection

    The number of active connections for the VIP.

    AliyunAlb_VipClientTLSNegotiationError

    The number of failed client TLS handshakes for the VIP. (count/s)

    AliyunAlb_VipHTTPCode2XX

    The number of 2xx status codes for the VIP. (count/s)

    AliyunAlb_VipHTTPCode3XX

    The number of 3xx status codes for the VIP. (count/s)

    AliyunAlb_VipHTTPCode4XX

    The number of 4xx status codes for the VIP. (count/s)

    AliyunAlb_VipHTTPCode500

    The number of 500 status codes for the VIP. (count/s)

    AliyunAlb_VipHTTPCode502

    The number of 502 status codes for the VIP. (count/s)

    AliyunAlb_VipHTTPCode503

    The number of 503 status codes for the VIP. (count/s)

    AliyunAlb_VipHTTPCode504

    The number of 504 status codes for the VIP. (count/s)

    AliyunAlb_VipHTTPCode5XX

    The number of 5xx status codes for the VIP. (count/s)

    AliyunAlb_VipHTTPFixedResponse

    The number of fixed responses for the VIP. (count/s)

    AliyunAlb_VipHTTPRedirect

    The number of redirects for the VIP. (count/s)

    AliyunAlb_VipInBits

    The inbound bandwidth for the VIP. (bits/s)

    AliyunAlb_VipInactiveConnection

    The number of inactive connections for the VIP. (count/s)

    AliyunAlb_VipMaxConnection

    The maximum concurrent connections for the VIP. (count/s)

    AliyunAlb_VipNewConnection

    The number of new connections for the VIP. (count/s)

    AliyunAlb_VipNonStickyRequest

    The number of requests that did not use a sticky session for the VIP. (count/s)

    AliyunAlb_VipOutBits

    The outbound bandwidth for the VIP. (bits/s)

    AliyunAlb_VipQPS

    The number of requests per second (QPS) for the VIP. (count/s)

    AliyunAlb_VipRejectedConnection

    The number of rejected connections for the VIP. (count/s)

    AliyunAlb_VipRequestTime

    The request latency for the VIP. (ms)

    AliyunAlb_VipUpstreamConnectionError

    The number of backend connection errors for the VIP. (count/s)

    AliyunAlb_VipUpstreamResponseTime

    The response time of backend servers for the VIP. (ms)

    AliyunAlb_VipUpstreamTLSNegotiationError

    The number of failed TLS handshakes with backend servers for the VIP. (count/s)

    Note
    • Proportion: The share of this metric relative to the total metric count.

    • Metric count: The number of metrics written to the database within the last 10 minutes.

  • Dashboard

    On the Get Started tab, go to Access Management > Component Management > Dashboard and click ALB to view its performance metrics.

  • Alerts

    You can create Prometheus alerting rules on the Alerting rule template tab and view monitoring alerts. For instructions on how to create an alerting rule, see Create a Prometheus alerting rule.

Third-party Prometheus instance

After integrating Application Load Balancer (ALB) with Managed Service for Prometheus, you can use remote write to integrate a self-managed Prometheus instance. For more information, see Prometheus instance for General-purpose.

Disable ALB monitoring

  1. Log on to the Cloud Monitor console.

  2. On the Instances page, select the target region in the top navigation bar, find the target instance, and click Uninstall in the Actions column.

  3. In the confirmation dialog box, click OK.

Related documents