Integrate Arize with Langflow
Arize is a tool built on OpenTelemetry and OpenInference for monitoring and optimizing LLM applications.
To add tracing to your Langflow application, add the ARIZE_SPACE_ID
and ARIZE_API_KEY
environment variables to your Langflow application.
Prerequisites
- If you are using the standard Arize platform, you need an Arize Space ID and API API Key.
- If you are using the open-source Arize Phoenix platform, you need an Arize Phoenix API key and a project name.
Connect Arize to Langflow
- To retrieve your Arize Space ID and API API Key, navigate to the Arize dashboard.
- Click Settings, and then click Space Settings and Keys.
- Copy the SpaceID and API Key (Ingestion Service Account Key) values.
- Create a
.env
file in the root of your Langflow application. - Add the
ARIZE_SPACE_ID
andARIZE_API_KEY
environment variables to your Langflow application. You do not need to specify the Arize Project name if you're using the standard Arize platform. The Project name in Arize is the same as the Langflow Flow name.
_10export ARIZE_SPACE_ID=<your-arize-space-id>_10export ARIZE_API_KEY=<your-arize-api-key>
- Start your Langflow application with the values from the
.env
file.
_10uv run langflow run --env-file .env
Run a flow and view metrics in Arize
- In Langflow, select the Simple agent starter project.
- In the Agent component's OpenAI API Key field, paste your OpenAI API key.
- Click Playground. Ask your Agent some questions to generate traffic.
- Navigate to the Arize dashboard, and then open your project. You may have to wait a few minutes for Arize to process the data.
- The LLM Tracing tab shows metrics for your flow.
Each Langflow execution generates two traces in Arize.
The
AgentExecutor
trace is the Arize trace of Langchain'sAgentExecutor
. The UUID trace is the trace of the Langflow components. - To view traces, click the Traces tab. A trace is the complete journey of a request, made of multiple spans.
- To view Spans, select the Spans tab. A span is a single operation within a trace. For example, a span could be a single API call to OpenAI or a single function call to a custom tool. For more on traces, spans, and other metrics in Arize, see the Arize documentation.
- All metrics in the LLM Tracing tab can be added to Datasets. To add a span to a Dataset, click the Add to Dataset button.
- To view a Dataset, click the Datasets tab, and then select your Dataset. For more on Datasets, see the Arize documentation.