This topic describes how to use CloudLens for SLS to observe Log Service.

Prerequisites

A project and a Logstore are created. For more information, see Create a project and Create a Logstore.

Background information

Log Service provides the CloudLens for SLS application to monitor and manage assets such as projects and Logstores. This way, you can manage the assets with higher efficiency. For example, you can view the data provided by the application to check the consumption of your assets. For more information, see Usage notes.

This topic describes how to use CloudLens for SLS to monitor whether project quotas are exceeded.

Step 1: Enable the collection of detailed logs and audit logs

  1. Log on to the Log Service console.
  2. In the Log Application section, click the Cloud Service Lens tab. Then, click CloudLens for SLS.
  3. In the left-side navigation pane, click Access Management.
  4. Enable the collection of detailed logs.
    1. On the Instance Logs subtab of the SLS Cluster Access tab, find the project and click Enable in the Detail Logs column.
    2. In the Enable Detailed Logs Collect dialog box, select the project and click Confirm.
  5. Enable the collection of audit logs.
    1. On the Global Logs subtab of the SLS Cluster Access tab, find Audit Logs and click Enable in the Actions column.
    2. In the Enable Audit Logs Collect dialog box, select the project and the region, and click Confirm.

Step 2: View monitoring data

After you enable the collection of detailed logs and audit logs, Log Service generates a dashboard for collected logs. You can check whether project quotas are exceeded on the Quota Monitoring dashboard.

  1. In the left-side navigation pane, choose Report Center > Quota Monitoring.
  2. Check whether the project quotas are exceeded.

    You can view the monitoring data of the following quota types: Logstore quota, Dashboard quota, shard quota, alert quota, machine group quota, and Logtail configuration quota.

    Quota monitoring
    To view the quotas of a project, go to the Asset Overview page, find the project on the ProjectAsset Overview tab, and then click Details in the Quota column. Project Quota

Step 3: Configure alerting

If you want to receive notifications at the earliest opportunity whenever project quotas are exceeded, you can configure alerting for the project quotas.

  1. In the left-side navigation pane, click Alert Management.
  2. Configure a built-in action policy for CloudLens for SLS.
    1. On the Alert Center page, choose Alert Management > Action Policy.
    2. Find SLS Lens Built-in Action Policy and click Edit in the Actions column.
    3. In the Edit Action Policy dialog box, configure the action policy and click OK.
      Set the Notification Method parameter to SMS Message and the Recipient parameter to the user to whom you want to send notifications. For more information, see Notification methods
  3. Enable the alert rule of project quotas.
    1. Click the Alert Rules/Incidents tab.
    2. In the Monitoring Rule list, find Project Quota Exceed and click Settings in the Actions column.
    3. In the Parameter Settings dialog box, configure the parameters and click Save and Enable.
    If the number of times that the project quotas are exceeded exceeds the specified threshold values, the following text message is sent:
    [Alibaba Cloud] Log Service alert: One alert in total. Details: Alibaba Cloud account: 165*******3050
    Title: Excessive occurrences of exceeded project quotas
    Content: In the past 1 minute, the project quotas of Project **** are exceeded three times, which has exceeded the specified threshold values. Check whether errors occurred.
    Severity: High