From 49381c55f69c7eb1ddde9020240d588f5910a13b Mon Sep 17 00:00:00 2001 From: Mendon Kissling <59585235+mendonk@users.noreply.github.com> Date: Thu, 6 Mar 2025 09:20:11 -0500 Subject: [PATCH] docs: Add Arize integration documentation to Langflow (#6876) * docs: Add Arize integration documentation to Langflow * Apply suggestions from code review Co-authored-by: KimberlyFields <46325568+KimberlyFields@users.noreply.github.com> --------- Co-authored-by: KimberlyFields <46325568+KimberlyFields@users.noreply.github.com> --- .../Integrations/Arize/integrations-arize.md | 54 +++++++++++++++++++ docs/sidebars.js | 1 + 2 files changed, 55 insertions(+) create mode 100644 docs/docs/Integrations/Arize/integrations-arize.md diff --git a/docs/docs/Integrations/Arize/integrations-arize.md b/docs/docs/Integrations/Arize/integrations-arize.md new file mode 100644 index 000000000..49dd7e28d --- /dev/null +++ b/docs/docs/Integrations/Arize/integrations-arize.md @@ -0,0 +1,54 @@ +--- +title: Integrate Arize with Langflow +slug: /integrations-arize +--- + +Arize is a tool built on [OpenTelemetry](https://opentelemetry.io/) and [OpenInference](https://docs.arize.com/phoenix/reference/open-inference) 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](https://docs.arize.com/arize), you need an **Arize Space ID** and **API API Key**. +* If you are using the open-source [Arize Phoenix platform](https://docs.arize.com/phoenix), you need an Arize Phoenix API key and a project name. + +## Connect Arize to Langflow + +1. To retrieve your **Arize Space ID** and **API API Key**, navigate to the [Arize dashboard](https://app.arize.com/). +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. + +```bash +export ARIZE_SPACE_ID= +export ARIZE_API_KEY= +``` + +6. Start your Langflow application with the values from the `.env` file. + +```bash +uv run langflow run --env-file .env +``` + +## Run a flow and view metrics in Arize + +1. In Langflow, select the [Simple agent](/starter-projects-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](https://app.arize.com/), 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](https://docs.arize.com/arize/llm-tracing/tracing). +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](https://docs.arize.com/arize/llm-datasets-and-experiments/datasets-and-experiments). \ No newline at end of file diff --git a/docs/sidebars.js b/docs/sidebars.js index fa78e5c63..1bab0442f 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -141,6 +141,7 @@ module.exports = { label: "Integrations", items: [ "Integrations/Apify/integrations-apify", + "Integrations/Arize/integrations-arize", "Integrations/integrations-assemblyai", "Integrations/Composio/integrations-composio", "Integrations/integrations-langfuse",