Help Center/ Application Service Mesh/ User Guide/ Using LTS to Collect ASM Logs
Updated on 2026-11-12 GMT+08:00

Using LTS to Collect ASM Logs

Scenarios

Key components of Application Service Mesh (ASM), including istiod, istio-ingressgateway, istio-egressgateway, sidecar, and istio-operator, output logs to stdout by default. These logs are not persistently stored. They are lost when pods restart or are evicted, preventing post-incident troubleshooting.

This section describes how to configure Log Tank Service (LTS) to collect logs from key ASM components for persistent storage, facilitating fault locating and analysis. You can also configure log alarm rules to receive notifications when errors are detected.

Constraints

Prerequisites

  • An ASM mesh has been created and is in the Running state.
  • LTS has been enabled.
  • kubectl is installed and cluster access is configured.

Procedure

Configure parameters by referring to Ingesting CCE Application Logs to LTS.

  1. Create log streams for each key ASM component to facilitate query and filtering by component.

    1. Log in to the LTS console.
    2. On the Log Management page, click Create Log Group.
    3. Enter a name (for example, ASM-logs), set the log retention period (recommended: ≥ 7 days), and click OK.
    4. Click corresponding to the log group name and click Create Log Stream. For details, see Creating a Log Stream.
    5. Create a log stream for each key component.
      Table 1 Log stream configuration

      Log Stream Name

      Description

      istiod

      Control plane component stdout logs, including configuration delivery, service discovery, and certificate management records.

      istio-ingressgateway

      Ingress gateway stdout logs, including external request access and forwarding records.

      istio-egressgateway

      Egress gateway stdout logs, including records of mesh services accessing external networks.

      <service>-sidecar

      Sidecar proxy stdout logs for a specific service, including traffic forwarding and metrics collection records.

      istio-operator

      stdout logs for the control plane component operator, including operation records for IstioOperator CR updates. This component is only involved in v1.18 and earlier versions.

  2. Configure log collection rules in the AOM Ingestion Center for each component.

    1. Log in to the LTS console.
    2. In the navigation pane, choose Log Ingestion > Ingestion Center. Under Types, select Running environments or Cloud services. Hover over the Cloud Container Engine (CCE) card and click Ingest Log (LTS) to access the configuration page.
    3. Set Collect to Custom log stream and perform the following steps:
      1. Choose a cluster from the CCE Cluster drop-down list.
      2. Choose a log group from the Log Group drop-down list. If there are no desired log groups, click Create Log Group to create one.
      3. Choose a log stream from the Log Stream drop-down list. If there are no desired log streams, click Create Log Stream to create one.
      4. Click Next: Check Dependencies.
    4. Click Auto Correct.

    5. Select a host group.

    6. Enter a configuration name, specify the pod regular expression for matching, and click Next: Index Settings.

      The following table lists the parameters for each key component.

      Table 2 Configuration parameters of key components

      Component

      Configuration Name (Example)

      Pod Regular Expression

      Container Name

      Namespace

      istiod

      asm-istiod-log-collection

      istiod-.*

      discovery

      istio-system

      istio-ingressgateway

      asm-ingressgateway-log-collection

      istio-ingressgateway-.*

      istio-proxy

      istio-system

      istio-egressgateway

      asm-egressgateway-log-collection

      istio-egressgateway-.*

      istio-proxy

      istio-system

      Sidecar of Service A

      asm-Service A-sidecar-log-collection

      Regular expression matching Service A's pods

      istio-proxy

      Service namespace

      istio-operator

      asm-istio-operator-log-collection

      istio-operator-.*

      istio-operator

      istio-operator

      • Configuration names are customizable. Use the format asm-<component-name>-log-collection for easy identification and management.
      • Set the pod regular expression based on actual pod names. The preceding regular expressions are examples only. A pod name typically follows the format <component-name>-<random-string>. Adjust the regular expression according to pod names in your cluster. Run kubectl get pods -n istio-system to view actual pod names.
      • For Service A's sidecar, specify a regular expression that matches the Service's pod names, not the Istio component name. The container name is fixed as istio-proxy.
      • To collect sidecar logs from multiple Services, configure multiple collection rules in the same namespace or use wildcards in the pod regular expression to match multiple pods.
    7. Repeat steps 2 through 7 for each key component to ensure all logs are routed to the appropriate streams.

  3. Verify log collection.

    1. Log in to the LTS console.
    2. Select the log group and stream created in step 1 (for example, ASM-logs > istiod).
    3. Verify that component logs are displayed. If logs appear, the log collection configuration is successful.
    4. If no logs appear, check whether the component is generating output. Run kubectl logs -n istio-system <pod_name> in the cluster to view the stdout logs of the component.

  4. (Optional) Configure log alarm rules in LTS to receive timely notifications when errors appear in logs.

    1. Log in to the LTS console.
    2. In the navigation pane, choose Log Alarms. On the displayed page, click the Alarm Rules tab.
    3. Click Create to configure an alarm rule for logs of key components. For details, see Configuring an Alarm Rule.
    4. Click Confirm. The log alarm rule is created.