Queries traces by time, application name, IP address, span name, and tag.

Note A maximum of 100 data entries can be returned each time this operation is called. If you want to query all existing traces, we recommend that you call the SearchTracesByPage operation. For more information, see SearchTracesByPage.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes SearchTraces

The operation that you want to perform. Set the value to SearchTraces.

EndTime Long Yes 1595210400000

The end of the time range to query. Unit: milliseconds.

RegionId String Yes cn-hangzhou

The ID of the region.

StartTime Long Yes 1595174400000

The beginning of the time range to query. Unit: milliseconds.

ServiceName String No arms-k8s-demo-subcomponent

The name of the application.

OperationName String No /demo/queryNotExistDB/11

The name of the traced span.

MinDuration Long No 2

The minimum amount of time consumed by traces. Unit: milliseconds.

Tag.N.Key String No http.status_code

The key of the tag.

Tag.N.Value String No 200

The value of the tag.

Reverse Boolean No false

Specifies whether to sort the query results in chronological order or reverse chronological order. Default value: false. Valid values:

  • true: sorts the query results in reverse chronological order.
  • false: sorts the query results in chronological order.
ServiceIp String No 172.20.XX.XX

The IP address of the host where the application resides.

ExclusionFilters.N.Key String No http.status_code

The key that is used to filter the query results.

ExclusionFilters.N.Value String No 404

The value of the key that is used to filter the query results.

Response parameters

Parameter Type Example Description
RequestId String 4C518054-852F-4023-ABC1-4AF95FF7****

The ID of the request.

TraceInfos Array of TraceInfo

The details of the returned trace.

Duration Long 6

The amount of time consumed by the trace. Unit: milliseconds.

OperationName String get***

The name of the traced span.

ServiceIp String 172.20.**.**

The IP address of the host where the application resides.

ServiceName String arms-k8s-demo-subcomponent

The name of the application.

Timestamp Long 1595174436993

The timestamp when the trace was returned.

TraceID String ac1400a115951744369937024d****

The ID of the trace.

Examples

Sample requests

http(s)://[Endpoint]/?Action=SearchTraces
&EndTime=1595210400000
&RegionId=cn-hangzhou
&StartTime=1595174400000
&OperationName=/demo/queryNotExistDB/11
&<Common request parameters>

Sample success responses

XML format

<SearchTracesResponse>
      <RequestId>4C518054-852F-4023-ABC1-4AF95FF7****</RequestId>
      <TraceInfos>
            <ServiceIp>172.20.XX.XX</ServiceIp>
            <OperationName>/demo/queryNotExistDB/11</OperationName>
            <ServiceName>arms-k8s-demo-subcomponent</ServiceName>
            <TraceID>ac1400a115951744369937024d****</TraceID>
            <Duration>6</Duration>
            <Timestamp>1595174436993</Timestamp>
      </TraceInfos>
      <TraceInfos>
            <ServiceIp>172.20.XX.XX</ServiceIp>
            <OperationName>/demo/queryNotExistDB/11</OperationName>
            <ServiceName>arms-k8s-demo-subcomponent</ServiceName>
            <TraceID>ac1400a115951745017447033d****</TraceID>
            <Duration>11</Duration>
            <Timestamp>1595174501747</Timestamp>
      </TraceInfos>
      <TraceInfos>
            <ServiceIp>172.20.XX.XX</ServiceIp>
            <OperationName>/demo/queryNotExistDB/11</OperationName>
            <ServiceName>arms-k8s-demo-subcomponent</ServiceName>
            <TraceID>ac1400a115951803817467721d****</TraceID>
            <Duration>3</Duration>
            <Timestamp>1595180381751</Timestamp>
      </TraceInfos>
</SearchTracesResponse>

JSON format

{
    "RequestId": "4C518054-852F-4023-ABC1-4AF95FF7****",
    "TraceInfos": [
        {
            "ServiceIp": "172.20.XX.XX",
            "OperationName": "/demo/queryNotExistDB/11",
            "ServiceName": "arms-k8s-demo-subcomponent",
            "TraceID": "ac1400a115951744369937024d****",
            "Duration": 6,
            "Timestamp": 1595174436993
        },
        {
            "ServiceIp": "172.20.XX.XX",
            "OperationName": "/demo/queryNotExistDB/11",
            "ServiceName": "arms-k8s-demo-subcomponent",
            "TraceID": "ac1400a115951745017447033d****",
            "Duration": 11,
            "Timestamp": 1595174501747
        },
        {
            "ServiceIp": "172.20.XX.XX",
            "OperationName": "/demo/queryNotExistDB/11",
            "ServiceName": "arms-k8s-demo-subcomponent",
            "TraceID": "ac1400a115951803817467721d****",
            "Duration": 3,
            "Timestamp": 1595180381751
        }
    ]
}