langfuse-trace-view
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseLangfuse Trace View
Langfuse Trace 详情查看
Display detailed information for a specific trace.
展示特定追踪的详细信息。
Setup
配置步骤
Set the following environment variables before use:
| Variable | Required | Description |
|---|---|---|
| Yes | Langfuse public key |
| Yes | Langfuse secret key |
| No | Langfuse host URL (default: |
使用前请设置以下环境变量:
| 变量 | 是否必填 | 说明 |
|---|---|---|
| 是 | Langfuse公钥 |
| 是 | Langfuse密钥 |
| 否 | Langfuse服务地址(默认值: |
When to Use
使用场景
- Checking specific trace details
- Viewing LLM input/output
- "Show me the details of this trace"
- Investigating by trace ID
- 查看特定追踪的详细信息
- 查看LLM的输入/输出
- 查询“展示该追踪的详细信息”
- 通过trace ID进行问题排查
Commands
命令说明
1. Get Trace Details
1. 获取追踪详情
bash
npx tsx scripts/langfuse-trace-view.ts <traceId>bash
npx tsx scripts/langfuse-trace-view.ts <traceId>2. JSON Output
2. 输出JSON格式结果
bash
npx tsx scripts/langfuse-trace-view.ts <traceId> --jsonbash
npx tsx scripts/langfuse-trace-view.ts <traceId> --jsonOutput Example
输出示例
Langfuse Trace Detail
=====================
ID: abc123-def456-ghi789
Name: librarian/chat
Timestamp: 2025-01-15 10:30:45
User ID: user-123
Session: lb:session-456
Latency: 1234ms
Cost: $0.0150
Tags: env:production
Metadata:
{
"projectId": "project-123",
"organizationId": "org-456"
}
Input:
{
"userMessage": "Search the knowledge base"
}
Output:
{
"response": "Here are the search results..."
}
Observations (3):
--------------------------------------------------------------------------------
[GENERATION] llm-call
Time: 10:30:46 Model: gpt-4o Cost: $0.0120 Tokens: in:150 out:200
Input: {"role": "user", ...}
Output: Here are the search results...
[SPAN] tool-execution
Time: 10:30:47 Model: - Cost: - Tokens: -Langfuse 追踪详情
=====================
ID: abc123-def456-ghi789
名称: librarian/chat
时间戳: 2025-01-15 10:30:45
用户ID: user-123
会话: lb:session-456
延迟: 1234ms
成本: $0.0150
标签: env:production
元数据:
{
"projectId": "project-123",
"organizationId": "org-456"
}
输入:
{
"userMessage": "搜索知识库"
}
输出:
{
"response": "以下是搜索结果..."
}
观测项 (3):
--------------------------------------------------------------------------------
[生成] llm-call
时间: 10:30:46 模型: gpt-4o 成本: $0.0120 令牌数: 输入:150 输出:200
输入: {"role": "user", ...}
输出: 以下是搜索结果...
[SPAN] 工具执行
时间: 10:30:47 模型: - 成本: - 令牌数: -Fields
字段说明
| Field | Description |
|---|---|
| ID | Trace ID |
| Name | Trace name |
| Timestamp | Creation timestamp |
| User ID | User ID |
| Session | Session ID |
| Latency | Processing time (ms) |
| Cost | Estimated cost |
| Tags | Tag list |
| Metadata | Metadata |
| Input | Trace input |
| Output | Trace output |
| Observations | Child spans (Generation, Span, etc.) |
| 字段 | 说明 |
|---|---|
| ID | 追踪ID |
| Name | 追踪名称 |
| Timestamp | 创建时间戳 |
| User ID | 用户ID |
| Session | 会话ID |
| Latency | 处理时长(毫秒) |
| Cost | 预估成本 |
| Tags | 标签列表 |
| Metadata | 元数据 |
| Input | 追踪输入 |
| Output | 追踪输出 |
| Observations | 子Span(生成、Span等) |