API 参考执行
筛选和排序 trace
在整个根 span 开始时间范围内筛选和排序,再分页返回。费用为各 span 上报费用之和,不代表计费金额。 由各后端执行每次查询,不缓存查询结果;不同页可能反映请求之间的数据更新。Keyset 游标绑定排序、筛选条件及上一页末条的排序值和 trace/span ID。 查询不完整时返回错误,不提供部分排名。
GET
/api/v1/traces/search在整个根 span 开始时间范围内筛选和排序,再分页返回。费用为各 span 上报费用之和,不代表计费金额。
由各后端执行每次查询,不缓存查询结果;不同页可能反映请求之间的数据更新。Keyset 游标绑定排序、筛选条件及上一页末条的排序值和 trace/span ID。 查询不完整时返回错误,不提供部分排名。
认证与授权Bearer <token>
工作空间 API 密钥(a13n_...)
传递位置: header
查询参数
session_id?|null
thread_id?|null
run_id?|null
attribute?array<string>
元素
items <= 8started_after*Started After
格式
date-timestarted_before*Started Before
格式
date-timeorder_by?Order By
默认值
"started"可选值
- "started"
- "duration"
- "cost"
direction?Direction
默认值
"desc"可选值
- "asc"
- "desc"
min_duration_seconds?||null
max_duration_seconds?||null
min_cost_usd?||null
max_cost_usd?||null
limit?Limit
范围
1 <= value <= 100默认值
25cursor?string|null
请求头参数
X-Workspace-ID?|
登录会话作用的工作空间 ID,登录会话必须提供。API 密钥作用于自身工作空间,无需提供;禁止指定其他工作空间。
响应体
application/json
application/json
application/json
curl -X GET "https://example.com/api/v1/traces/search?started_after=2019-08-24T14%3A15%3A22Z&started_before=2019-08-24T14%3A15%3A22Z"{ "collected_at": "2019-08-24T14:15:22Z", "items": [ { "cost_usd": "string", "duration_seconds": "string", "root": { "attributes": { "property1": null, "property2": null }, "cost_usd": "string", "ended_at": "2019-08-24T14:15:22Z", "events": [ { "attributes": { "property1": null, "property2": null }, "name": "string", "timestamp": "2019-08-24T14:15:22Z" } ], "id": "string", "input": null, "kind": "string", "level": "string", "links": [ { "attributes": { "property1": null, "property2": null }, "span_id": "string", "trace_id": "string" } ], "model": "string", "name": "string", "output": null, "parent_id": "string", "resource_attributes": { "property1": null, "property2": null }, "scope": { "name": "string", "version": "string" }, "source_url": "string", "started_at": "2019-08-24T14:15:22Z", "status": "ok", "status_message": "string", "trace_id": "string", "usage": { "property1": 0, "property2": 0 } } } ], "next_cursor": "string", "total": 0}