Queries the details of a trace.

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

ParameterTypeRequiredExampleDescription
ActionStringYesGetTrace

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

TraceIDStringYes1c6881aab84191a4

The unique ID of the trace. You can obtain the trace ID on the Trace Analysis page in the console.

AppTypeStringNoXTRACE

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

RegionIdStringYescn-beijing

The ID of the region.

Response parameters

ParameterTypeExampleDescription
RequestIdString1E2B6A4C-6B83-4062-8B6F-AEEC1FC47DED

The ID of the request.

SpansArray of Span

The spans that are contained in the trace.

Span
SpanIdStringfec891bb8f8XXX

The ID of the span.

HaveStackBooleanfalse

Indicates whether the span has child spans. Valid values:

  • true: The span has child spans.
  • false: The span does not have child spans.
ServiceIpString192.168.XXX.XXX

The IP address of the server where the span resides.

OperationNameString/api

The name of the span.

ParentSpanIdStringfec891bb8f8XXX

The ID of the parent span.

ResultCodeString200

The HTTP status code.

DurationLong1000

The time consumed to call the trace. Unit: milliseconds.

RpcIdString1.1

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.

TimestampLong1689845513298000

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

ServiceNameStringserver1

The name of the application.

TraceIDString1c6881aab84191a4

The unique ID of the trace.

TagEntryListArray of TagEntry

The tags of the span.

TagEntry
KeyStringlogLevel

The tag key of the span.

ValueStringWarning

The tag value of the span.

LogEventListArray of LogEvent

The log events.

LogEvent
TimestampLong1689845513298000

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

TagEntryListArray of TagEntry

The tags of the log event.

TagEntry
KeyStringlogLevel

The tag key of the log event.

ValueStringWarning

The tag value of the log event.

Examples

Sample requests

http(s)://[Endpoint]/?Action=GetTrace
&RegionId=cn-beijing
&TraceID=1c6881aab84191a4
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<GetTraceResponse> 
  <RequestId>1E2B6A4C-6B83-4062-8B6F-AEEC1FC47DED</RequestId>  
  <Spans> 
    <Span> 
      <HaveStack>false</HaveStack>  
      <ParentSpanId>fec891bb8f8XXX</ParentSpanId>  
      <ServiceIp>192.168.XXX.XXX</ServiceIp>  
      <ServiceName>server1</ServiceName>  
      <OperationName>/api</OperationName>  
      <RpcId>1.1</RpcId>  
      <TraceID>1c6881aab84191a4</TraceID>  
      <Duration>1000</Duration>  
      <Timestamp>1583683202047000</Timestamp>  
      <ResultCode>200</ResultCode>  
      <SpanId>fec891bb8f8XXX</SpanId>  
      <TagEntryList> 
        <TagEntry> 
          <Value>Warning</Value>  
          <Key>logLevel</Key> 
        </TagEntry> 
      </TagEntryList>  
      <LogEventList> 
        <LogEvent> 
          <Timestamp>1583683202047000</Timestamp>  
          <TagEntryList> 
            <TagEntry> 
              <Value>Warning</Value>  
              <Key>logLevel</Key> 
            </TagEntry> 
          </TagEntryList> 
        </LogEvent> 
      </LogEventList> 
    </Span> 
  </Spans> 
</GetTraceResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

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

Error codes

For a list of error codes, visit the Error Center.