oodle-traces
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseOodle Traces — Search and Analysis
Oodle追踪数据 — 搜索与分析
This skill teaches the agent to search Oodle traces with the right service / time / duration filters and to fetch full trace detail by ID.
本技能指导Agent使用正确的服务/时间/时长过滤器搜索Oodle追踪数据,并通过ID获取完整的追踪详情。
Prerequisites
前置条件
bash
brew install oodle-ai/oodle/oodle
oodle configureConfirm the traces endpoint works (use a recent time window):
bash
oodle traces list --from -15m --to now -o json | jq 'length'bash
brew install oodle-ai/oodle/oodle
oodle configure确认追踪数据端点可用(使用最近的时间窗口):
bash
oodle traces list --from -15m --to now -o json | jq 'length'Command Execution Order
命令执行顺序
Before running any oodle command:
- Check whether a service name and approximate time window are already in context.
- If not, run to discover services that emitted traces recently.
oodle traces list --from -1h --to now -o json | jq -r '.[].service' | sort -u - Build the search with ,
--service,--fromand at least one of--to/--error/--min-duration.--operation - To inspect a single trace, run .
oodle traces get <trace-id> -o json - Do not run without a
oodle traces listfilter on production environments.--service
运行任何oodle命令前:
- 检查上下文是否已包含服务名称和大致时间窗口。
- 如果没有,运行来发现最近生成追踪数据的服务。
oodle traces list --from -1h --to now -o json | jq -r '.[].service' | sort -u - 使用、
--service、--from以及至少一个--to/--error/--min-duration参数构建搜索命令。--operation - 要查看单个追踪数据详情,运行。
oodle traces get <trace-id> -o json - 在生产环境中,不要在未添加过滤器的情况下运行
--service。oodle traces list
Quick Reference
快速参考
| Task | Command |
|---|---|
| List traces in a service | |
| List error traces only | |
| List slow traces (>500ms) | |
| Filter by operation | |
| Get full trace | |
| 任务 | 命令 |
|---|---|
| 列出某服务的追踪数据 | |
| 仅列出错误追踪数据 | |
| 列出慢追踪数据(>500ms) | |
| 按操作过滤 | |
| 获取完整追踪数据 | |
Common Operations
常见操作
Searching for errors in the last hour
搜索过去一小时内的错误追踪数据
bash
undefinedbash
undefined✅ CORRECT — scoped to one service, narrow time window, error filter on
✅ 正确 — 限定单个服务、窄时间窗口、启用错误过滤器
oodle traces list --service api --error --from -1h --to now -o json
oodle traces list --service api --error --from -1h --to now -o json
❌ WRONG — no service, no error filter, huge result set
❌ 错误 — 未指定服务、无错误过滤器、结果集过大
oodle traces list --from -1h --to now -o json
undefinedoodle traces list --from -1h --to now -o json
undefinedSearching for slow traces
搜索慢追踪数据
bash
undefinedbash
undefined✅ CORRECT — slow checkout traces in the last hour
✅ 正确 — 过去一小时内的慢结账追踪数据
oodle traces list --service checkout --min-duration 500 --from -1h --to now -o json
oodle traces list --service checkout --min-duration 500 --from -1h --to now -o json
✅ CORRECT — narrow further by operation when you know the endpoint
✅ 正确 — 已知端点时进一步按操作缩小范围
oodle traces list --service checkout --operation POST_/cart --min-duration 500 --from -1h -o json
oodle traces list --service checkout --operation POST_/cart --min-duration 500 --from -1h --to now -o json
❌ WRONG — listing everything and sorting client-side wastes the API budget
❌ 错误 — 列出所有数据后在客户端排序会浪费API配额
oodle traces list --service checkout --from -1h -o json | jq 'sort_by(.durationMs) | reverse | .[0:10]'
undefinedoodle traces list --service checkout --from -1h -o json | jq 'sort_by(.durationMs) | reverse | .[0:10]'
undefinedFetching a full trace
获取完整追踪数据
bash
undefinedbash
undefined✅ CORRECT — list to discover trace ids, then get the one of interest
✅ 正确 — 先列出追踪数据发现trace id,再获取目标详情
TRACE_ID=$(oodle traces list --service api --error --from -15m -o json | jq -r '.[0].traceId')
oodle traces get "$TRACE_ID" -o json
TRACE_ID=$(oodle traces list --service api --error --from -15m -o json | jq -r '.[0].traceId')
oodle traces get "$TRACE_ID" -o json
❌ WRONG — oodle traces get
without an id (it expects the id as a positional arg)
oodle traces get❌ 错误 — oodle traces get
需要传入id(它将id作为位置参数)
oodle traces getoodle traces get
undefinedoodle traces get
undefinedTime window flags
时间窗口参数
--from--to| Format | Example |
|---|---|
| Epoch seconds | |
| |
| Relative duration | |
bash
undefined--from--to| 格式 | 示例 |
|---|---|
| 纪元秒 | |
| |
| 相对时长 | |
bash
undefined✅ CORRECT
✅ 正确
oodle traces list --service api --from -30m --to now -o json
oodle traces list --service api --from -30m --to now -o json
❌ WRONG — human strings are not parsed
❌ 错误 — 不解析自然语言字符串
oodle traces list --service api --from "30 minutes ago"
undefinedoodle traces list --service api --from "30 minutes ago"
undefinedBest Practices
最佳实践
Always specify --service
to scope the search
--service始终指定--service
来限定搜索范围
--serviceTrace volume can be massive; an unfiltered list is expensive and rate-limited.
bash
undefined追踪数据量可能非常庞大;未过滤的列表会消耗大量资源并触发速率限制。
bash
undefined✅ CORRECT
✅ 正确
oodle traces list --service api --from -1h -o json
oodle traces list --service api --from -1h -o json
❌ WRONG — full-tenant scan
❌ 错误 — 全租户扫描
oodle traces list --from -1h -o json
undefinedoodle traces list --from -1h -o json
undefinedUse --error
to find failing traces, not client-side filtering
--error使用--error
查找失败的追踪数据,而非客户端过滤
--error--errorbash
undefined--errorbash
undefined✅ CORRECT
✅ 正确
oodle traces list --service api --error --from -1h -o json
oodle traces list --service api --error --from -1h -o json
❌ WRONG — fetches every trace then filters client-side
❌ 错误 — 获取所有追踪数据后在客户端过滤
oodle traces list --service api --from -1h -o json | jq '.[] | select(.status=="error")'
undefinedoodle traces list --service api --from -1h -o json | jq '.[] | select(.status=="error")'
undefinedUse --min-duration
to find slow traces, not client-side sort
--min-duration使用--min-duration
查找慢追踪数据,而非客户端排序
--min-durationbash
undefinedbash
undefined✅ CORRECT — server-side filter, returns ~the right number of rows
✅ 正确 — 服务器端过滤,返回数量合适的结果
oodle traces list --service api --min-duration 500 --from -1h -o json
oodle traces list --service api --min-duration 500 --from -1h -o json
❌ WRONG — pulls everything, sorts on the client
❌ 错误 — 获取所有数据后在客户端排序
oodle traces list --service api --from -1h -o json | jq 'sort_by(.durationMs) | reverse'
undefinedoodle traces list --service api --from -1h -o json | jq 'sort_by(.durationMs) | reverse'
undefinedKeep time windows ≤ 24h for list
; widen by re-querying, not by raising --to
list--tolist
命令的时间窗口保持≤24小时;如需扩大范围请重新查询,而非增大--to
的范围
list--toA 7-day list returns too many rows and risks timeouts. Page by hour.
bash
undefined7天的列表会返回过多数据,可能导致超时。按小时分页查询。
bash
undefined✅ CORRECT — bounded window
✅ 正确 — 限定窗口
oodle traces list --service api --error --from -1h --to now -o json
oodle traces list --service api --error --from -1h --to now -o json
❌ WRONG — multi-day list
❌ 错误 — 多天范围的列表
oodle traces list --service api --error --from -7d --to now -o json
undefinedoodle traces list --service api --error --from -7d --to now -o json
undefinedFailure Handling
故障处理
| Error | Cause | Fix |
|---|---|---|
| 401 Unauthorized | Invalid or missing API key | Run |
| 404 Not Found | Trace ID does not exist or has aged out of retention | Re-list with a recent |
| connection refused | Wrong | Check |
| Empty result | Wrong service name or time window outside retention | List recent services: `oodle traces list --from -1h -o json |
| Request times out | Time window too large or no service filter | Narrow |
| 429 Too Many Requests | Concurrent trace fetches | Add |
| 错误 | 原因 | 修复方案 |
|---|---|---|
| 401 Unauthorized | API密钥无效或缺失 | 运行 |
| 404 Not Found | Trace ID不存在或已超出保留期限 | 使用最近的 |
| connection refused | | 检查 |
| 空结果 | 服务名称错误或时间窗口超出保留期限 | 列出最近的服务:`oodle traces list --from -1h -o json |
| 请求超时 | 时间窗口过大或未设置服务过滤器 | 缩小 |
| 429 Too Many Requests | 并发追踪数据请求过多 | 添加 |