All Products
Search
Document Center

Application Real-Time Monitoring Service:GetTrace

Last Updated:Mar 12, 2025

Queries the details of a trace.

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
TraceIDstringYes

The trace ID, which is the unique identifier of the trace.

You can obtain the trace ID on the Trace Explorer page in the Managed Service for OpenTelemetry console or by calling the SearchTraces operation.

1c6881aab84191a4
AppTypestringNo

The type of the application. You can leave this parameter empty or set the value to XTRACE. We recommend that you leave it empty.

  • Empty value: queries traces reported from Managed Service for Prometheus and Application Real-Time Monitoring Service (ARMS).
  • XTRACE: queries only traces reported from Managed Service for Prometheus.
XTRACE
RegionIdstringYes

The ID of the region.

cn-beijing
PageNumberlongNo

The page number.

1
PageSizestringNo

The number of entries on each page. Maximum value: 100.

5

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

1E2B6A4C-6B83-4062-8B6F-AEEC1F******
Spansarray<object>

The list of spans.

Spanobject

The list of spans.

SpanIdstring

The span ID.

fec891bb8f8XXX
HaveStackboolean

Indicates whether the span has child spans. Valid values:

  • true
  • false
false
ServiceIpstring

The IP address of the server on which the span resides.

192.168.XXX.XXX
OperationNamestring

The name of the span.

/api
ParentSpanIdstring

The ID of the parent span.

fec891bb8f8XXX
ResultCodestring

The response code.

200
Durationlong

The duration of the span. Unit: milliseconds.

1000
RpcIdstring

The parent-child and sibling relationship between spans. For example, span 1.1 is the parent of span 1.1.1, and span 1.1.2 and span 1.1.1 are siblings.

1.1
Timestamplong

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

1689845513298000
ServiceNamestring

The name of the application.

server1
TraceIDstring

The trace ID, which is the unique identifier of the trace.

1c6881aab84191a4****
TagEntryListarray<object>

The tags.

TagEntryobject

The tags in the span.

Keystring

The tag key of the span.

logLevel
Valuestring

The tag value of the span.

Warning
LogEventListarray<object>

The log events.

LogEventobject

The log events in the trace.

Timestamplong

The timestamp when the log event was generated. Unit: microseconds.

1583683202047000
TagEntryListarray<object>

The tags.

TagEntryobject

The tags in the log event.

Keystring

The tag key of the log event.

logLevel
Valuestring

The tag value of the log event.

Warning

Examples

Sample success responses

JSONformat

{
  "RequestId": "1E2B6A4C-6B83-4062-8B6F-AEEC1F******",
  "Spans": {
    "Span": [
      {
        "SpanId": "fec891bb8f8XXX",
        "HaveStack": false,
        "ServiceIp": "192.168.XXX.XXX",
        "OperationName": "/api",
        "ParentSpanId": "fec891bb8f8XXX",
        "ResultCode": "200",
        "Duration": 1000,
        "RpcId": "1.1",
        "Timestamp": 1689845513298000,
        "ServiceName": "server1",
        "TraceID": "1c6881aab84191a4****",
        "TagEntryList": {
          "TagEntry": [
            {
              "Key": "logLevel",
              "Value": "Warning"
            }
          ]
        },
        "LogEventList": {
          "LogEvent": [
            {
              "Timestamp": 1583683202047000,
              "TagEntryList": {
                "TagEntry": [
                  {
                    "Key": "logLevel",
                    "Value": "Warning"
                  }
                ]
              }
            }
          ]
        },
        "StatusCode": 0
      }
    ]
  }
}

Error codes

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

Change history

Change timeSummary of changesOperation
No change history