Help Center/ Cloud Trace Service/ User Guide/ Traces/ Querying Transferred Traces
Updated on 2025-09-09 GMT+08:00

Querying Transferred Traces

Scenarios

CTS periodically sends trace files to OBS buckets. A trace file is a collection of traces. CTS generates trace files based on services and transfer cycle, and adjusts the number of traces contained in each trace file as needed. CTS can also save audit logs to LTS log streams.

This section describes how to view historical operation records in trace files downloaded from OBS buckets and in LTS log streams.

Constraints

For global services, you must configure trackers on the CTS console in the central region (CN-Hong Kong). This configuration enables the function of transferring traces to OBS or LTS. This function will not take effect if you perform the configuration on the CTS console in any other regions.

For details about Huawei Cloud global services, see Notes and Constraints.

Prerequisites

You have configured a tracker in CTS and enabled Transfer to OBS or Transfer to LTS. For details about how to configure transfer, see Configuring a Tracker.

Querying Traces Transferred to OBS

If you enable Transfer to OBS when configuring the tracker, traces will be periodically transferred to a specified OBS bucket as trace files for long-term storage.

  1. Log in to the management console.
  2. Click in the upper left corner and choose Management & Governance > Cloud Trace Service. The CTS console is displayed.
  3. Choose Tracker List in the navigation pane.
  4. Click a bucket in the OBS Bucket column.
    Figure 1 Selecting an OBS bucket

  5. In the OBS bucket, locate the file storage path to view the desired trace, and click Download on the right to download the file to the default download path of the browser. If you need to save it to a custom path, click More > Download As on the right.
    • The trace file storage path is as follows:

      OBS bucket name/CloudTraces/Region/Year/Month/Day/Tracker name/Cloud service

      Example: User Define/CloudTraces/ap-southeast-1/2016/5/19/system/ECS

    • The trace file naming format is as follows:

      Trace file prefix_CloudTrace_Region_Year-Month-DayTHour-Minute-SecondZ_Random characters.json.gz (Year-Month-DayTHour-Minute-Second indicates the time when the trace file was uploaded to OBS.)

      Example: FilePrefix_CloudTrace_ap-southeast-1_2024-12-13T01-29-19Z_47b9d51830deff47.json.gz

    • The OBS bucket name and trace file prefix are set by you and other parameters are automatically generated.
    • File download will incur request fees and traffic fees.
    • If you disable Sort by Cloud Service when configuring a tracker to transfer traces to OBS, the cloud service will not be displayed in the transfer path. Example: User Define/CloudTraces/Region/2016/5/19/system

    For details about key fields in a trace, see Trace Structure and Example Traces.

    Figure 2 Viewing trace file content

  6. Decompress the downloaded package to obtain a JSON file with the same name as the package, as shown in Figure 3. Open the JSON file using a text file editor to view traces.
    Figure 3 JSON file

Querying Traces Transferred to LTS

If you enable Transfer to LTS when configuring a tracker, traces will be transferred to the CTS/{Tracker Name} log stream for long-term storage. {Tracker Name} indicates the name of the current tracker. For example, the log stream path of the management tracker is CTS/system-trace.

  1. Log in to the management console.
  2. Click in the upper left corner and choose Management & Governance > Cloud Trace Service. The CTS console is displayed.
  3. Choose Tracker List in the navigation pane.
  4. Click an LTS log stream in the Storage column.

    Figure 4 Selecting an LTS log stream

  5. On the Log Stream tab page in the CTS log group page, select the {Tracker name} log stream to view trace logs.

    For details about key fields in a trace, see Trace Structure and Example Traces.

  6. Click to download the log file to your local PC.