← ClaudeAtlas

langfuse-tracinglisted

Use for any question or task about tracing, monitoring or debugging LLM calls in production, including having no record of what the model saw for a bad answer, or turning production traces into eval datasets. Adds Langfuse with @observe or startActiveObservation, records metadata, cost and latency, scores traces and manages prompts as code.
testland/qa-skills · ★ 0 · AI & Automation · score 72
Install: claude install-skill testland/qa-skills
# langfuse-tracing ## Overview [lf-gh]: https://github.com/langfuse/langfuse-python Langfuse is a production LLM observability platform (per [lf-gh][lf-gh]). ## Step 1 - Install Per [lf-gh][lf-gh]: ```bash pip install langfuse ``` For TypeScript: ```bash npm install @langfuse/tracing ``` Set up project credentials per Langfuse self-hosted or cloud project (`LANGFUSE_PUBLIC_KEY` + `LANGFUSE_SECRET_KEY` + `LANGFUSE_HOST`). ## Step 2 - Instrument with `@observe` Per [langfuse.com/docs/sdk/python/decorators][lf-py-deco]: [lf-py-deco]: https://langfuse.com/docs/sdk/python/decorators Python: ```python from langfuse import observe @observe(name="llm-call", as_type="generation") # auto-captures inputs, outputs, timings, errors async def my_async_llm_call(prompt_text): return "LLM response" ``` TypeScript - create an observation, do work inside it, then end it: ```typescript import { startActiveObservation } from "@langfuse/tracing"; const { observation, end } = startActiveObservation({ name: "llm-call", type: "generation", input: { prompt: promptText }, }); try { const result = await callMyLLM(promptText); observation.update({ output: result }); return result; } finally { end(); } ``` **Validation:** After your first instrumented call, open the Langfuse UI → Traces. You should see a new trace with nested observations, inputs, outputs, and timings. If no trace appears within ~30 s: - Confirm `LANGFUSE_PUBLIC_KEY`, `LANGFUSE_SECRET_KEY`, and `LA