Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

tracing.mdx 2.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. ---
  2. sidebar_position: 9
  3. slug: /tracing
  4. ---
  5. # Tracing
  6. Observability & Tracing with Langfuse.
  7. ---
  8. :::info KUDOS
  9. This document is contributed by our community contributor [jannikmaierhoefer](https://github.com/jannikmaierhoefer). 👏
  10. :::
  11. RAGFlow ships with a built-in [Langfuse](https://langfuse.com) integration so that you can **inspect and debug every retrieval and generation step** of your RAG pipelines in near real-time.
  12. Langfuse stores traces, spans and prompt payloads in a purpose-built observability backend and offers filtering and visualisations on top.
  13. :::info NOTE
  14. • RAGFlow **≥ 0.19.0** (contains the Langfuse connector)
  15. • A Langfuse workspace (cloud or self-hosted) with a _Project Public Key_ and _Secret Key_
  16. :::
  17. ---
  18. ## 1. Collect your Langfuse credentials
  19. 1. Sign in to your Langfuse dashboard.
  20. 2. Open **Settings ▸ Projects** and either create a new project or select an existing one.
  21. 3. Copy the **Public Key** and **Secret Key**.
  22. 4. Note the Langfuse **host** (e.g. `https://cloud.langfuse.com`). Use the base URL of your own installation if you self-host.
  23. > The keys are _project-scoped_: one pair of keys is enough for all environments that should write into the same project.
  24. ---
  25. ## 2. Add the keys to RAGFlow
  26. RAGFlow stores the credentials _per tenant_. You can configure them either via the web UI or the HTTP API.
  27. 1. Log in to RAGFlow and click your avatar in the top-right corner.
  28. 2. Select **API ▸ Scroll down to the bottom ▸ Langfuse Configuration**.
  29. 3. Fill in you Langfuse **Host**, **Public Key** and **Secret Key**.
  30. 4. Click **Save**.
  31. ![Example RAGFlow trace in Langfuse](https://langfuse.com/images/docs/ragflow/ragflow-configuration.gif)
  32. Once saved, RAGFlow starts emitting traces automatically – no code change required.
  33. ---
  34. ## 3. Run a pipeline and watch the traces
  35. 1. Execute any chat or retrieval pipeline in RAGFlow (e.g. the Quickstart demo).
  36. 2. Open your Langfuse project ▸ **Traces**.
  37. 3. Filter by **name ~ `ragflow-*`** (RAGFlow prefixes each trace with `ragflow-`).
  38. For every user request you will see:
  39. • a **trace** representing the overall request
  40. • **spans** for retrieval, ranking and generation steps
  41. • the complete **prompts**, **retrieved documents** and **LLM responses** as metadata
  42. ![Example RAGFlow trace in Langfuse](https://langfuse.com/images/docs/ragflow/ragflow-trace-frame.png)
  43. ([Example trace in Langfuse](https://cloud.langfuse.com/project/cloramnkj0002jz088vzn1ja4/traces/0bde9629-4251-4386-b583-26101b8e7561?timestamp=2025-05-09T19%3A15%3A37.797Z&display=details&observation=823997d8-ac40-40f3-8e7b-8aa6753b499e))
  44. :::tip NOTE
  45. Use Langfuse's diff view to compare prompt versions or drill down into long-running retrievals to identify bottlenecks.
  46. :::