langfuse-traces
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseLangfuse Traces Skill
Langfuse Traces Skill
Query and analyze Langfuse trace data directly from Claude Code.
直接通过Claude Code查询和分析Langfuse追踪数据。
Usage
使用方法
Invoke the query script using the base directory shown above:
bash
bash <base_directory>/scripts/query.sh <command> [options]使用上方所示的基础目录调用查询脚本:
bash
bash <base_directory>/scripts/query.sh <command> [options]Commands
命令
| Command | Args | Description |
|---|---|---|
| [limit] [session_id] [name] | List recent traces |
| trace_id | Get full trace with observations |
| [limit] [trace_id] | List spans/generations |
| [limit] | List sessions |
| [limit] | Compact one-line-per-trace view |
| 命令 | 参数 | 描述 |
|---|---|---|
| [limit] [session_id] [name] | 列出最近的追踪数据 |
| trace_id | 获取包含观测数据的完整追踪记录 |
| [limit] [trace_id] | 列出跨度/生成记录 |
| [limit] | 列出会话 |
| [limit] | 紧凑的每行一条追踪记录视图 |
Examples
示例
bash
undefinedbash
undefinedList last 20 traces
列出最近20条追踪数据
bash <base_directory>/scripts/query.sh traces 20
bash <base_directory>/scripts/query.sh traces 20
Get specific trace detail
获取特定追踪记录详情
bash <base_directory>/scripts/query.sh trace tr-abc123
bash <base_directory>/scripts/query.sh trace tr-abc123
List observations for a trace
列出某条追踪记录的观测数据
bash <base_directory>/scripts/query.sh observations 50 tr-abc123
bash <base_directory>/scripts/query.sh observations 50 tr-abc123
Quick summary of recent activity
快速查看近期活动摘要
bash <base_directory>/scripts/query.sh summary 10
undefinedbash <base_directory>/scripts/query.sh summary 10
undefinedCredentials
凭据
The script reads credentials from , , or environment variables:
.env.local.envLANGFUSE_PUBLIC_KEY=pk-lf-...
LANGFUSE_SECRET_KEY=sk-lf-...
LANGFUSE_BASE_URL=https://cloud.langfuse.com # optional, default脚本从、或环境变量中读取凭据:
.env.local.envLANGFUSE_PUBLIC_KEY=pk-lf-...
LANGFUSE_SECRET_KEY=sk-lf-...
LANGFUSE_BASE_URL=https://cloud.langfuse.com # 可选,默认值Requirements
要求
- (standard on macOS/Linux)
curl - for JSON parsing
jq
- (macOS/Linux系统默认自带)
curl - 用于JSON解析
jq
Output
输出
All commands return JSON (piped through jq). Use jq filters for specific fields:
bash
bash <base_directory>/scripts/query.sh traces 5 | jq '.data[].name'所有命令均返回JSON(通过jq管道处理)。可使用jq过滤器提取特定字段:
bash
bash <base_directory>/scripts/query.sh traces 5 | jq '.data[].name'