langflow/docs/docs/Integrations/Arize/integrations-arize.md
Mendon Kissling f261b739a9
docs: update arize phoenix variable (#7383)
* phoenix-api-key

* space

* add-tabs

* finish-sentence

* numbering

* code-review
2025-04-02 20:26:17 +00:00

4.1 KiB

title slug
Integrate Arize with Langflow /integrations-arize

import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem';

Arize is a tool built on OpenTelemetry and OpenInference for monitoring and optimizing LLM applications.

To add tracing to your Langflow application, add Arize environment variables to your Langflow application. Arize begins monitoring and collecting telemetry data from your LLM applications automatically.

Prerequisites

Connect Arize to Langflow

  1. To retrieve your Arize Space ID and Arize 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. Replace the following:
  • YOUR_ARIZE_SPACE_ID: the SpaceID value copied from Arize
  • YOUR_ARIZE_API_KEY: the API Key value copied from Arize
ARIZE_SPACE_ID=YOUR_ARIZE_SPACE_ID
ARIZE_API_KEY=YOUR_ARIZE_API_KEY
  1. Save the .env file.
  2. Start your Langflow application with the values from the .env file.
uv run langflow run --env-file .env
  1. To retrieve your Arize Phoenix API key, navigate to the Arize dashboard.
  2. Click API Key.
  3. Copy the API Key value.
  4. Create a .env file in the root of your Langflow application.
  5. Add the PHOENIX_API_KEY environment variable to your application instead. Replace YOUR_PHOENIX_API_KEY with the Arize Phoenix API key that you copied from the Arize Phoenix platform.
PHOENIX_API_KEY=YOUR_PHOENIX_API_KEY
  1. Save the .env file.
  2. Start your Langflow application with the values from the .env file.
uv run langflow run --env-file .env

For more information, see the Arize documentation.

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.