Loading...
Loading...
Compare original and translation side by side
undefinedundefinedundefinedundefinedscripts/download_traces.pyscripts/download_traces.tsscripts/analyze_traces.pyreferences/filtering-querying.mdreferences/analysis-patterns.mdreferences/benchmark-analysis.mdscripts/download_traces.pyscripts/download_traces.tsscripts/analyze_traces.pyreferences/filtering-querying.mdreferences/analysis-patterns.mdreferences/benchmark-analysis.mdlangsmith-fetch trace <id>--trace-idslist_runs/listRunsanalyze_traces.pylangsmith-fetch trace <id>--trace-idslist_runs/listRunsanalyze_traces.pyuv run skills/langsmith-trace-analyzer/scripts/download_traces.py \
--project "my-project" \
--filter "job_id=abc123" \
--last-hours 24 \
--limit 100 \
--output ./traces \
--organizets-node skills/langsmith-trace-analyzer/scripts/download_traces.ts \
--project "my-project" \
--filter "job_id=abc123" \
--last-hours 24 \
--limit 100 \
--output ./tracestraces/
├── manifest.json
└── by-outcome/
├── passed/
├── failed/
└── error/
├── GraphRecursionError/
├── TimeoutError/
└── DaytonaError/--organize/--no-organizelangsmith-fetchuv run skills/langsmith-trace-analyzer/scripts/download_traces.py \
--project "my-project" \
--filter "job_id=abc123" \
--last-hours 24 \
--limit 100 \
--output ./traces \
--organizets-node skills/langsmith-trace-analyzer/scripts/download_traces.ts \
--project "my-project" \
--filter "job_id=abc123" \
--last-hours 24 \
--limit 100 \
--output ./tracestraces/
├── manifest.json
└── by-outcome/
├── passed/
├── failed/
└── error/
├── GraphRecursionError/
├── TimeoutError/
└── DaytonaError/--organize/--no-organizelangsmith-fetchundefinedundefined
The analyzer reports:
- message/tool-call/token/duration summaries
- top tool usage
- anomaly patterns (high message count, repeated tools, quick failures)
- passed-vs-failed metric deltas when comparison is enabled
分析工具会生成以下报告内容:
- 消息/工具调用/令牌/时长汇总
- 高频工具使用情况
- 异常模式(消息数量过多、重复调用工具、快速失败等)
- 启用对比功能时,通过与失败案例的指标差异filterstart_timefrom datetime import datetime, timedelta, timezone
from langsmith import Client
client = Client()
start = datetime.now(timezone.utc) - timedelta(hours=24)
filter_query = 'and(eq(metadata_key, "job_id"), eq(metadata_value, "abc123"))'
runs = client.list_runs(
project_name="my-project",
is_root=True,
start_time=start,
filter=filter_query,
)import { Client } from "langsmith";
const client = new Client();
for await (const run of client.listRuns({
projectName: "my-project",
isRoot: true,
filter: 'and(eq(metadata_key, "job_id"), eq(metadata_value, "abc123"))',
})) {
console.log(run.id, run.status);
}filterstart_timefrom datetime import datetime, timedelta, timezone
from langsmith import Client
client = Client()
start = datetime.now(timezone.utc) - timedelta(hours=24)
filter_query = 'and(eq(metadata_key, "job_id"), eq(metadata_value, "abc123"))'
runs = client.list_runs(
project_name="my-project",
is_root=True,
start_time=start,
filter=filter_query,
)import { Client } from "langsmith";
const client = new Client();
for await (const run of client.listRuns({
projectName: "my-project",
isRoot: true,
filter: 'and(eq(metadata_key, "job_id"), eq(metadata_value, "abc123"))',
})) {
console.log(run.id, run.status);
}statuserrortotal_tokensstart_timeend_timemetadataextra.metadatamessagesanalyze_traces.pylist_runsstatuserrortotal_tokensstart_timeend_timemetadataextra.metadatamessagesanalyze_traces.pylist_runs| Issue | Likely Cause | Action |
|---|---|---|
| Auth not configured | |
| No runs returned | Wrong project/filter/time range | Verify project name and filter syntax |
| Empty/partial message arrays | Run schema differs or incomplete data | Use downloaded trace JSON and inspect |
| JSON parse error on downloaded files | Bad/incomplete export | Re-download trace; use |
| Re-downloading same traces repeatedly | Existing files in nested folders | Use current scripts (they check existing files across output tree) |
| 问题 | 可能原因 | 解决方法 |
|---|---|---|
缺少 | 未配置身份验证 | 执行 |
| 未返回任何运行实例 | 项目/过滤器/时间范围错误 | 验证项目名称和过滤器语法 |
| 消息数组为空/不完整 | 运行实例架构不同或数据不完整 | 使用下载的追踪数据JSON并检查 |
| 下载的文件出现JSON解析错误 | 导出数据损坏/不完整 | 重新下载追踪数据;在脚本中使用 |
| 重复下载相同的追踪数据 | 嵌套文件夹中存在现有文件 | 使用当前版本的脚本(它们会检查输出目录中的现有文件) |
manifest.jsonmanifest.jsonscripts/download_traces.pyscripts/download_traces.tsscripts/analyze_traces.pyscripts/download_traces.pyscripts/download_traces.tsscripts/analyze_traces.pyreferences/filtering-querying.mdreferences/analysis-patterns.mdreferences/benchmark-analysis.mdreferences/filtering-querying.mdreferences/analysis-patterns.mdreferences/benchmark-analysis.md