查询调用链
功能介绍
根据查询条件,查询调用链数据。
URI
GET /v1/{project_id}/ats/traces
请求消息
|
参数 |
描述 |
是否为必选 |
示例 |
|---|---|---|---|
|
clusterId |
集群ID |
否 |
default |
|
namespace |
命名空间 |
否 |
manage |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
project_id |
string |
工程ID |
|
参数 |
是否必选 |
取值类型 |
取值范围 |
描述 |
|---|---|---|---|---|
|
startTime |
是 |
long |
<endTime |
调用链查询开始时间(单位ms) |
|
endTime |
是 |
long |
>startTime |
调用链查询结束时间(单位ms) |
|
application |
是 |
string |
参见查询服务列表 |
服务名称 服务名称中的英文字母必须小写,如:“test-service” |
|
monitorGroup |
否 |
string |
参见查询应用列表 |
应用名称 |
|
instance |
否 |
string |
参见查询服务实例列表 |
实例名称 实例名称中的英文字母必须小写,如:“test-service-4195149926-0fvhn” |
|
transaction |
否 |
string |
参见查询服务事务列表 |
事务名称, 如:“GET_/rest/healthz/*” |
|
limit |
否 |
int |
<=1000,>0的整数 |
默认为20,单次查询返回的条数限制,最大单次返回1000条 |
|
duration |
否 |
int |
>=0的整数 |
默认为0,调用链最小耗时(单位ms) |
|
status |
否 |
int |
1:事务执行失败 |
事务状态,默认查询所有状态的数据,为1时查询调用失败的数据 |
请求示例
/v1/0/ats/traces?startTime=1506214200000&endTime=1506214428000&application=datamgmtservice&monitorGroup=apm&limit=1
响应消息
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
errorCode |
string |
响应错误码, SVCSTG.ATS.2000:查询成功 SVCSTG.ATS.400101:参数校验失败 SVCSTG.ATS.200103:没有找到调用链数据 |
|
errorMessage |
string |
响应错误信息描述 |
|
responseInfo |
result |
调用链查询结果 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
count |
int |
本次查询到的调用链数量 |
|
traceChains |
List<TraceChainBase> |
调用链数据集合 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
traceId |
string |
调用链的ID,全局唯一 |
|
type |
string |
服务类型 |
|
status |
int |
调用返回状态 |
|
duration |
long |
业务调用耗时(单位μs) |
|
application |
string |
服务名称 |
|
instance |
string |
实例名称 |
|
transaction |
string |
业务调用接口/业务名称 |
|
startTime |
long |
业务调用开始时间(单位μs) |
|
endTime |
long |
业务调用结束时间(单位μs) |
|
address |
string |
调用发起端IPV4地址 |
响应示例
{
"errorCode": "SVCSTG.ATS.2000",
"errorMessage":null,
"responseInfo": {
"count": 1,
"traceChains": [
{
"traceId": "000000004fa102d1",
"type": "TOMCAT_METHOD",
"status": 0,
"duration": 10000,
"application": "datamgmtservice",
"instance": "datamgmtservice-4267750592-2ngmz",
"transaction": "/rest/plat/sysmgr/v1/sysagent/alarm/report",
"startTime": 1506214214095000,
"endTime": 1506214214105000,
"address": "192.168.0.1"
}
]
}
}
状态码
- 正常