跳到正文
Skillpedia
智能体48k · #5025

langfuse

它能做什么

Langfuse 是一个用来监控和分析 AI 应用运行情况的工具。它可以帮你查看 AI 执行的各个步骤,管理你给 AI 的指令,并检查它的回答是否正确。

适用场景

  • ✓当你需要看清 AI 应用内部发生了什么时。
  • ✓当你需要找出并修复 AI 应用中的错误时。
  • ✓当你想确保 AI 的回答稳定且质量高时。

技能链接

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/langfuse/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/langfuse/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“我该如何设置 Langfuse 来监控我的 Python 应用?”

每周 5 个新技能,1 分钟读完。

工作原理

Langfuse 的工作方式是在你的应用中添加一小段代码,用来记录重要信息。这些信息会被发送到 Langfuse 平台,你可以在那里查看和分析。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Langfuse

Instrument an existing LLM application with traceable, minimized observations and versioned evaluation inputs. Modified by AAS maintainers on 2026-09-05 to replace mixed legacy SDK examples with a current, bounded setup procedure; existing source attribution is preserved.

When to Use

Use when an application already needs Langfuse tracing, prompt management or evaluation, or when debugging missing/duplicated spans. Do not add an observability service merely because an LLM is present; start from the incident or product decision the data must support.

Inputs and prerequisites

  • Installed Python or JS SDK version, framework and runtime lifecycle.
  • The explicitly authorized Langfuse project/endpoint, credentials supplied through the project’s secret mechanism, and data retention/access policy.
  • An allowlist of observable fields and a synthetic request that contains no private content.
  • A defined verifier: expected parent/child spans, status, timing, model/prompt version and flush behavior.

Procedure

  1. Inspect the dependency lock and existing instrumentation. Do not mix old langfuse.trace(), langfuse.decorators or langfuse.callback examples with the current SDK without checking its migration guide.
  2. Choose one integration layer: direct SDK spans, a framework callback or OpenTelemetry instrumentation. Avoid tracing the same call twice through overlapping wrappers.
  3. Configure the approved endpoint and credentials outside source. Verify export permission before running an example: instrumentation can send inputs, outputs, metadata and exceptions externally.
  4. Start with explicit observations containing only synthetic or allowlisted values. Add correlation IDs only when their scope and privacy treatment are defined.
  5. Execute one success and one failure request; inspect the actual exported span tree and verify no sensitive fields escaped through nested metadata or third-party instrumentation.
  6. Flush in short-lived processes and test shutdown/timeouts. A returned SDK call does not by itself prove ingestion.
  7. Add prompt/evaluation metadata only after the trace boundary works. Pin the prompt version or record the exact resolved version; a mutable production label is not an immutable experiment input.

Minimal Python observation

The current Python SDK overview documents get_client() and context-managed observations. Use the API matching the installed SDK. After configuration and export authorization, this synthetic example creates one span and no LLM call:

from langfuse import get_client

client = get_client()
with client.start_as_current_observation(as_type="span", name="synthetic-health-check") as span:
    span.update(output={"status": "ok"})
client.flush()

Expected observation: one completed synthetic-health-check span in the intended project with the fixed status value. This skill does not claim that a live ingestion check has run. A wrong endpoint, missing credentials or exporter failure must be reported as a failed/unverified check.

Privacy and masking

Do not treat truncation as redaction. Prefer omitting raw prompts, user messages and tool payloads; inspect all configured exporters. Current Python SDKs provide mask_otel_spans for export-time transformation; the legacy mask hook covers a narrower set of SDK-created attributes. Choose the installed-version mechanism using the masking documentation, and test a synthetic secret in nested metadata and an exception. Collector-side filtering occurs after data leaves the application, so place it within the approved trust boundary.

Prompt management and evaluation

Record dataset revision, prompt version, model identifier, tool configuration and evaluator definition. Keep evaluator errors distinct from low scores. A judge response must pass a bounded schema and finite-range validation; never convert arbitrary model text directly with float() and call it measured quality. Calibrate judgments against reviewed examples and report disagreement. Separate user feedback from an automatic judge score.

…

常见问题

什么是 spans?

spans 就像是 AI 应用中单个事件的记录,它会显示发生了什么、何时发生,以及耗时多久。

Langfuse 会保护我的敏感数据吗?

会的。Langfuse 具备在发送监控数据前对敏感信息进行脱敏或省略的功能,以保护你的隐私。

Langfuse 能用于不同的编程语言吗?

可以。Langfuse 支持 Python 和 JavaScript 的集成,也支持 LangChain、LlamaIndex 等常用框架。

详情

作者的原始描述

Expert in Langfuse - the open-source LLM observability platform. Covers tracing, prompt management, evaluation, datasets, and integration with LangChain, LlamaIndex, and OpenAI. Essential for debugging, monitoring, and improving LLM applications in production.

repo: sickn33/agentic-awesome-skills

热度

GitHub 星标
48k
排名
#5025
许可证
MIT
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能