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.
- Create log streams for each key ASM component to facilitate query and filtering by component.
- Log in to the LTS console.
- On the Log Management page, click Create Log Group.
- Enter a name (for example, ASM-logs), set the log retention period (recommended: ≥ 7 days), and click OK.
- Click
corresponding to the log group name and click Create Log Stream. For details, see Creating a Log Stream. - 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.
- Configure log collection rules in the AOM Ingestion Center for each component.
- Log in to the LTS console.
- 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.
- Set Collect to Custom log stream and perform the following steps:
- Choose a cluster from the CCE Cluster drop-down list.
- 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.
- 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.
- Click Next: Check Dependencies.
- Click Auto Correct.

- Select a host group.
- 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.
- Repeat steps 2 through 7 for each key component to ensure all logs are routed to the appropriate streams.
- Verify log collection.
- Log in to the LTS console.
- Select the log group and stream created in step 1 (for example, ASM-logs > istiod).
- Verify that component logs are displayed. If logs appear, the log collection configuration is successful.
- 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.
- (Optional) Configure log alarm rules in LTS to receive timely notifications when errors appear in logs.
- Log in to the LTS console.
- In the navigation pane, choose Log Alarms. On the displayed page, click the Alarm Rules tab.
- Click Create to configure an alarm rule for logs of key components. For details, see Configuring an Alarm Rule.
- Click Confirm. The log alarm rule is created.
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot
