Integrate NLB with Managed Service for Prometheus

Updated at:

This topic describes how to use Managed Service for Prometheus to monitor your Network Load Balancer (NLB) instances by viewing metrics, dashboards, and alerts.

Overview

Managed Service for Prometheus is compatible with the open-source Prometheus ecosystem. It supports monitoring for various components, provides multiple ready-to-use dashboards, and offers a fully managed Prometheus service. For more information, see What is Managed Service for Prometheus?.

You can integrate NLB with Managed Service for Prometheus by using the paid Hybrid Cloud Monitoring feature. For more information, see the following table.

Integration type

Description

Metric fees

Storage fees

Hybrid Cloud Monitoring (paid)

Managed Service for Prometheus calls the CloudMonitor API to obtain monitoring metrics. After you integrate NLB with Managed Service for Prometheus, you can use cloud service dashboards and alert rules to monitor your NLB service and configure alerts.

CloudMonitor charges data transfer fees when NLB metrics are reported.

For more information about billing, see Real-time data exporting.

Managed Service for Prometheus stores the reported metrics free of charge.

Prerequisites

Create a Prometheus instance

  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 click Create Now.

    Parameter

    Description

    Instance Type

    Select general-purpose instance or global aggregation instance. This topic uses general-purpose instance as an example.

    Note
    • General-purpose instance: a standard Prometheus instance suitable for various scenarios. You can use it for remote write storage with self-managed Prometheus or to collect metrics from containers, cloud services, and hosts.

    • Global aggregation instance: a virtual instance that aggregates data from multiple Managed Service for Prometheus instances. You can use a global aggregation instance for unified metric queries, a unified Grafana data source, and unified alerting across all associated instances.

    Storage duration

    Select a storage duration. The supported options are 15 Days, 30 Days, 60 Days, 90 Days, and 180 Days.

Integrate NLB with Managed Service for Prometheus

  1. Log on to the ARMS console.

  2. In the navigation pane on the left, click Integration Center.

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

  4. In the Alibaba Cloud NLB panel, select the destination region for your data and click OK. The integration takes about one to two minutes to complete.

  • Metrics

    You can view the monitoring metrics for NLB on the Collect Metrics tab.

    NLB metrics supported by Managed Service for Prometheus

    Metric

    Description

    AliyunNlb_ActiveConnection

    Active connections per second for the listener.

    AliyunNlb_DropConnection

    Dropped connections per second for the listener.

    AliyunNlb_DropPacketRX

    Dropped inbound packets per second for the listener.

    AliyunNlb_DropPacketTX

    Dropped outbound packets per second for the listener.

    AliyunNlb_DropTrafficRX

    Dropped inbound traffic in bits per second for the listener.

    AliyunNlb_DropTrafficTX

    Dropped outbound traffic in bits per second for the listener.

    AliyunNlb_InactiveConnection

    Inactive connections per second for the listener.

    AliyunNlb_InstanceActiveConnection

    Active connections per second for the instance.

    AliyunNlb_InstanceDropConnection

    Dropped connections per second for the instance.

    AliyunNlb_InstanceDropPacketRX

    Dropped inbound packets per second for the instance.

    AliyunNlb_InstanceDropPacketTX

    Dropped outbound packets per second for the instance.

    AliyunNlb_InstanceDropTrafficRX

    Dropped inbound traffic in bits per second for the instance.

    AliyunNlb_InstanceDropTrafficTX

    Dropped outbound traffic in bits per second for the instance.

    AliyunNlb_InstanceInactiveConnection

    Inactive connections per second for the instance.

    AliyunNlb_InstanceMaxConnection

    Maximum concurrent connections per second for the instance.

    AliyunNlb_InstanceNewConnection

    New connections per second for the instance.

    AliyunNlb_InstancePacketRX

    Inbound packets per second for the instance.

    AliyunNlb_InstancePacketTX

    Outbound packets per second for the instance.

    AliyunNlb_InstanceTrafficRX

    Inbound traffic in bits per second for the instance.

    AliyunNlb_InstanceTrafficTX

    Outbound traffic in bits per second for the instance.

    AliyunNlb_InstanceUnhealthyServerCount

    Number of unhealthy backend ECS instances as determined by health checks on the instance.

    AliyunNlb_ListenerHeathyServerCount

    Number of healthy backend ECS instances as determined by health checks on the listener.

    AliyunNlb_ListenerPacketRX

    Inbound packets per second for the listener.

    AliyunNlb_ListenerPacketTX

    Outbound packets per second for the listener.

    AliyunNlb_ListenerUnhealthyServerCount

    Number of unhealthy backend ECS instances as determined by health checks on the listener.

    AliyunNlb_MaxConnection

    Maximum concurrent connections per second for the listener.

    AliyunNlb_NewConnection

    New connections per second for the listener.

    AliyunNlb_NlbInstanceHeathyServerCount

    Number of healthy backends for the NLB instance.

    AliyunNlb_TrafficRXNew

    Inbound traffic in bits per second for the listener.

    AliyunNlb_TrafficTXNew

    Outbound traffic in bits per second for the listener.

  • Alerts

    On the Alert Rule Templates tab, you can create Prometheus alert rules and view alert information. For more information about how to create alert rules, see Create Prometheus alert rules.

  • Dashboards

    On the Start Integration tab, click Integration Management. Then, navigate to Component Management > Dashboards and click NLB to view the performance metrics of your NLB instance.

Use third-party Prometheus libraries

After integrating NLB with Managed Service for Prometheus, you can use the remote write feature to send data to your self-managed Prometheus. For more information, see Create a general-purpose Prometheus instance.

Stop monitoring an NLB instance

  1. Log on to the Cloud Monitor console.

  2. On the Instances page, select the target region in the top navigation bar. In the row for the target instance, click Delete in the Actions column.

  3. In the dialog box that appears, click OK.

Related topics