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

Querying Tracing Data

Function

This API is used to query tracing data based on filter criteria.

URI

GET /v1/{projectId}/ats/traces

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 parameters.

Table 2 Request parameters

Parameter

Mandatory

Type

Value Range

Description

startTime

Yes

Integer

<endTime

Start time for querying tracing data (unit: ms).

endTime

Yes

Integer

>startTime

End time for querying tracing data (unit: ms).

application

Yes

String

See Querying a Service List.

Service name,

which must consist of lowercase letters. Example: test-service.

monitorGroup

No

String

See Querying an Application List.

Application name.

instance

No

String

See Querying a Service Instance List.

Instance name,

which must consist of lowercase letters. Example: test-service-4195149926-0fvhn.

transaction

No

String

See Querying a Service Transaction List.

Transaction name. Example: GET_/rest/healthz/*.

limit

No

Integer

(0, 1000]

Number of data records returned each time. Default value: 20. Maximum value: 1000.

duration

No

Integer

Integer (≥ 0)

Minimum call duration (unit: ms). Default value: 0.

status

No

Integer

1: Only the transactions that fail to be executed are queried.

Transaction status.

By default, all transactions are queried. If the value is 1, only the transactions that fail to be executed are queried.

Example request

/v1/0/ats/traces?startTime=1506214200000&endTime=1506214428000&application=datamgmtservice&monitorGroup=apm&limit=1

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

Result

Tracing query result.

Table 4 result parameters

Parameter

Type

Description

count

Integer

Tracing quantity.

traceChains

List<TraceChainBase>

Tracing data set.

Table 5 TraceChainBase parameters

Parameter

Type

Description

traceId

String

Trace ID, which is globally unique.

type

String

Service type.

status

Integer

Call response status.

duration

Integer

Service call duration (unit: μs).

application

String

Service name.

instance

String

Instance name.

transaction

String

Service call API/name.

startTime

Integer

Start time for calling a service (unit: μs).

endTime

Integer

End time for calling a service (unit: μs).

address

String

IPv4 address of the client.

Example response

{
  "errorCode": "SVCSTG.ATS.2000",
  "errorMessage":null,
  "responseInfo": {
    "count": 1,
    "traceChains": [
      {
        "traceId": "000000004fa102d1",
        "type": "TOMCAT_METHOD",
        "status": 0,
        "duration": 10000,
        "application": "datamgmtservice",
        "instance": "datamgmtservice-4267750592-2ngmz",
        "transaction": "/rest/plat/sysmgr/v1/sysagent/alarm/report",
        "startTime": 1506214214095000,
        "endTime": 1506214214105000,
        "address": "192.168.0.1"
      }
    ]
  }
}

Status Code

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

    Status Code

    Description

    200

    The request has succeeded.