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