Skip to main content

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

Connect Arize to Langflow

  1. To retrieve your Arize Space ID and API API Key, navigate to the Arize dashboard.
  2. Click Settings, and then click Space Settings and Keys.
  3. Copy the SpaceID and API Key (Ingestion Service Account Key) values.
  4. Create a .env file in the root of your Langflow application.
  5. Add the ARIZE_SPACE_ID and ARIZE_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.

_10
export ARIZE_SPACE_ID=<your-arize-space-id>
_10
export ARIZE_API_KEY=<your-arize-api-key>

  1. Start your Langflow application with the values from the .env file.

_10
uv run langflow run --env-file .env

Run a flow and view metrics in Arize

  1. In Langflow, select the Simple agent starter project.
  2. In the Agent component's OpenAI API Key field, paste your OpenAI API key.
  3. Click Playground. Ask your Agent some questions to generate traffic.
  4. Navigate to the Arize dashboard, and then open your project. You may have to wait a few minutes for Arize to process the data.
  5. 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's AgentExecutor. The UUID trace is the trace of the Langflow components.
  6. To view traces, click the Traces tab. A trace is the complete journey of a request, made of multiple spans.
  7. 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.
  8. 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.
  9. To view a Dataset, click the Datasets tab, and then select your Dataset. For more on Datasets, see the Arize documentation.
Search