1 / 10
Как делать end-to-end tracing LLM-запросов в production: model calls + tool calls + retrieval calls в одной trace?
End-to-end tracing для LLM — distributed tracing tree, где root span = user request, child spans покрывают каждый этап: embedding call, vector search, rerank, LLM generation, tool calls, post-processing. Без этого debug «почему ответ медленный / неточный» становится археологией по логам. Стек: Langfuse (Apache 2.0, open-source, self-host или cloud), LangSmith (LangChain экосистема), Helicone (proxy-style), Phoenix Arize (OpenInference spec), W&B Weave. Decorator-style instrumentation (@observe, traceable) auto-captures inputs/outputs/latency/tokens; manual spans для custom tool calls. Sampling: 100% staging, 10–20% prod + 100% errors.