All Products
Search
Document Center

Simple Log Service:Enable the Layer 4 monitoring feature

Last Updated:Oct 30, 2023

This topic describes how to enable the Layer 4 monitoring feature for a Server Load Balancer (SLB) instance in the SLB console. After you enable the feature, Layer 4 monitoring metrics are sent to Simple Log Service. The monitoring metrics are accurate to seconds.

Prerequisites

  • An SLB instance is created. For more information, see Create a CLB instance.

  • A TCP or UDP listener is configured for the SLB instance. For more information, see Add a TCP listener and Add a UDP listener.

  • A Simple Log Service project and a Metricstore are created in the region where the SLB instance resides. For more information, see Create a project and Create a Metricstore.

    Important

    The name of a Metricstore in a project must be different from the name of an existing Logstore in the project.

Procedure

Important

Before you can use a RAM user to enable the Layer 4 monitoring feature, you must grant the required permissions to the RAM user. For more information, see RAM user authorization.

  1. Log on to the SLB console.

  2. In the left-side navigation pane, choose CLB (FKA SLB) > Instances.

  3. On the Instances page, click the ID of the SLB instance.

  4. Click the Fine-grained Monitoring tab.

  5. Enable the Layer 4 monitoring feature in the current region.

    If the feature is already enabled in the current region, skip this step.

    1. Click Enable Fine-grained Monitoring.

    2. In the Enable Fine-grained Monitoring for SLB dialog box, select the project and Metricstore that you created, select I understand the above information, and then click OK.

      When you perform this operation, the system automatically creates a RAM role named AliyunServiceRoleForSlbLogDelivery. SLB can assume this role to deliver Layer 4 monitoring metrics to Simple Log Service.

      Warning

      Do not revoke permissions from the AliyunServiceRoleForSlbLogDelivery role or delete the role. Otherwise, logs cannot be sent to Simple Log Service.

  6. Enable the Layer 4 monitoring feature for the TCP or UDP listener.

    1. Click Settings.

    2. On the Settings tab, turn on Fine-grained Monitoring for the TCP or UDP listener.

What to do next

After Simple Log Service collects Layer 4 monitoring metrics for the specified SLB instance, you can query, analyze, download, ship, and transform the metrics in the Simple Log Service console. You can also configure alert rules for the metrics. For more information, see Common operations on logs of Alibaba Cloud services.