Querying a Tracker¶
Function¶
After CTS is enabled, you can view details about the tracker on the Tracker page. The details include the name of the tracker, name of the OBS bucket for storing traces, and prefix of the trace files stored in the OBS bucket.
URI¶
GET /v3/{project_id}/trackers
Parameter | Mandatory | Type | Description |
---|---|---|---|
project_id | Yes | String | Project ID. For details, see Obtaining an Account ID and Project ID. |
Parameter | Mandatory | Type | Description |
---|---|---|---|
tracker_name | No | String | Tracker name. If this parameter is not specified, all trackers of a tenant will be queried. |
Request Parameters¶
None
Response Parameters¶
Status code: 200
Parameter | Type | Description |
---|---|---|
trackers | Array of TrackerResponseBody objects | List of tracker information. |
Parameter | Type | Description |
---|---|---|
id | String | Unique tracker ID. |
create_time | Long | Timestamp when the tracker was created. |
lts | Lts object | Detail about trace analysis. |
tracker_type | String | Tracker type. The value can be system (management tracker). Enumerated values:
|
domain_id | String | Account ID. For details, see Obtaining an Account ID and Project ID. |
project_id | String | Project ID. |
tracker_name | String | Tracker name. The default value is system. |
status | String | Tracker status. The value can be enabled, disabled, or error. If the value is set to error, the detail field is required for specifying the source of the error. Enumerated values:
|
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. |
obs_info | ObsInfo object | Information about the bucket to which traces are transferred. |
group_id | String | LTS log group ID. |
stream_id | String | LTS log stream ID. |
Parameter | Type | Description |
---|---|---|
is_lts_enabled | Boolean | Specifies whether to enable the LTS search function. |
log_group_name | String | Name of the log group that CTS creates in LTS. |
log_topic_name | String | Specifies the name of the log topic that CTS creates in LTS. |
Parameter | Type | Description |
---|---|---|
bucket_name | String | OBS bucket name. The value contains 3 to 63 characters and must start with a digit or lowercase letter. Only lowercase letters, digits, hyphens (-), and periods (.) are allowed. |
file_prefix_name | String | Prefix of trace files that need to be stored in OBS buckets. The value can contain 0 to 64 characters, including letters, digits, hyphens (-), underscores (_), and periods (.). |
is_obs_created | Boolean | Whether the OBS bucket is automatically created by the tracker. |
compress_type | String | Compression type. The value can be JSON (no compression) or GZIP (compression). The default format is GZIP. Enumerated values:
|
is_sort_by_service | Boolean | Whether to sort the path by cloud service. If this option is enabled, the cloud service name is added to the transfer file path. The default value is true. |
Status code: 400
Parameter | Type | Description |
---|---|---|
error_code | String | Error code. Format: CTS.XXX. |
error_msg | String | Error message. |
Status code: 401
Parameter | Type | Description |
---|---|---|
error_code | String | Error code. Format: CTS.XXX. |
error_msg | String | Error message. |
Status code: 403
Parameter | Type | Description |
---|---|---|
error_code | String | Error code. Format: CTS.XXX. |
error_msg | String | Error message. |
Status code: 500
Parameter | Type | Description |
---|---|---|
error_code | String | Error code. Format: CTS.XXX. |
error_msg | String | Error message. |
Status code: 503
Parameter | Type | Description |
---|---|---|
error_code | String | Error code. Format: CTS.XXX. |
error_msg | String | Error message. |
Example Request¶
GET https://{endpoint}/v3/{project_id}/trackers?tracker_name=system
Example Response¶
Status code: 200
The request is successful.
{
"trackers" : [ {
"create_time" : 1589886034121,
"stream_id" : "4a1ef2b6-d79a-4dc6-90f0-48151cd5491b",
"group_id" : "26fa12ac-75f7-42ed-8118-ab9f2263042f",
"obs_info" : {
"is_obs_created" : false,
"bucket_name" : "",
"is_authorized_bucket" : false,
"file_prefix_name" : "",
},
"lts" : {
"log_group_name" : "CTS",
"is_lts_enabled" : true,
"log_topic_name" : "system-trace"
},
"tracker_type" : "system",
"domain_id" : "2306579dc99f4c8690b14b68e734fcd9",
"project_id" : "24edf66e79d04187acb99a463e610764",
"tracker_name" : "system",
"id" : "ebf8d1c3-762b-4ce3-b316-6b1aa32f8be3",
"status" : "enabled"
}
}
Status Code¶
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 | Failed to complete the request because of an internal service error. |
503 | The requested service is invalid. The client should not repeat the request without modifications. |
Error Code¶
For details, see Error Codes.