接口说明
调用 getTraceDetail 接口获取调用链详情。
请求头
该接口使用公共请求头,无特殊请求头。请参见公共请求参数文档。
请求语法
GET /paasopenapi/api/cmparmsadmin/cmparms/tenant/transactions/trace HTTP/1.1
请求参数
名称 | 类型 | 位置 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|---|
projectCode | String | Query | 否 | RNfSlzALYT | 日志项目编码 |
regionCode | String | Query | 是 | bbd132b51e92ac1100 | 资源池编码 |
traceId | String | Query | 是 | 92d761f17957dea1565a4 | 调用链ID |
timestamp | Long | Query | 否 | 1 | 时间戳 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
code | Integer | 0 | 响应状态码。0:成功,-1:失败 |
msg | String | "" | 响应描述 |
data | Object | 调用链详情。 |
data数据结构如下:
名称 | 类型 | 示例 | 描述 |
---|---|---|---|
SpanDTO | Object | 调用链详情 |
SpanDTO的数据结构如下:
名称 | 类型 | 示例 | 描述 |
---|---|---|---|
traceId | String | 212ef3c1789851858988de | 调用链ID |
id | String | c457aa04a4fee6 | ID |
name | String | test_name | 名称 |
type | String | db | 调用类型 |
serviceCode | String | msap-pipe-default | 应用编码 |
timestamp | String | 2023-08-08 11:46:25.756000000 | 时间 |
duration | double | 0 | 耗时(ms) |
httpUrl | String | http://10.50.208.11:8971/api/openApi/paas/paasagent/proxy/http/FCDD82A43EBD5BA277F3A472CA22625679F2D9A | http请求地址 |
outcome | String | success | outcome(success/failure/unknown) |
responseStatusCode | Integer | 200 | http响应状态码 |
clientAddress | String | 10.50.208.11:8971 | 客户端地址(IP/hostname) |
clientPort | Integer | 8971 | 客户端端口 |
serverAddress | String | 10.50.208.11:8971 | 服务端地址(IP/hostname) |
serverPort | Integer | 8971 | 服务端端口 |
dstServiceResource | String | 10.50.208.11:8971 | 目标服务Resource |
dstServiceName | String | redis | 目标服务名称 |
dstServiceType | String | db | 目标服务类型 |
parentId | String | 89ec31e015 | 父ID |
agentName | String | Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36 Edg/117.0.1938.62 | Agent名称 |
processId | Integer | 1 | 进程ID |
processCommandLine | String | /usr/local/jdk1.8.0_221/jre:bin:java -Dlog4j2.formatMsgNoLookups=true -Dfile.encoding=UTF-8 -javaagent:/ctg-mse-gateway-controller/agent/ctyunArmsAgent.jar | 进程命令 |
threadId | Integer | 861 | 线程ID |
threadName | String | http-nio-27150-exec-10 | 线程名 |
hostName | String | mse-gateway-controller-76fd4d9d49-4mf7s | 主机名 |
hostArchitecture | String | amd64 | 主机CPU架构 |
hostOSPlatform | String | "" | 主机操作系统类型 |
hostOSFull | String | "" | 主机操作系统名称 |
dbConnectString | String | redis://10.50.208.245:6375 | DB连接串 |
dbType | String | redis | DB类型 |
dbUser | String | root | DB用户 |
dbOperation | String | EVALSHA | DB操作 |
dbInstance | String | "" | DB实例 |
dbStatement | String | EVALSHA 065ce216750fa703e6f60302be400d42676231a0 4 orca.task.queue-hz3.queue orca.task.queue-hz3.unacked orca.task.queue-hz3.locks orca.task.queue-hz3.messages | sql语句 |
messagingSystem | String | kafka | 消息系统 |
messagingOperation | String | process | 消息操作 |
messagingDestinationKind | String | topic | 消息目的类型 |
messagingQueueName | String | test_messagingName | 消息队列名称 |
extInfos | Object | 扩展信息 |
extInfos的数据结构如下:
名称 | 类型 | 示例 | 描述 |
---|---|---|---|
List | Object | 扩展信息 |
ExtInfo的数据结构如下:
名称 | 类型 | 示例 | 描述 |
---|---|---|---|
category | String | 分类 | |
items | Object | 扩展信息列表 |
items的数据结构如下:
名称 | 类型 | 示例 | 描述 |
---|---|---|---|
List | Object | 扩展信息列表 |
ExtItem的数据结构如下:
名称 | 类型 | 示例 | 描述 |
---|---|---|---|
label | String | 标签 | |
value | Object | 标签值 |
示例
请求示例
GET /paasopenapi/api/cmparmsadmin/cmparms/tenant/transactions/trace?regionCode=bbd132b5311e942ac1100&traceId=92d761f17957dea1565a4 HTTP/1.1
Content-Type:application/json
正常返回示例
HTTP/1.1 200 OK
{
"code":0,
"msg":"string",
"data":
{
"agentName":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36 Edg/117.0.1938.62",
"agentVersion":"",
"children":[],
"clientAddress":"10.50.208.11:8971",
"clientPort":8971,
"dbConnectString":"redis://10.50.208.245:6375",
"dbInstance":"",
"dbOperation":"EVALSHA",
"dbStatement":"EVALSHA 065ce216750fa703e6f60302be400d42676231a0 4 orca.task.queue-hz3.queue orca.task.queue-hz3.unacked orca.task.queue-hz3.locks orca.task.queue-hz3.messages",
"dbType":"redis",
"dbUser":"root",
"deployment":"_carms_",
"dstServiceName":"redis",
"dstServiceResource":"10.50.208.11:8971",
"dstServiceType":"db",
"duration":1000,
"exceptionStacktrace":{},
"extInfos":[
{
"category":"",
"items":[
{
"label":"label",
"value":{}
}
]
}
],
"hostArchitecture":"amd64",
"hostName":"mse-gateway-controller-76fd4d9d49-4mf7s",
"hostOSFull":"",
"hostOSPlatform":"",
"httpUrl":"http://10.50.208.11:8971/api/openApi/paas/paasagent/proxy/http/FCDD82A43EBD5BA277F3A472CA22625679F2D9A",
"id":"c457aa04a4fee6",
"instanceId":"172.26.17.84",
"messagingDestinationKind":"topic",
"messagingOperation":"process",
"messagingQueueName":"test_messagingName",
"messagingSystem":"kafka",
"name":"test_name",
"outcome":"success",
"parentId":"89ec31e015",
"processCommandLine":"/usr/local/jdk1.8.0_221/jre:bin:java -Dlog4j2.formatMsgNoLookups=true -Dfile.encoding=UTF-8 -javaagent:/ctg-mse-gateway-controller/agent/ctyunArmsAgent.jar",
"processId":1,
"projectCode":"_carms_",
"regionCode":"d8bbd132b53a11e9b0e",
"responseStatusCode":200,
"serverAddress":"10.50.208.11:8971",
"serverPort":8971,
"serviceCode":"msap-pipe-default",
"tenantCode":"Tenant",
"threadId":861,
"threadName":"http-nio-27150-exec-10",
"timestamp":"2019-08-24T14:15:22Z",
"total":0,
"traceId":"212ef3c1789851858988de",
"type":"db",
"userAgentName":"",
"userAgentOSName":"",
"userAgentOSVersion":"",
"userAgentVersion":""
}
}
错误码
Http状态码 | 错误码 | 错误码描述 |
---|---|---|
400 | MissingParameter | 缺少必要的请求参数。 |
400 | InvalidParameterValue | 请求参数取值错误 |
500 | FailedOperation | 操作失败 |