All Products
Search
Document Center

Application Real-Time Monitoring Service:SearchTraces

Last Updated:Mar 12, 2025

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

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • For mandatory resource types, indicate with a prefix of * .
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
xtrace:SearchTraceget
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
StartTimelongYes

The beginning of the time range to query. The value is a timestamp that is accurate to milliseconds.

1575561600000
EndTimelongYes

The end of the time range to query. The value is a timestamp that is accurate to milliseconds.

1575622455686
RegionIdstringYes

The ID of the region.

cn-beijing
ServiceNamestringNo

The name of the application.

service 1
OperationNamestringNo

The name of the span.

/api
MinDurationlongNo

The minimum value of an execution duration. Unit: seconds. For example, a value of 2 indicates that the traces whose execution duration is more than 2 seconds are queried.

1000
AppTypestringNo

The type of the application. You can set the value to XTRACE or leave this parameter unspecified.

XTRACE
PageNumberintegerNo

The number of the page to return. For example, a value of 5 indicates page 5.

1
PageSizeintegerNo

The number of entries per page.

100
ReversebooleanNo

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

  • true: reverse chronological order
  • false: chronological order
false
ServiceIpstringNo

The IP address of the server on which the span is running.

10.0.0.0
Tagarray<object>No

The list of the tags.

objectNo

Tag.

KeystringNo

The key of the tag.

http.status_cod
ValuestringNo

The value of the tag.

200

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

1E2B6A4C-6B83-4062-8B6F-AEEC1F******
PageBeanobject

The location of the returned data.

PageSizeinteger

The number of entries per page.

100
PageNumberinteger

The page number of the returned page.

1
TotalCountlong

The total number of entries returned.

1000
TraceInfosarray<object>

The trace information.

TraceInfoobject

The trace information.

OperationNamestring

The span name.

/api
ServiceIpstring

The IP address or name of the server on which the span is running.

192.163.XXX.XXX
Durationlong

The duration. Unit: milliseconds.

100
Timestamplong

The timestamp when the span was generated. Unit: millisecond.

1575561600000000
ServiceNamestring

The service name.

service1
TraceIDstring

The trace ID.

1c6881aab84191a4
TagMapobject

The tag information.

{"env":"dev"}

Examples

Sample success responses

JSONformat

{
  "RequestId": "1E2B6A4C-6B83-4062-8B6F-AEEC1F******",
  "PageBean": {
    "PageSize": 100,
    "PageNumber": 1,
    "TotalCount": 1000,
    "TraceInfos": {
      "TraceInfo": [
        {
          "OperationName": "/api",
          "ServiceIp": "192.163.XXX.XXX",
          "Duration": 100,
          "Timestamp": 1575561600000000,
          "ServiceName": "service1",
          "TraceID": "1c6881aab84191a4",
          "TagMap": {
            "env": "dev"
          },
          "StatusCode": 0
        }
      ]
    }
  }
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history