mirror of
https://github.com/langflow-ai/langflow.git
synced 2026-07-24 02:05:11 +08:00
* fix: nightly now properly gets 1.9.0 branch (#12215) before it was attempting to pull release-notes as letters are alphanumerically after numbers when we sort -V then grab tail now we only look at branch names that follow the pattern '^release-[0-9]+\.[0-9]+\.[0-9]+$' * docs: add search icon (#12216) add-back-svg * initial-content * cut-1.8-release-and-include-next-version * stage-1.8.0-and-next --------- Co-authored-by: Adam-Aghili <149833988+Adam-Aghili@users.noreply.github.com>
55 lines
2.5 KiB
Plaintext
55 lines
2.5 KiB
Plaintext
---
|
||
title: Traces
|
||
slug: /traces
|
||
---
|
||
|
||
import Icon from "@site/src/components/icon";
|
||
import Tabs from '@theme/Tabs';
|
||
import TabItem from '@theme/TabItem';
|
||
|
||
Langflow’s **Traces** feature records detailed execution traces for your flows and components so that you can debug issues, measure latency, and track token usage without relying on external observability services.
|
||
|
||
Trace data is stored in the Langflow database in the `trace` and `span` tables.
|
||
Trace data is presented in the **Flow Activity** and **Trace Details** pages in the UI, and can be retrieved from the `/monitor/traces` API endpoint.
|
||
|
||
Traces are enabled by default.
|
||
To disable Langflow tracing and use a different tracing provider, set `LANGFLOW_NATIVE_TRACING` to `false`.
|
||
|
||
## What traces capture
|
||
|
||
The tracer records:
|
||
|
||
- **Flow-level traces**: A trace for each flow run, including total runtime and status.
|
||
- **Component spans**: Spans for each component in the flow, including inputs, outputs, latency, and errors.
|
||
- **LangChain spans**: Deeper spans for chains, tools, retrievers, and LLM calls, including model name and token usage where available.
|
||
|
||
Each span includes:
|
||
|
||
- **Name** and **type** (for example, chain, LLM, tool, retriever)
|
||
- **Start and end time** and **latency (ms)**
|
||
- **Inputs and outputs** (serialized)
|
||
- **Error details**, if the span failed
|
||
- **Attributes** such as token counts and model metadata
|
||
|
||
## View traces in the UI
|
||
|
||
To view traces in the Langflow UI, do the following:
|
||
1. Run a flow, such as the Simple Agent starter flow in the [Quickstart](/get-started-quickstart).
|
||
2. Click <Icon name="Activity" aria-hidden="true"/> **Traces**.
|
||
The **Flow Activity** page opens.
|
||
Each flow run is displayed as a single trace of all of its spans.
|
||
Flow runs can be sorted further by session ID, status, or time range.
|
||
Optionally, click <Icon name="Download" aria-hidden="true"/> **Download** to download a JSON file of that flow's trace to your local machine.
|
||
3. Click a flow run to open the **Trace Details** pane.
|
||
The **Trace Details** pane displays spans for your flow run, including a flow-level span for the entire run, and a span for each component.
|
||
Individual component spans include the component's inputs and outputs, timing, and token usage.
|
||
|
||
## Retrieve traces with the API
|
||
|
||
To programmatically query traces, use the `/monitor/traces` endpoints.
|
||
For full parameter details and code examples in Python, TypeScript, and curl, see [Monitor endpoints: Get traces](/api-monitor#get-traces).
|
||
|
||
## See also
|
||
|
||
- [Logs](/logging)
|
||
- [Monitor endpoints](/api-monitor) |