Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Self-hosted Langfuse: tracing 7% of my AI agents, and ClickHouse logging itself

说明与用途

作者自托管 Langfuse 以追踪 AI 代理,但最初仅在一个配置文件上启用追踪,导致可见性仅为 7%。通过为所有十个配置文件配置密钥和标签并优化 ClickHouse 日志,获得完整追踪数据并将磁盘使用量减少近一半。

问题

Only 7% of agent traffic was being traced, causing incomplete visibility into agent behavior and performance.

结果

All profiles now produce trace data, enabling role‑based cost and latency analysis; ClickHouse disk usage dropped by ~50 % by removing unused system logs.

工作流

  • Enable Langfuse plugin on each profile
  • Copy Langfuse API keys into each profile’s secret scope
  • Set Langfuse environment to profile name
  • Restart gateway and verify traces are tagged
  • Configure ClickHouse to remove unnecessary system log tables and set query_log TTL
  • Restart ClickHouse container and confirm logs stopped writing
  • Delete old log data to reclaim disk space

证据

Tracing was enabled on exactly one of ten profiles: the default chat one, with 91 calls. That's roughly 7% of the traffic.

来源

ClickHouse was using 6.03 GiB of disk. The actual Langfuse trace data in it was 2.2 MiB.

来源

The third step is the one that matters for later. Traces carry no profile tag of their own, so without it every trace lands in one undifferentiated pile.

来源

  • 记录日期: 2026-10-01T09:37:58.011Z