langtrace
安装方式
先用 Prompt 核对来源与依赖。也可下载安装包。
用 AI 助手安装
复制提示词,让助手先核对固定版本和依赖。
查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "langtrace":https://skillpi.com/zh/skills/deepskill-9d6c1348345eb9ba68a8810b9712cf6824348a2495abf08d2c052bdd60f3695e。安装前核对上游来源和版本:https://skillhub.cn/skills/user_3c6cb52e/trace-and-evaluate-llm-application-behavior-with-langtrace。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。
来源与配置
skillhub.cn
配置方式待核实
请查看原始来源中的适用工具、依赖和权限要求。
安装实测待补充
使用 OpenTelemetry 的 traces、metrics 和 evaluation views 来调试生产环境中的 LLM 工作流,为 Python 或 TypeScript 代理应用程序提供监控能力。
介绍来源: third_party · user_3c6cb52e · 1.0.0 参考来源
SkillPi 解读
- 实测状态
- 未测试
文件浏览
Frontmatter
name: langtrace
description: >-
You are an expert in Langtrace, the open-source observability platform for
LLM applications built on OpenTelemetry. You help developers trace LLM
calls, RAG pipelines, agent tool use, and chain executions with automatic
instrumentation for OpenAI, Anthropic, LangChain, LlamaIndex, and 20+
providers — providing cost tracking, latency analysis, token usage, and
quality evaluation in a self-hostable dashboard.
license: Apache-2.0
compatibility: ''
metadata:
author: terminal-skills
version: 1.0.0
category: AI & Machine Learning
tags:
- observability
- tracing
- llm
- opentelemetry
- monitoring
- evaluationLangtrace — Open-Source LLM Observability
You are an expert in Langtrace, the open-source observability platform for LLM applications built on OpenTelemetry. You help developers trace LLM calls, RAG pipelines, agent tool use, and chain executions with automatic instrumentation for OpenAI, Anthropic, LangChain, LlamaIndex, and 20+ providers — providing cost tracking, latency analysis, token usage, and quality evaluation in a self-hostable dashboard.
Core Capabilities
Auto-Instrumentation
// Automatic tracing — one line setup
import * as Langtrace from "@langtrase/typescript-sdk";
Langtrace.init({
api_key: process.env.LANGTRACE_API_KEY,
batch: true, // Batch spans for performance
instrumentations: {
openai: true,
anthropic: true,
langchain: true,
pinecone: true,
chromadb: true,
},
});
// Now all LLM calls are automatically traced
import OpenAI from "openai";
const openai = new OpenAI();
// This call is automatically instrumented — no code changes needed
const response = await openai.chat.completions.create({
model: "gpt-4o",
messages: [{ role: "user", content: "Explain quantum computing" }],
});
// Langtrace captures: model, tokens, latency, cost, input, output
Python with Decorators
from langtrace_python_sdk import langtrace, with_langtrace_root_span
from langtrace_python_sdk.utils.with_root_span import with_additional_attributes
langtrace.init(api_key="your-api-key")
@with_langtrace_root_span("rag-pipeline")
async def answer_question(query: str) -> str:
"""Full RAG pipeline — every step traced automatically."""
# Step 1: Embed query (traced)
embedding = await openai.embeddings.create(
model="text-embedding-3-small", input=query,
)
# Step 2: Vector search (traced if Pinecone/Chroma instrumented)
results = index.query(vector=embedding.data[0].embedding, top_k=5)
# Step 3: Generate answer (traced)
context = "\n".join([r.metadata["text"] for r in results.matches])
response = await openai.chat.completions.create(
model="gpt-4o",
messages=[
{"role": "system", "content": f"Answer using this context:\n{context}"},
{"role": "user", "content": query},
],
)
return response.choices[0].message.content
# Custom attributes for filtering
@with_additional_attributes({"user.tier": "pro", "feature": "search"})
@with_langtrace_root_span("search")
async def pro_search(query: str):
return await answer_question(query)
Evaluation
from langtrace_python_sdk import langtrace
from langtrace_python_sdk.utils.with_root_span import with_langtrace_root_span
# Run evaluations and track scores
@with_langtrace_root_span("evaluate-rag")
async def evaluate_rag(test_set: list[dict]):
results = []
for test in test_set:
answer = await answer_question(test["query"])
# Score with LLM-as-judge
eval_response = await openai.chat.completions.create(
model="gpt-4o",
messages=[{
"role": "user",
"content": f"""Score this answer 1-5 for relevance and accuracy.
Question: {test['query']}
Expected: {test['expected']}
Got: {answer}
Return JSON: {{"relevance": N, "accuracy": N}}""",
}],
)
scores = json.loads(eval_response.choices[0].message.content)
results.append({**scores, "query": test["query"]})
# All evaluation traces visible in Langtrace dashboard
avg_relevance = sum(r["relevance"] for r in results) / len(results)
avg_accuracy = sum(r["accuracy"] for r in results) / len(results)
return {"avg_relevance": avg_relevance, "avg_accuracy": avg_accuracy}
Installation
# TypeScript
npm install @langtrase/typescript-sdk
# Python
pip install langtrace-python-sdk
# Self-hosted
docker run -p 3000:3000 langtrace/langtrace-client
Best Practices
- One-line setup —
langtrace.init()auto-instruments all supported libraries; no per-call changes - OpenTelemetry native — Exports standard OTLP traces; send to Jaeger, Grafana, Datadog alongside Langtrace
- Cost tracking — Automatic cost calculation per model per call; aggregate by user, feature, or pipeline
- Root spans — Use
@with_langtrace_root_spanto group related calls into a single trace (RAG pipeline, agent run) - Custom attributes — Add user ID, feature flags, A/B test groups; filter and compare in dashboard
- Self-hosted — Deploy your own instance for data privacy; no vendor lock-in
- Evaluation tracking — Log evaluation scores alongside traces; track quality regressions over time
- Batch mode — Enable
batch: truefor production; reduces overhead by batching span exports
当前收录版本
1.0.0
质量评测
满分100 · 来自 SkillPi LAB 实验室的评测报告。
亮点
- 提供 LLM 应用的可观测性,解决生产环境中调试和监控的核心痛点
- 支持自动插桩、成本跟踪、延迟分析、令牌使用和质量评估
- 适用于 Python 和 TypeScript 代理应用程序,具有广泛实用价值
亮点
- 触发词精准完整,覆盖多种变体,边界清晰
- description 明确描述了 Skill 的核心功能和适用场景
亮点
- Phase/步骤清晰,有出口条件,含端到端示例
- frontmatter 完整,单文件≤500行
- 代码示例丰富,结构清晰,易于理解
亮点
- 工具来源明确,参数正确,覆盖主要异常
- 不可逆操作有确认机制
- 提供了详细的安装和最佳实践指南
取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。
正文静态检测
100 / 100 · skillpi-20261123-no-r3-v1
正文未命中当前规则。
分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。
权限与使用前检查
根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。
-
安装或获取外部依赖
使用官方来源并锁定版本,在隔离环境检查安装脚本。当前文档检查不覆盖后续下载的代码。
主文档提及 · 第 138, 141 行 -
账号、密钥或授权
使用专用、最小权限账号,不把密钥粘贴到公开内容或命令日志;核对接收数据的服务与租户。
主文档提及 · 第 38, 67 行
安全评级与访问范围
safe · 静态证据核验,不代表运行安全保证。
使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。
用户讨论
还没有已核实的点评。