Updated on 2023-08-02 GMT+08:00

Querying the Trace Topology

Function

This API is used to query the trace topology.

URI

GET /v1/apm2/openapi/view/trace/topology

Table 1 Query Parameters

Parameter

Mandatory

Type

Description

trace_id

Yes

String

Trace ID.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token obtained from IAM.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

global_trace_id

String

Global trace ID.

line_list

Array of TraceTopologyLine objects

List of lines that indicate invocations between components.

node_list

Array of TraceTopologyNode objects

List of component nodes.

Table 4 TraceTopologyLine

Parameter

Type

Description

start_node_id

Long

Start node ID.

end_node_id

Long

End node ID.

span_id

String

Span ID.

client_info

TraceTopologyLineInfo object

Information displayed on the client.

server_info

TraceTopologyLineInfo object

Server information.

id

String

ID.

hint

String

Line prompt.

Table 5 TraceTopologyLineInfo

Parameter

Type

Description

start_time

Long

Start time.

time_used

Long

Time required.

argument

String

Parameters, such as the invoked URL.

event_id

String

ID of an event.

Table 6 TraceTopologyNode

Parameter

Type

Description

node_id

Long

Node ID.

node_name

String

Node name.

hint

String

Node prompt.

Example Requests

Query the topology of trace 16-1666684411910-1326.

/v1/apm2/openapi/view/trace/topology?trace_id=16-1666684411910-1326

Example Responses

Status code: 200

OK: The request is successful.

{
  "node_list" : [ {
    "node_id" : 11,
    "node_name" : "apm-pu-task:suzhou-roma-2",
    "hint" : null
  } ],
  "line_list" : [ {
    "start_node_id" : null,
    "end_node_id" : 11,
    "span_id" : "1",
    "client_info" : null,
    "server_info" : {
      "start_time" : 1666684411910,
      "time_used" : 1,
      "argument" : "(GET)(/apm2/health/v1/health-check)(200)",
      "event_id" : "1"
    },
    "hint" : "(1)((GET)(/apm2/health/v1/health-check)(200))",
    "id" : "1+1"
  } ],
  "global_trace_id" : null
}

Status Codes

Status Code

Description

200

OK: The request is successful.

401

Unauthorized: No permissions.

403

Forbidden: Access forbidden.

404

Not Found: The requested resource is not found.

Error Codes

See Error Codes.