All Products
Search
Document Center

Server Load Balancer:Integrate ALB with Managed Service for Prometheus

Last Updated:Sep 21, 2023

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.

image..png

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

Integrate ALB with Managed Service for Prometheus

  1. Log on to the Managed Service for Prometheus console.
  2. In the top navigation bar, select a region. On the Managed Service for Prometheus page, click Create Prometheus Instance.

  3. On the Create Prometheus Instance page, click Prometheus Instances for Cloud Services.

  4. In the Monitor Cloud Services panel, complete the following configurations:

    1. Enter an instance name. Example: Hybrid Cloud Monitoring for ALB.

    2. Set a retention duration.

    3. Use the default value Hybrid Cloud Monitoring for the Select Data Source parameter.

    4. 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.

Important

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.

    ALB metrics supported by Managed Service for Prometheus

    Metric

    Description

    AliyunAlb_ListenerActiveConnection

    The number of active connections on the listener.

    AliyunAlb_ListenerClientTLSNegotiationError

    The number of connections that fail Transport Layer Security (TLS) handshakes per second on the listener.

    AliyunAlb_ListenerHTTPCode2XX

    The number of 2xx status codes per second on the listener.

    AliyunAlb_ListenerHTTPCode3XX

    The number of 3xx status codes per second on the listener.

    AliyunAlb_ListenerHTTPCode4XX

    The number of 4xx status codes per second on the listener.

    AliyunAlb_ListenerHTTPCode500

    The number of 500 status codes per second on the listener.

    AliyunAlb_ListenerHTTPCode502

    The number of 502 status codes per second on the listener.

    AliyunAlb_ListenerHTTPCode503

    The number of 503 status codes per second on the listener.

    AliyunAlb_ListenerHTTPCode504

    The number of 504 status codes per second on the listener.

    AliyunAlb_ListenerHTTPCode5XX

    The number of 5xx status codes per second on the listener.

    AliyunAlb_ListenerHTTPCodeUpstream2XX

    The number of 2xx status codes per second on the backend servers associated with the listener.

    AliyunAlb_ListenerHTTPCodeUpstream3XX

    The number of 3xx status codes per second on the backend servers associated with the listener.

    AliyunAlb_ListenerHTTPCodeUpstream4XX

    The number of 4xx status codes per second on the backend servers associated with the listener.

    AliyunAlb_ListenerHTTPCodeUpstream5XX

    The number of 5xx status codes per second on the backend servers associated with the listener.

    AliyunAlb_ListenerHTTPFixedResponse

    The number of custom responses per second on the listener.

    AliyunAlb_ListenerHTTPRedirect

    The number of redirects per second on the listener.

    AliyunAlb_ListenerHealthyHostCount

    The number of healthy servers associated with the listener.

    AliyunAlb_ListenerInBits

    The inbound bandwidth (bit/s) of the listener.

    AliyunAlb_ListenerNewConnection

    The number of new connections per second on the listener.

    AliyunAlb_ListenerNonStickyRequest

    The number of nonsticky requests per second on the listener.

    AliyunAlb_ListenerOutBits

    The outbound bandwidth (bit/s) of the listener.

    AliyunAlb_ListenerQPS

    The number of requests per second on the listener.

    AliyunAlb_ListenerRejectedConnection

    The number of connections dropped per second on the listener.

    AliyunAlb_ListenerUnHealthyHostCount

    The number of unhealthy servers associated with the listener.

    AliyunAlb_ListenerUpstreamConnectionError

    The number of connection failures per second on the backend servers associated with the listener.

    AliyunAlb_ListenerUpstreamResponseTime

    The response time (milliseconds) of the backend servers associated with the listener.

    AliyunAlb_ListenerUpstreamTLSNegotiationError

    The number of TLS handshake failures per second on the backend servers associated with the listener.

    AliyunAlb_LoadBalancerActiveConnection

    The number of active connections on the ALB instance.

    AliyunAlb_LoadBalancerClientTLSNegotiationError

    The number of TLS handshake failures per second on the ALB instance.

    AliyunAlb_LoadBalancerHTTPCode2XX

    The number of 2xx status codes per second on the ALB instance.

    AliyunAlb_LoadBalancerHTTPCode3XX

    The number of 3xx status codes per second on the ALB instance.

    AliyunAlb_LoadBalancerHTTPCode4XX

    The number of 4xx status codes per second on the ALB instance.

    AliyunAlb_LoadBalancerHTTPCode500

    The number of 500 status codes per second on the ALB instance.

    AliyunAlb_LoadBalancerHTTPCode502

    The number of 502 status codes per second on the ALB instance.

    AliyunAlb_LoadBalancerHTTPCode503

    The number of 503 status codes per second on the ALB instance.

    AliyunAlb_LoadBalancerHTTPCode504

    The number of 504 status codes per second on the ALB instance.

    AliyunAlb_LoadBalancerHTTPCode5XX

    The number of 5xx status codes per second on the ALB instance.

    AliyunAlb_LoadBalancerHTTPCodeUpstream2XX

    The number of 2xx status codes per second on the backend servers of the ALB instance.

    AliyunAlb_LoadBalancerHTTPCodeUpstream3XX

    The number of 3xx status codes per second on the backend servers of the ALB instance.

    AliyunAlb_LoadBalancerHTTPCodeUpstream4XX

    The number of 4xx status codes per second on the backend servers of the ALB instance.

    AliyunAlb_LoadBalancerHTTPCodeUpstream5XX

    The number of 5xx status codes per second on the backend servers of the ALB instance.

    AliyunAlb_LoadBalancerHTTPFixedResponse

    The number of custom responses per second on the ALB instance.

    AliyunAlb_LoadBalancerHTTPRedirect

    The number of redirects per second on the ALB instance.

    AliyunAlb_LoadBalancerHealthyHostCount

    The number of healthy servers associated with the ALB instance.

    AliyunAlb_LoadBalancerInBits

    The inbound bandwidth (bit/s) of the ALB instance.

    AliyunAlb_LoadBalancerNewConnection

    The number of new connections per second on the ALB instance.

    AliyunAlb_LoadBalancerNonStickyRequest

    The number of nonsticky requests per second on the ALB instance.

    AliyunAlb_LoadBalancerOutBits

    The outbound bandwidth (bit/s) of the ALB instance.

    AliyunAlb_LoadBalancerQPS

    The number of requests per second on the ALB instance.

    AliyunAlb_LoadBalancerRejectedConnection

    The number of connections dropped per second on the ALB instance.

    AliyunAlb_LoadBalancerUnHealthyHostCount

    The number of unhealthy servers associated with the ALB instance.

    AliyunAlb_LoadBalancerUpstreamConnectionError

    The number of connection failures per second on the backend servers of the ALB instance.

    AliyunAlb_LoadBalancerUpstreamResponseTime

    The response time (milliseconds) of the backend servers of the ALB instance.

    AliyunAlb_LoadBalancerUpstreamTLSNegotiationError

    The number of TLS handshake failures per second on the backend servers of the ALB instance.

    AliyunAlb_RuleHTTPCodeUpstream2XX

    The number of 2xx status codes per second on the backend servers associated with the forwarding rule.

    AliyunAlb_RuleHTTPCodeUpstream3XX

    The number of 3xx status codes per second on the backend servers associated with the forwarding rule.

    AliyunAlb_RuleHTTPCodeUpstream4XX

    The number of 4xx status codes per second on the backend servers associated with the forwarding rule.

    AliyunAlb_RuleHTTPCodeUpstream5XX

    The number of 5xx status codes per second on the backend servers associated with the forwarding rule.

    AliyunAlb_RuleHealthyHostCount

    The number of healthy servers associated with the forwarding rule.

    AliyunAlb_RuleNonStickyRequest

    The number of nonsticky requests per second that match the forwarding rule.

    AliyunAlb_RuleQPS

    The number of requests that match the forwarding rule per second.

    AliyunAlb_RuleUnHealthyHostCount

    The number of unhealthy servers associated with the forwarding rule.

    AliyunAlb_RuleUpstreamConnectionError

    The number of connection failures per second on the backend servers associated with the forwarding rule.

    AliyunAlb_RuleUpstreamResponseTime

    The response time (milliseconds) of the backend servers associated with the forwarding rule.

    AliyunAlb_RuleUpstreamTLSNegotiationError

    The number of TLS handshake failures per second on the backend servers associated with the forwarding rule.

    AliyunAlb_ServerGroupHTTPCodeUpstream2XX

    The number of 2xx status codes returned by the backend server group per second.

    AliyunAlb_ServerGroupHTTPCodeUpstream3XX

    The number of 3xx status codes returned by the backend server group per second.

    AliyunAlb_ServerGroupHTTPCodeUpstream4XX

    The number of 4xx status codes returned by the backend server group per second.

    AliyunAlb_ServerGroupHTTPCodeUpstream5XX

    The number of 5xx status codes returned by the backend server group per second.

    AliyunAlb_ServerGroupHealthyHostCount

    The number of healthy servers in the server group.

    AliyunAlb_ServerGroupNonStickyRequest

    The number of nonsticky requests sent to the server group.

    AliyunAlb_ServerGroupQPS

    The number of requests sent to the server group per second.

    AliyunAlb_ServerGroupUnHealthyHostCount

    The number of unhealthy servers in the server group.

    AliyunAlb_ServerGroupUpstreamConnectionError

    The number of connection failures per second of the server group.

    AliyunAlb_ServerGroupUpstreamResponseTime

    The response time (milliseconds) of the server group.

    AliyunAlb_ServerGroupUpstreamTLSNegotiationError

    The number of TLS handshake failures per second of the server group.

    AliyunAlb_RuleHTTPCodeUpstream2XXRatio

    The percentage of 2xx status codes per second on the backend servers associated with the forwarding rule.

    AliyunAlb_RuleHTTPCodeUpstream3XXRatio

    The percentage of 3xx status codes per second on the backend servers associated with the forwarding rule.

    AliyunAlb_RuleHTTPCodeUpstream4XXRatio

    The percentage of 4xx status codes per second on the backend servers associated with the forwarding rule.

    AliyunAlb_RuleHTTPCodeUpstream5XXRatio

    The percentage of 5xx status codes per second on the backend servers associated with the forwarding rule.

    Note
    • Percentage: 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

  1. 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.

  2. 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.

References