Updated on 2023-09-28 GMT+08:00

Querying a Tracker

Function

This API is used to query details about a tracker. The detailed information includes the name of the tracker, name of the OBS bucket for storing traces, and file name prefix of the traces files stored in the OBS bucket.

URI

GET /v1.0/{project_id}/tracker

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Identifies a project. For details, see section "Obtaining the Account ID and Project ID" in Cloud Trace Service API Reference.

Table 2 Query parameters

Parameter

Mandatory

Type

Description

tracker_name

Yes

String

Indicates the tracker name. If this parameter is not specified, all trackers in your account will be queried. Currently, only one management tracker is available for one account and the tracker name is system.

Request Parameters

None

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

id

String

Uniquely identifies a tracker.

create_time

Long

Indicates the timestamp when the tracker was created.

domain_id

String

Identifies an account. For details, see section "Obtaining the Account ID and Project ID" in Cloud Trace Service API Reference.

project_id

String

Identifies a project.

tracker_name

String

Indicates the tracker name. The value is system.

tracker_type

String

Indicates the tracker type.

bucket_name

String

Indicate the name of an OBS bucket. A name contains 3 to 63 characters and must start with a number or lowercase letter. Only lowercase letters, numbers, hyphens (-), and periods (.) are allowed.

file_prefix_name

String

Indicates a file name prefix to mark trace files that need to be stored in an OBS bucket.

status

String

Indicates the status of a tracker. The value can be enabled, disabled, or error. If the value is error, the detail field is required for specifying the source of the error.

Enumeration values:

  • enabled

  • disabled

detail

String

This parameter is returned only when the tracker status is error. It indicates the cause of the abnormal status, and its value can be bucketPolicyError, noBucket, or arrears.

is_obs_created

Boolean

Indicates whether to create an OBS bucket. When the value is true, you can create an OBS bucket to store trace files. When the value is false, you can select an existing OBS bucket to store trace files. A bucket name contains 3 to 63 characters and can consist of lowercase letters, numbers, a period (.) and a hyphen (-).

is_support_trace_files_encryption

Boolean

Indicates whether trace files are encrypted during transfer to an OBS bucket. This parameter must be used together with kms_id.

kms_id

String

Identifies a key used for trace file encryption. The key ID is obtained from Key Management Service (KMS). It is mandatory when is_support_trace_files_encryption is set to true.

group_id

String

Identifies a log group.

stream_id

String

Identifies a log stream.

lts

Lts object

Indicates detail about trace analysis.

is_support_validate

Boolean

Indicates whether trace file verification is enabled.

Table 4 Lts

Parameter

Type

Description

is_lts_enabled

Boolean

Indicates whether traces are synchronized to LTS for trace analysis.

log_group_name

String

Indicates the name of the log group that CTS creates in LTS.

log_topic_name

String

Indicates the name of the log stream that CTS creates in LTS.

Example Requests

GET https://{endpoint}/v1.0/{project_id}/tracker?tracker_name=system

Example Responses

Status code: 200

The request is successful.

{
  "id" : "2e6fa9b8-8c6e-456d-b5d3-77be972d220b",
  "create_time" : 1587958482923,
  "domain_id" : "aexxxxxxxx4d4fb4bexxxxxxx791fbf",
  "is_support_trace_files_encryption" : true,
  "kms_id" : "13a4207c-7abe-4b68-8510-16b84c3b5504",
  "bucket_name" : "obs-f1da",
  "file_prefix_name" : "yO8Q",
  "project_id" : "bb1xxxxxxxxe4f498cbxxxxxxxx35634",
  "lts" : {
    "is_lts_enabled" : true,
    "log_group_name" : "CTS",
    "log_topic_name" : "system-trace"
  },
  "log_file_validate" : {
    "is_support_validate" : true
  },
  "tracker_name" : "system",
  "tracker_type" : "system",
  "status" : "enabled"
}

Status Codes

Status Code

Description

200

The request is successful.

400

The server failed to process the request.

401

The request is rejected due to authentication failure.

403

The server understood the request but refused to authorize it.

500

The server has received the request but encountered an internal error.

Error Codes

See Error Codes.