Token导航 LogoToken导航TokenDH.com
运维敏感数据clawhub未标认证来源可访问clear审计提醒

langfuse-trace-loggerlangfuse 跟踪记录器

Agent Skill

langfuse-trace-logger 用于补充运维相关能力,适合在 OpenClaw 中需要让 Agent 承接运维相关任务时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

2,717

周安装

111

GitHub Stars

公开资料未说明

下载量

870
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:langfuse-trace-logger(langfuse 跟踪记录器)
来源仓库:https://github.com/nissan/langfuse-trace-logger
安装命令:
openclaw skills install langfuse-trace-logger
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install langfuse-trace-logger

简介

将子代理任务记录为 Langfuse 跟踪,支持回放、评估与成本分析。

  • 适用于会话包装阶段的任务复盘与性能监控场景。
  • 通过 clawhub 安装,需在 .env 中配置 LangFuse 公钥和私钥。
  • 使用前请确保具备写入跟踪数据的权限,并注意敏感信息脱敏处理。
  • 建议结合标签系统分类日志,便于后续检索和分析。

SKILL.md

name
langfuse-trace-logger
version
1.0.0
description
Log subagent task completions as Langfuse traces for replay, evaluation, and cost analysis. Called during session-wrap Phase 4. Supports backfill, tag-based filtering, and replay-judge integration. Requires Python 3.11 via chatterbox-venv due to pydantic v1 compatibility.
metadata

Skill: langfuse-trace-logger

Purpose: Log subagent task completions as Langfuse traces for replay, evaluation, and cost analysis. Scope: Called by Loki at the end of every session wrap (Phase 4) for each significant subagent completion. Script: /Users/loki/.openclaw/workspace/scripts/langfuse-trace-logger.py


⚠️ CRITICAL: Python Version

Always use ~/.chatterbox-venv/bin/python3 (Python 3.11.15)

The langfuse SDK uses pydantic v1, which is incompatible with Python 3.14. Running with system Python (python3) or pyenv Python (3.14.x) causes silent failure — no import error, no exception, trace just doesn't appear in Langfuse UI. This will waste 30+ minutes of debugging.

# ✅ Correct
~/.chatterbox-venv/bin/python3 scripts/langfuse-trace-logger.py ...

# ❌ Wrong — silent failure on Python 3.14
python3 scripts/langfuse-trace-logger.py ...
/Users/loki/.pyenv/versions/3.14.3/bin/python3 scripts/langfuse-trace-logger.py ...

Basic Invocation

~/.chatterbox-venv/bin/python3 /Users/loki/.openclaw/workspace/scripts/langfuse-trace-logger.py \
  --session-id "$SESSION_ID" \
  --parent-id "agent:main" \
  --agent "kit" \
  --task "task-label-kebab-case" \
  --model "anthropic/claude-sonnet-4-6" \
  --status "completed" \
  --input "full task prompt given to agent (first 4000 chars)..." \
  --output "what the agent returned or accomplished..." \
  --duration 278 \
  --tokens 16900 \
  --project "reddi-agent-protocol" \
  --skills "product-tour-capture"

Trace Schema

FieldTypePurposeNotes
--session-idstringSubagent session keyUse actual subagent session key — enables lineage tracing
--parent-idstringParent session referenceAlways "agent:main" unless nested subagent
--agentstringAgent nameLowercase: kit, archie, sara, finn, quill, etc.
--taskstringTask label (kebab-case)Used for replay grouping: replay-judge.py --tag "task:kit-setup-rebuild"
--modelstringModel usede.g. anthropic/claude-sonnet-4-6, anthropic/claude-haiku-4-5
--statusstringOutcomecompleted / partial / failed
--inputstringFull task promptFirst 4000 chars — this is what gets replayed against other models in judge runs
--outputstringResult summaryAgent's output/result — this is what the judge scores
--durationintTime in secondsUsed for efficiency analysis and agent routing decisions
--tokensintTotal tokens usedUsed for cost analysis and budget governance
--projectstringProject slugMust match projects/<slug>/STATUS.md — enables project-level filtering
--skillsstringComma-separated skillse.g. "product-tour-capture,ffmpeg-studio" — enables skill effectiveness filtering

Tag Taxonomy

The logger automatically generates these tags from the fields above:

  • agent:kit — from --agent
  • model_family:claude-sonnet — derived from --model
  • project:reddi-agent-protocol — from --project
  • skill:product-tour-capture — one tag per skill in --skills
  • task:kit-setup-rebuild — from --task
  • status:completed — from --status

These tags power the replay-judge filter syntax.


Backfill Pattern

For retroactive logging when a session wrap was skipped or traces are missing.

Idempotent: Uses deterministic trace IDs based on date+agent+task hash. Safe to re-run — won't create duplicates.

# Preview first (dry run)
~/.chatterbox-venv/bin/python3 scripts/langfuse-backfill-historical.py \
  --from-date 2026-03-24 \
  --to-date 2026-03-24 \
  --dry-run

# Then run for real
~/.chatterbox-venv/bin/python3 scripts/langfuse-backfill-historical.py \
  --from-date 2026-03-24 \
  --to-date 2026-03-24

Data source: Backfill parses memory/YYYY-MM-DD.md files and extracts structured task outcome blocks. This is why the task outcome block format in memory files must be consistent — inconsistent format breaks parsing silently.

Backfill ID format: backfill-YYYY-MM-DD-<agent>-<task-slug> — deterministic, no duplicate risk.


Replay and Judge

# Report on all Kit traces (past 30 days)
~/.chatterbox-venv/bin/python3 scripts/replay-judge.py \
  --tag "agent:kit" --report

# Compare all Kit traces against Haiku (cost reduction analysis)
~/.chatterbox-venv/bin/python3 scripts/replay-judge.py \
  --tag "agent:kit" --models "claude-haiku-4-5" --judge "claude-haiku-4-5" --report

# Judge a specific trace
~/.chatterbox-venv/bin/python3 scripts/replay-judge.py \
  --trace-id "backfill-2026-03-24-kit-setup-rebuild" \
  --models "claude-haiku-4-5" --judge "claude-haiku-4-5"

# Filter by project
~/.chatterbox-venv/bin/python3 scripts/replay-judge.py \
  --tag "project:reddi-agent-protocol" --report

# Filter by skill
~/.chatterbox-venv/bin/python3 scripts/replay-judge.py \
  --tag "skill:product-tour-capture" --report

Verify Traces Appeared

After logging, verify in Langfuse UI: http://localhost:3100

Or check programmatically:

~/.chatterbox-venv/bin/python3 -c "
import subprocess
sk = subprocess.run(
    ['op', 'read', 'op://OpenClaw/Langfuse (Local)/credential'],
    capture_output=True, text=True
).stdout.strip()
from langfuse import Langfuse
lf = Langfuse(public_key='pk-lf-openclaw-local', secret_key=sk, host='http://localhost:3100')
traces = lf.client.trace.list(limit=5)
[print(t.name, t.id[:12]) for t in traces.data]
"

Expected output: last 5 trace names + truncated IDs. If blank, Python version issue (see warning above).


Langfuse Connection Details

SettingValue
UIhttp://localhost:3100
Public keypk-lf-openclaw-local
Secret keyop://OpenClaw/Langfuse (Local)/credential (1Password)
Also in 1Passwordop://OpenClaw/Langfuse (Local)/Secret Key
DockerAlways running (daemon service)

When to Call This Skill

This skill is called during Phase 4 (Traces) of the session-wrap playbook (playbooks/session-wrap/PLAYBOOK.md).

Call once per significant subagent completion. Use data from the task outcome blocks written in Phase 1 (memory file). Don't reconstruct from memory — read what you just wrote.

Minimum threshold for logging: Any subagent run that produced a deliverable (file written, API called, analysis produced). Skip: simple lookups, 1-line tool calls, failed attempts with no output.


Troubleshooting

SymptomCauseFix
Trace doesn't appear in UIWrong Python versionUse ~/.chatterbox-venv/bin/python3
No output, no errorSame — Python 3.14 pydantic v1 incompatibilitySame fix
ImportError: langfuse not foundWrong venvSame fix
Duplicate traces on backfillShouldn't happen — backfill is idempotentCheck if running logger + backfill both for same trace
op: command not found1Password CLI not in PATHRun from shell with OP_SERVICE_ACCOUNT_TOKEN set, or source ~/.zshrc first
Langfuse UI empty after loggingDocker daemon downdocker ps — restart Langfuse container if needed

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

72.91%
按下载量换算634

安全审计

VirusTotal

可疑

ClawScan

可疑

Static analysis

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills