All Products
Search
Document Center

Application Real-Time Monitoring Service:GetTrace

Last Updated:May 09, 2024

Queries the details of a trace.

Operation description

Note You must use Application Real-Time Monitoring Service (ARMS) SDK for Java V2.7.24.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

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:
    • The required resource types are displayed in bold characters.
    • 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
arms:GetTraceWrite
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
TraceIDstringYes

The trace ID. You can log on to the ARMS console and obtain the trace ID on the Trace Query page or Interface Snapshot tab.

ac14001a15954493811405707d****
RegionIdstringYes

The region ID.

cn-hangzhou
StartTimelongNo

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

Note If the ID of the trace is 30 characters in length, this parameter is optional. Otherwise, this parameter is required.
1623827602000
EndTimelongNo

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

Note If the ID of the trace is 30 characters in length, this parameter is optional. Otherwise, this parameter is required.
1623827603000

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The request ID.

6A9AEA84-7186-4D8D-B498-4585C6A2****
Spansobject []

The details of the trace.

SpanIdstring

The span ID.

1234
OperationNamestring

The name of the traced span.

/api/demo
ResultCodestring

The status code.

222
Timestamplong

The timestamp generated when the span was generated.

1590388651
RpcTypeinteger

The type of the remote procedure call (RPC) mode.

  • 0 http
  • 25 http_client
  • 1 hsf_client
  • 2 hsf
  • 40 local
  • 41 async
  • 52 DB2
  • 53 Informix
  • 54 SequoiaDB
  • 55 Gbase
  • 56 GaussDB
  • 57 KingBase
  • 58 infuxdb
  • 59 clickhouse
  • 60 mysql
  • 61 mysql
  • 62 oracle
  • 63 postgresql
  • 64 mongodb
  • 65 ppas
  • 66 sqlserver
  • 67 mariadb
  • 68 dmdb
  • 69 oceanbase
  • 70 redis
  • 71 memcached
  • 72 elasticsearch
  • 73 kudu
  • 4 tddl
  • 5 tair
  • 13 mq_client
  • 252 mq
  • 23 kafka_client
  • 256 kafka
  • 3 notify_client
  • 254 notify
  • 7 dubbo_client
  • 8 dubbo
  • 11 dsf_client
  • 12 dsf
  • 9 grpc
  • 10 grpc_client
  • 16 thrift
  • 17 thrift_client
  • 18 sofa
  • 19 sofa_client
  • -1 unknown
  • 98 user_method
  • 100 root
  • 101 client
  • 102 server
  • 103 producer
  • 104 consumer
  • 105 db
  • 106 xtrace_other
  • 1301 schedulerx
  • 1302 XXL_Job
  • 1303 Spring_Scheduled
  • 1304 Quartz
  • 1305 ElasticJob
  • 1308 Jdk_Timer
1
ServiceIpstring

The IP address of the host where the application resides.

172.20.XX.XX
HaveStackboolean

Indicates whether a method stack was provided.

  • true: A method stack was provided.
  • false: No method stack was provided.
false
ParentSpanIdstring

The ID of the parent span.

18
Durationlong

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

1000
RpcIdstring

The ID of the RPC mode.

0
ServiceNamestring

The name of the application.

arms-demo
TraceIDstring

The trace ID.

ac14001a15954493811405707d****
TagEntryListobject []

The tags of the trace.

Keystring

The key of the tag.

http.status.code
Valuestring

The value of the tag.

200
LogEventListobject []

The log events in the trace.

Timestamplong

The timestamp when the log event was generated.

1590388651
TagEntryListobject []

The tags of the trace.

Keystring

The key of the tag.

http.status.code
Valuestring

The value of the tag.

200
Childrenobject []

The child spans of the current span.

object

The details of the child span.

[ { "ParentSpanId":"c33603355032xxxx", "ServiceIp":"10.208.xxx.xxx", "OperationName":"/product/toy/8ac7ddeb-1c3c-4911-850c-665a5a0xxxx", "RpcType":0, "Duration":2, "TagEntryList":[ { "Value":"10.208.0.xxx", "Key":"source.ip" } ], "Timestamp":1652669026201, "HaveStack":true, "LogEventList":[ ], "ServiceName":"xxxxxx", "RpcId":"0.2", "TraceID":"ea1ad000a1165266902619685xxxxx", "Children":[ ], "ResultCode":"0", "SpanId":"7069ab30d7cbxxxx" } ]

Examples

Sample success responses

JSONformat

{
  "RequestId": "6A9AEA84-7186-4D8D-B498-4585C6A2****",
  "Spans": [
    {
      "SpanId": "1234",
      "OperationName": "/api/demo",
      "ResultCode": "222",
      "Timestamp": 1590388651,
      "RpcType": 1,
      "ServiceIp": "172.20.XX.XX",
      "HaveStack": false,
      "ParentSpanId": "18",
      "Duration": 1000,
      "RpcId": "0",
      "ServiceName": "arms-demo",
      "TraceID": "ac14001a15954493811405707d****",
      "TagEntryList": [
        {
          "Key": "http.status.code",
          "Value": "200"
        }
      ],
      "LogEventList": [
        {
          "Timestamp": 1590388651,
          "TagEntryList": [
            {
              "Key": "http.status.code",
              "Value": "200"
            }
          ]
        }
      ],
      "Children": [
        [
          {
            "ParentSpanId": "c33603355032xxxx",
            "ServiceIp": "10.208.xxx.xxx",
            "OperationName": "/product/toy/8ac7ddeb-1c3c-4911-850c-665a5a0xxxx",
            "RpcType": 0,
            "Duration": 2,
            "TagEntryList": [
              {
                "Value": "10.208.0.xxx",
                "Key": "source.ip"
              }
            ],
            "Timestamp": 1652669026201,
            "HaveStack": true,
            "LogEventList": [],
            "ServiceName": "xxxxxx",
            "RpcId": "0.2",
            "TraceID": "ea1ad000a1165266902619685xxxxx",
            "Children": [],
            "ResultCode": "0",
            "SpanId": "7069ab30d7cbxxxx"
          }
        ]
      ]
    }
  ]
}

Error codes

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

Change history

Change timeSummary of changesOperation
2021-10-28The response structure of the API has changedsee changesets
Change itemChange content
Output ParametersThe response structure of the API has changed.