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

Querying Tracing Data

Function

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

URI

GET /v1/{project_id}/ats/traces

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 parameters

Parameter

Mandatory

Type

Value Range

Description

startTime

Yes

Long

< endTime

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

endTime

Yes

Long

> startTime

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

application

Yes

String

For details, see Querying the Service List.

Service name.

The letters in the service name must be lowercase letters. Example: test-service.

monitorGroup

No

String

For details, see Querying the Application List.

Application name.

instance

No

String

For details, see Querying the Service Instance List.

Instance name.

The letters in the instance name must be lowercase letters. Example: test-service-4195149926-0fvhn.

transaction

No

String

For details, see Querying the Service Transaction List.

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

limit

No

Integer

The value must be an integer greater than 0 but less than or equal to 1000.

Maximum number of data records that can be returned each time. Default value: 20. Maximum value: 1000.

duration

No

Integer

The value must be an integer greater than or equal to 0.

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

status

No

Integer

1: Only the data of failed transactions is queried.

Transaction status.

By default, all transaction data is queried. 1: Only the data of failed transactions is queried.

Example request

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

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

Result

Tracing query result.

Table 5 result parameters

Parameter

Type

Description

count

Integer

Number of traces that are queried.

traceChains

List<TraceChainBase>

Tracing data set.

Table 6 TraceChainBase parameters

Parameter

Type

Description

traceId

String

Trace ID, which is globally unique.

type

String

Service type.

status

Integer

Call response status.

duration

Long

Service call duration (unit: μs).

application

String

Service name.

instance

String

Instance name.

transaction

String

API/service name.

startTime

Long

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

endTime

Long

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

    Status Code

    Description

    200

    The request is successful.