Updated on 2022-06-20 GMT+08:00

Querying Tracing Details

Function

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

URI

GET /v1/{project_id}/ats/spans

Request

Table 1 Request headers

Parameter

Description

Mandatory

Example

clusterId

Cluster ID.

No

default

namespace

Namespace.

No

manage

Table 2 Path parameter

Parameter

Type

Description

project_id

String

Project ID.

Table 3 Request parameter

Parameter

Mandatory

Type

Value Range

Description

traceId

Yes

String

Trace ID obtained from the tracing data

Trace ID.

Example request

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

Response

Table 4 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

Description of the error.

responseInfo

List (string). For details, see Table 5.

Tracing query result.

Table 5 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

Long

Call start time (unit: μs).

duration

Long

Span call duration (unit: μs).

annotations

List (string). For details, see Table 6.

Service information about the client or server.

binaryAnnotations

List (string). For details, see Table 7.

Extended information.

Table 6 Annotation parameters

Parameter

Type

Description

timestamp

Long

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

endpoint

See Table 8.

(Optional) Service information about the client.

value

String

Invocation event type. Options:

  • CS: The client sends a request.
  • CR: The client receives a request.
  • SR: The server receives a request.
  • SS: The server sends a request.
Table 7 BinarryAnnotation parameters

Parameter

Type

Description

key

String

Name of the extended information.

endpoint

See Table 8.

(Optional) Service information about the client.

value

String

Value of the extended information.

Table 8 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 9 describes the status code.
    Table 9 Status code

    Status Code

    Description

    200

    The request is successful.