Updated on 2024-11-19 GMT+08:00

Configuring a Tracker

Scenario

You can configure key event notifications of trackers on the CTS console no matter whether the trackers are enabled or not. For enabled trackers, you can also configure Transfer to OBS or Transfer to LTS for trace transfer.

  • You can select an existing OBS bucket for trace transfer. CTS will automatically attach a required policy to the OBS bucket.
  • If you modify the trace file prefix of a tracker, the OBS bucket policy will not be affected.

There are three storage classes of OBS buckets: Standard, Infrequent Access, and Archive. You must use Standard OBS buckets for trace transfer because CTS needs to frequently access the OBS buckets.

The configuration will take effect immediately after it is complete.

This section describes how to configure a data tracker.

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. The preceding function will not take effect if you perform the configuration on the CTS console in any region outside the central region.

For details about Huawei Cloud global services, see Constraints.

Prerequisites

You have enabled CTS and created a data tracker.

Configuring a Data Tracker

  1. Log in to the management console.
  2. Click in the upper left corner to select the desired region and project.
  3. Click in the upper left corner and choose Management & Governance > Cloud Trace Service. The CTS console is displayed.
  4. Choose Tracker List in the navigation pane.
  5. Click Configure in the Operation column in the row of the target data tracker.

    Figure 1 Configuring a tracker

  6. On the Configure Transfer page, modify the transfer parameters of the tracker. When you configure a data tracker, the OBS bucket name of the data trace source is set as OBS Bucket by default and cannot be modified. You can query operation records of the last seven days on the CTS console. To store and query operation records beyond seven days, transfer them to OBS or LTS. For details, see Table 1 and Table 2.

    Table 1 Parameters for configuring the transfer to OBS

    Parameter

    Description

    Transfer to OBS

    If you select Yes, select an existing OBS bucket or create one on the Configure Tracker page and set File Prefix.

    When Transfer to OBS is disabled, no operation is required.

    Create a cloud service agency.

    (Mandatory) If you select this check box, CTS automatically creates a cloud service agency when you create a tracker. The agency authorizes you to use OBS.

    OBS Bucket

    New: An OBS bucket will be created automatically with the name you enter.

    Existing: Select an existing OBS bucket.

    Select Bucket

    When you select New, enter an OBS bucket name. The OBS bucket name cannot be empty. It can contain 3 to 63 characters, including only lowercase letters, digits, hyphens (-), and periods (.). It cannot contain two consecutive periods (for example, my..bucket). A period (.) and a hyphen (-) cannot be adjacent to each other (for example, my-.bucket and my.-bucket). Do not use an IP address as a bucket name.

    When you select Existing, select an existing OBS bucket.

    Retention Period

    The duration for storing traces in the OBS bucket. This configuration will apply to the selected bucket and all files in it. Different compliance standards require different trace retention periods. You are advised to set the retention period to at least 180 days.
    • For a data tracker, you can set the duration to 30 days, 60 days, 90 days, 180 days, 3 years, or the same as that of OBS.

    File Prefix

    A file prefix is used to mark transferred trace files. The prefix you set will be automatically added to the beginning of the file names, facilitating file filtering. Enter 0 to 64 characters. Only letters, digits, underscores (_), hyphens (-), and periods (.) are allowed.

    Compression

    The space object storage can be reduced.
    • No: Transfer files in the *.json format.
    • gzip: Transfer files in *.json.gz format.

    Sort by Cloud Service

    • When this function is enabled, the cloud service name is added to the transfer file path, and multiple small files are generated in OBS. Example: /CloutTrace/cn-north-7/2022/11/8/doctest/Cloud service/_XXX.json.gz
    • When this function is disabled, the cloud service name will not be added to the transfer file path. Example: /CloutTrace/cn-north-7/2022/11/8/doctest/_XXX.json.gz

    Log Transfer Path

    Log transfer path is automatically set by the system.

    Verify Trace File

    When this function is enabled, integrity verification will be performed to check whether trace files in OBS buckets have been tampered with. For details about file integrity verification, see Verifying Trace File Integrity.

    Table 2 Parameters for configuring the transfer to LTS

    Parameter

    Description

    Transfer to LTS

    When Transfer to LTS is enabled, traces are transferred to the log stream.

    Log group name

    When Transfer to LTS is enabled, the default log group name CTS is set. When Transfer to LTS is disabled, no operation is required.

  7. Click Next > Configure to complete the configuration of the data tracker.

    You can then view the tracker details on the Tracker List page.

    Traces recorded by CTS are delivered periodically to the OBS bucket for storage. If you configure an OBS bucket for a tracker, traces generated during the current cycle (usually several minutes) will be delivered to the configured OBS bucket. For example, if the current cycle is from 12:00:00 to 12:05:00 and you configure an OBS bucket for a tracker at 12:02:00, traces received from 12:00:00 to 12:02:00 will also be delivered to the configured OBS bucket for storage at 12:05:00.

  8. (Optional) On the Tracker List page, click in the Tag column to add tags to the tracker.

    Figure 2 Adding a tag

    Tags are key-value pairs, which are used to identify, classify, and search for trackers. Tracker tags are used to filter and manage trackers only. A maximum of 20 tags can be added to a tracker.

    If your organization has configured tag policies for CTS, add tags to trackers based on the policies. For details about tag policies, see Overview of a Tag Policy. For details about tag management, see Overview of a Tag.
    Table 3 Tag parameters

    Parameter

    Description

    Example

    Tag key

    A tag key of a tracker must be unique. You can customize a key or select the key of an existing tag created in Tag Management Service (TMS).

    A tag key:

    • Can contain 1 to 128 characters.
    • Can contain letters, digits, spaces, and special characters _.:=+-@, but cannot start or end with a space or start with _sys_.

    Key_0001

    Tag value

    A tag value can be repetitive or left blank.

    A tag value:

    • Can contain 0 to 255 characters.
    • Can contain letters, digits, spaces, and special characters _.:/=+-@

    Value_0001