Updated on 2022-02-21 GMT+08:00

Query Tracing Details

Function

This API is used to query tracing details based on trace IDs.

URI

GET /v1/{projectId}/ats/spans

Request

Path parameters

Table 1 describes the path parameter.

Table 1 Path parameter

Parameter

Type

Description

projectId

String

Project ID.

Request parameters

Table 2 describes the request parameter.

Table 2 Request parameter

Parameter

Mandatory

Type

Value Range

Description

traceId

Yes

String

Obtained from tracing data.

Trace ID.

Example request

/v1/0/ats/spans?traceId=0000000027046b00

Response

Response parameters

Table 3 describes the response parameters.

Table 3 Response parameters

Parameter

Type

Description

errorCode

String

Error code.

SVCSTG.ATS.2000: Query succeeded.

SVCSTG.ATS.400101: Parameter verification failed.

SVCSTG.ATS.200103: No tracing data found.

errorMessage

String

Error message.

responseInfo

List (string). See Table 4.

Tracing query result.

Table 4 spans parameters

Parameter

Type

Description

traceId

String

Trace ID, which is globally unique.

name

String

Service name: Instance name: Transaction name

id

String

Span ID

parentId

String

Upper-level span ID.

timestamp

Integer

Call start time (unit: μs).

duration

Integer

Span call duration (unit: μs).

annotations

List (string). See Table 5.

Service information about the client or server.

binaryAnnotations

List (string). See Table 6.

Extended information.

Table 5 Annotation parameters

Parameter

Type

Description

timestamp

Integer

Current system time when an event occurs (unit: μs).

endpoint

See Table 7.

(Optional) Service information about the client.

value

String

Event type. Value: CS, SR, SS, or CR. CS: The client sends an event. CR: The client receives an event. SR: The server receives an event. SS: The server sends an event.

Table 6 BinarryAnnotation parameters

Parameter

Type

Description

key

String

Name of the extended information.

endpoint

See Table 7.

(Optional) Service information about the client.

value

String

Value of the extended information.

Table 7 endpoint parameters

Parameter

Type

Description

serviceName

String

(Optional) Service name of the client.

ipv4

String

(Optional) IP address of the client.

port

String

(Optional) Port of the client.

Example response

{
  "errorCode": "SVCSTG.ATS.2000",
  "errorMessage":null,
  "responseInfo": [
    "{\"traceId\":\"0000000027046b00\",\"id\":\"b42460f5cf86cab4\",\"name\":\"aos-apiserver:aos-apiserver-1005774711-ll63p:/api/v1/namespaces/manage/pods\",\"timestamp\":1506260836597000,\"duration\":67000,\"annotations\":[{\"timestamp\":1506260836597000,\"value\":\"cs\",\"endpoint\":{\"serviceName\":\"aos-apiserver\",\"ipv4\":\"10.186.60.43\",\"port\":6443}},{\"timestamp\":1506260836664000,\"value\":\"cr\",\"endpoint\":{\"serviceName\":\"aos-apiserver\",\"ipv4\":\"10.186.60.43\",\"port\":6443}}],\"binaryAnnotations\":[{\"key\":\"append\",\"value\":\"GET\"},{\"key\":\"async\",\"value\":\"0\"},{\"key\":\"goid\",\"value\":\"58\"},{\"key\":\"result\",\"value\":\"0\"},{\"key\":\"resultCode\",\"value\":\"200\"},{\"key\":\"seqno\",\"value\":\"1506260836597048618\"},{\"key\":\"type\",\"value\":\"1\"}]}"
  ]
}

Status Code

  • Success response
    Table 8 describes the status code.
    Table 8 Status code

    Status Code

    Description

    200

    The request has succeeded.