langfuse-trace-view

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Langfuse Trace View

Langfuse Trace 详情查看

Display detailed information for a specific trace.
展示特定追踪的详细信息。

Setup

配置步骤

Set the following environment variables before use:
VariableRequiredDescription
LANGFUSE_PUBLIC_KEY
YesLangfuse public key
LANGFUSE_SECRET_KEY
YesLangfuse secret key
LANGFUSE_HOST
or
LANGFUSE_BASE_URL
NoLangfuse host URL (default:
https://us.cloud.langfuse.com
)
使用前请设置以下环境变量:
变量是否必填说明
LANGFUSE_PUBLIC_KEY
Langfuse公钥
LANGFUSE_SECRET_KEY
Langfuse密钥
LANGFUSE_HOST
LANGFUSE_BASE_URL
Langfuse服务地址(默认值:
https://us.cloud.langfuse.com

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> --json
bash
npx tsx scripts/langfuse-trace-view.ts <traceId> --json

Output 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

字段说明

FieldDescription
IDTrace ID
NameTrace name
TimestampCreation timestamp
User IDUser ID
SessionSession ID
LatencyProcessing time (ms)
CostEstimated cost
TagsTag list
MetadataMetadata
InputTrace input
OutputTrace output
ObservationsChild spans (Generation, Span, etc.)
字段说明
ID追踪ID
Name追踪名称
Timestamp创建时间戳
User ID用户ID
Session会话ID
Latency处理时长(毫秒)
Cost预估成本
Tags标签列表
Metadata元数据
Input追踪输入
Output追踪输出
Observations子Span(生成、Span等)