> ## Documentation Index
> Fetch the complete documentation index at: https://enterprise-docs.dify.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Integrate with Phoenix

### What is Phoenix

[Arize Phoenix](https://arize.com/phoenix/) is the open-source, OpenTelemetry-based platform from [Arize AI](https://arize.com/?utm_source=dify-docs\&utm_medium=partner\&utm_campaign=partner-docs\&utm_content=integrate-phoenix-self-host) for observability, evaluation, prompt engineering, and experimentation with LLM workflows and agents.

Run Phoenix locally during development, self-host it on your own infrastructure (a single container is enough to start), or use Arize's hosted [Phoenix Cloud](#how-to-configure-phoenix-cloud).

If you need the full-featured platform built for production teams, AI-native companies, and enterprises, set up [Arize AX](https://arize.com/products/ax/) through the [Arize integration](https://enterprise-docs.dify.ai/en/3.14.x/use/monitor/integrations/integrate-arize.md) instead.

Once traces are flowing, see Arize's [agent evaluation guide](https://arize.com/ai-agents/agent-evaluation/) and [LLM evaluation guide](https://arize.com/resources/llm-evaluation/) for how to use them to debug failures, evaluate agent behavior, and monitor model quality.

### How to Configure Phoenix

For a self-hosted Phoenix instance without authentication, skip the account and API key steps below and leave **API Key** blank.

#### 1. Register/Login to [Phoenix](https://app.arize.com/auth/phoenix/signup)

#### 2. Get your Phoenix API Key

Retrieve your Phoenix API Key from the user menu at the top-right. Click on **API Key**, then on the API Key to copy it:

![Phoenix API Key](https://i.ibb.co/pB1W0pk8/dify-docs-phoenix-api-key.png)

#### 3. Integrate Phoenix with Dify

Configure Phoenix in the Dify application. Open the application you need to monitor, open **Monitoring** in the side menu, and select **Tracing app performance** on the page.

![Tracing App Performance](https://i.ibb.co/gMmXxfhQ/dify-docs-phoenix-in-use.png)

After clicking **Config**, enter the **Project**, an **API Key** if authentication is enabled, and your Phoenix instance's base URL in **Endpoint**, then save. Do not append `/v1/traces`; Dify adds the ingestion path.

![Configure Phoenix](https://i.ibb.co/jv6QFbp7/dify-docs-phoenix-config.png)

Once successfully saved, you can view the monitoring status on the current page.

![Configure Phoenix](https://i.ibb.co/HTJsj9x2/dify-docs-phoenix-in-service.png)

### How to Configure Phoenix Cloud

#### 1. Register/Login to [Phoenix Cloud](https://app.arize.com/auth/phoenix/signup)

#### 2. Create your Phoenix Space

You can create your Phoenix Space from the user menu at the top-right. Click on **Create Space**, then provide a unique URL identifier for your space:

![Phoenix Cloud Create Space](https://i.ibb.co/7JYPzZBf/dify-docs-phoenix-cloud-create-space.png)

Once successfully saved, you can view the space status on the overview page.

![Phoenix Cloud Space Overview](https://i.ibb.co/Z6RqMhhq/dify-docs-phoenix-cloud-space-overview.png)

#### 3. Create your Phoenix API Key

After launching your space, you can create your Phoenix API Key from the **Settings** option in the user menu at the bottom-left. Click on **System Key**, then provide a name for your Phoenix API Key:

![Phoenix Cloud API Key](https://i.ibb.co/SXMyX9K3/dify-docs-phoenix-cloud-api-key.png)

#### 4. Integrate Phoenix Cloud with Dify

Configure Phoenix in the Dify application. Open the application you need to monitor, open **Monitoring** in the side menu, and select **Tracing app performance** on the page.

![Tracing App Performance](https://i.ibb.co/gMmXxfhQ/dify-docs-phoenix-in-use.png)

After clicking **Config**, paste the **API Key** and **Project**, and enter the full Phoenix Cloud space URL in **Endpoint** (for example, `https://app.phoenix.arize.com/s/<space>`), then save.

![Configure Phoenix](https://i.ibb.co/jv6QFbp7/dify-docs-phoenix-config.png)

Once successfully saved, you can view the monitoring status on the current page.

![Configure Phoenix](https://i.ibb.co/HTJsj9x2/dify-docs-phoenix-in-service.png)

> [!NOTE]
>
> After saving and enabling tracing, run the app again and check for a new trace in the monitoring service. Delivery is asynchronous; saving the configuration alone does not confirm that a trace has arrived.
>
> With both deployment switches off, the new Agent app type and workflows using the [new Agent node](https://enterprise-docs.dify.ai/en/3.14.x/use/nodes/agent.md#new-agent) still send ordinary traces, including available inputs and outputs, but omit the Agent's internal model and tool calls.
>
> To collect those calls, ask your deployment administrator to turn on both deployment switches in the Helm values: `OPS_AGENT_TRACE_ENABLED` and `DIFY_AGENT_APPLICATION_TRACING_ENABLED`. See [LLMOps Trace Delivery](https://enterprise-docs.dify.ai/en/3.14.x/deploy/advanced-configuration/environment-variables.md#llmops-trace-delivery) for details.
>
> Once both deployment switches are on, **Capture content** is off by default for these apps: inputs, outputs, and most metadata are removed, and error text is redacted across the whole workflow. Enable it to send that content. Legacy Agent apps and workflows using only classic Agent nodes retain ordinary tracing.

### Monitoring Data List

The tables below describe ordinary traces. When both deployment switches are on, traces from the new Agent app type and from workflows containing a new Agent node use a new UUIDv7 trace ID, with source and tracing-run IDs retained as `dify.source.id` and `dify.tracing.run_id` attributes. For the new Agent app type, spans named `Agent attempt 1`, `Agent attempt 2`, and so on, with the internal model and tool calls, replace the ordinary `llm` span when **Capture Agent internals** is on. These traces leave out the separate moderation, suggested-question, and naming records.

Dify exports a hierarchy of operations: a message contains an `llm` call, and a Chatflow message contains its workflow and node operations. Native token usage is reported on model calls only.

Workflow apps take the trace ID from the workflow run ID, and all other app types from the message ID. When you call a Chatflow or Workflow app through the API with an `X-Trace-Id` header, that value takes its place. Trace IDs preserve the value of nonzero UUID or 32-character hexadecimal message IDs, workflow run IDs, and `X-Trace-Id` values; other values are hashed. Span IDs are derived.

Each span's `user.id` uses `end_user_session_id` when available, otherwise `user_id`. The separate `metadata.user_id` field keeps the Dify user record ID.

The detail lists below describe Dify's source records and metadata. Only the relevant, available values are exported; the raw records are not sent in full.

#### **Workflow/Chatflow Trace Information**

**Used to track workflows and chatflows**

<table>
  <thead>
    <tr>
      <th>Workflow</th>
      <th>Phoenix Trace</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>workflow\_run\_id</td>
      <td>metadata.workflow\_run\_id</td>
    </tr>

    <tr>
      <td>user\_id</td>
      <td>user.id (fallback); metadata.user\_id</td>
    </tr>

    <tr>
      <td>workflow</td>
      <td>name</td>
    </tr>

    <tr>
      <td>start\_time</td>
      <td>start\_time\_unix\_nano</td>
    </tr>

    <tr>
      <td>end\_time</td>
      <td>end\_time\_unix\_nano</td>
    </tr>

    <tr>
      <td>inputs</td>
      <td>input.value</td>
    </tr>

    <tr>
      <td>outputs</td>
      <td>output.value</td>
    </tr>

    <tr>
      <td>Model token consumption (LLM calls)</td>
      <td>llm.token\_count.prompt / completion / total</td>
    </tr>

    <tr>
      <td>metadata</td>
      <td>metadata</td>
    </tr>

    <tr>
      <td>error</td>
      <td>status.code / status.message</td>
    </tr>

    <tr>
      <td>Session ID</td>
      <td>session.id</td>
    </tr>
  </tbody>
</table>

**Workflow Trace Info**

* workflow\_id - Unique identifier of the workflow
* conversation\_id - Conversation ID
* workflow\_run\_id - ID of the current run
* tenant\_id - Tenant ID
* elapsed\_time - Time taken for the current run
* status - Run status
* version - Workflow version
* total\_tokens - Total tokens used in the current run
* file\_list - List of processed files
* triggered\_from - Source that triggered the current run
* workflow\_run\_inputs - Input data for the current run
* workflow\_run\_outputs - Output data for the current run
* error - Errors encountered during the current run
* query - Query used during the run
* workflow\_app\_log\_id - Workflow application log ID
* message\_id - Associated message ID
* start\_time - Start time of the run
* end\_time - End time of the run
* workflow node executions - Information about workflow node executions
* Metadata
  * workflow\_id - Unique identifier of the workflow
  * conversation\_id - Conversation ID
  * workflow\_run\_id - ID of the current run
  * tenant\_id - Tenant ID
  * elapsed\_time - Time taken for the current run
  * status - Run status
  * version - Workflow version
  * total\_tokens - Total tokens used in the current run
  * file\_list - List of processed files
  * triggered\_from - Source that triggered the current run

#### **Message Trace Information**

**Used to track LLM-related conversations**

<table>
  <thead>
    <tr>
      <th>Chat</th>
      <th>Phoenix Trace</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>message\_id</td>
      <td>trace\_id</td>
    </tr>

    <tr>
      <td>end\_user\_session\_id</td>
      <td>user.id; metadata.end\_user\_session\_id</td>
    </tr>

    <tr>
      <td>message</td>
      <td>name</td>
    </tr>

    <tr>
      <td>start\_time</td>
      <td>start\_time\_unix\_nano</td>
    </tr>

    <tr>
      <td>end\_time</td>
      <td>end\_time\_unix\_nano</td>
    </tr>

    <tr>
      <td>inputs</td>
      <td>input.value</td>
    </tr>

    <tr>
      <td>outputs</td>
      <td>output.value</td>
    </tr>

    <tr>
      <td>Model token consumption (LLM calls)</td>
      <td>llm.token\_count.prompt / completion / total</td>
    </tr>

    <tr>
      <td>metadata</td>
      <td>metadata</td>
    </tr>

    <tr>
      <td>Session ID</td>
      <td>session.id</td>
    </tr>
  </tbody>
</table>

**Message Trace Info**

* message\_id - Message ID
* message\_data - Message data
* end\_user\_session\_id - User session ID
* conversation\_model - Conversation mode
* message\_tokens - Number of tokens in the message
* answer\_tokens - Number of tokens in the answer
* total\_tokens - Total number of tokens in the message and answer
* error - Error information
* inputs - Input data
* outputs - Output data
* file\_list - List of processed files
* start\_time - Start time
* end\_time - End time
* conversation\_mode - Conversation mode
* Metadata
  * conversation\_id - Conversation ID
  * ls\_provider - Model provider
  * ls\_model\_name - Model ID
  * status - Message status
  * from\_end\_user\_id - ID of the sending user
  * from\_account\_id - ID of the sending account
  * agent\_based - Whether the message is agent-based
  * workflow\_run\_id - Workflow run ID
  * from\_source - Message source

#### **Moderation Trace Information**

**Used to track conversation moderation**

<table>
  <thead>
    <tr>
      <th>Moderation</th>
      <th>Phoenix Tool</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>user\_id</td>
      <td>user.id (fallback); metadata.user\_id</td>
    </tr>

    <tr>
      <td>moderation</td>
      <td>name</td>
    </tr>

    <tr>
      <td>start\_time</td>
      <td>start\_time\_unix\_nano</td>
    </tr>

    <tr>
      <td>end\_time</td>
      <td>end\_time\_unix\_nano</td>
    </tr>

    <tr>
      <td>inputs</td>
      <td>input.value</td>
    </tr>

    <tr>
      <td>action, flagged</td>
      <td>output.value</td>
    </tr>

    <tr>
      <td>metadata</td>
      <td>metadata</td>
    </tr>
  </tbody>
</table>

**Moderation Trace Info**

* message\_id - Message ID
* user\_id: User ID
* workflow\_app\_log\_id - Workflow application log ID
* inputs - Moderation input data
* message\_data - Message data
* flagged - Whether the content is flagged for attention
* action - Specific actions taken
* preset\_response - Preset response
* start\_time - Moderation start time
* end\_time - Moderation end time
* Metadata
  * message\_id - Message ID
  * action - Specific actions taken
  * preset\_response - Preset response

#### **Suggested Question Trace Information**

**Used to track suggested questions**

Sent as a tool span in the message's trace.

<table>
  <thead>
    <tr>
      <th>Suggested Question</th>
      <th>Phoenix Tool span</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>user\_id</td>
      <td>user.id (fallback); metadata.user\_id</td>
    </tr>

    <tr>
      <td>"suggested\_question"</td>
      <td>name</td>
    </tr>

    <tr>
      <td>start\_time</td>
      <td>start\_time\_unix\_nano</td>
    </tr>

    <tr>
      <td>end\_time</td>
      <td>end\_time\_unix\_nano</td>
    </tr>

    <tr>
      <td>inputs</td>
      <td>input.value</td>
    </tr>

    <tr>
      <td>suggested\_question</td>
      <td>output.value</td>
    </tr>

    <tr>
      <td>metadata</td>
      <td>metadata</td>
    </tr>
  </tbody>
</table>

**Message Trace Info**

* message\_id - Message ID
* message\_data - Message data
* inputs - Input content
* outputs - Output content
* start\_time - Start time
* end\_time - End time
* total\_tokens - Number of tokens
* status - Message status
* error - Error information
* from\_account\_id - ID of the sending account
* agent\_based - Whether the message is agent-based
* from\_source - Message source
* model\_provider - Model provider
* model\_id - Model ID
* suggested\_question - Suggested question
* level - Status level
* status\_message - Status message
* Metadata
  * message\_id - Message ID
  * ls\_provider - Model provider
  * ls\_model\_name - Model ID
  * status - Message status
  * from\_end\_user\_id - ID of the sending user
  * from\_account\_id - ID of the sending account
  * workflow\_run\_id - Workflow run ID
  * from\_source - Message source

#### **Dataset Retrieval Trace Information**

**Used to track knowledge base retrieval**

<table>
  <thead>
    <tr>
      <th>Dataset Retrieval</th>
      <th>Phoenix Retriever</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>user\_id</td>
      <td>user.id (fallback); metadata.user\_id</td>
    </tr>

    <tr>
      <td>"dataset\_retrieval"</td>
      <td>name</td>
    </tr>

    <tr>
      <td>start\_time</td>
      <td>start\_time\_unix\_nano</td>
    </tr>

    <tr>
      <td>end\_time</td>
      <td>end\_time\_unix\_nano</td>
    </tr>

    <tr>
      <td>inputs</td>
      <td>input.value</td>
    </tr>

    <tr>
      <td>documents</td>
      <td>output.value</td>
    </tr>

    <tr>
      <td>metadata</td>
      <td>metadata</td>
    </tr>

    <tr>
      <td>ID derived from message\_id</td>
      <td>parent\_span\_id</td>
    </tr>
  </tbody>
</table>

**Dataset Retrieval Trace Info**

* message\_id - Message ID
* inputs - Input content
* documents - Document data
* start\_time - Start time
* end\_time - End time
* message\_data - Message data
* Metadata
  * message\_id - Message ID
  * ls\_provider - Model provider
  * ls\_model\_name - Model ID
  * status - Message status
  * from\_end\_user\_id - ID of the sending user
  * from\_account\_id - ID of the sending account
  * agent\_based - Whether the message is agent-based
  * workflow\_run\_id - Workflow run ID
  * from\_source - Message source

#### **Tool Trace Information**

**Used to track tool invocation**

<table>
  <thead>
    <tr>
      <th>Tool</th>
      <th>Phoenix Tool</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>user\_id</td>
      <td>user.id (fallback); metadata.user\_id</td>
    </tr>

    <tr>
      <td>tool\_name</td>
      <td>name</td>
    </tr>

    <tr>
      <td>start\_time</td>
      <td>start\_time\_unix\_nano</td>
    </tr>

    <tr>
      <td>end\_time</td>
      <td>end\_time\_unix\_nano</td>
    </tr>

    <tr>
      <td>tool\_inputs</td>
      <td>input.value</td>
    </tr>

    <tr>
      <td>tool\_outputs</td>
      <td>output.value</td>
    </tr>

    <tr>
      <td>metadata</td>
      <td>metadata</td>
    </tr>
  </tbody>
</table>

#### **Tool Trace Info**

* message\_id - Message ID
* tool\_name - Tool name
* start\_time - Start time
* end\_time - End time
* tool\_inputs - Tool inputs
* tool\_outputs - Tool outputs
* message\_data - Message data
* error - Error information, if any
* inputs - Inputs for the message
* outputs - Outputs of the message
* tool\_config - Tool configuration
* time\_cost - Time cost
* tool\_parameters - Tool parameters
* file\_url - URL of the associated file
* Metadata
  * message\_id - Message ID
  * tool\_name - Tool name
  * tool\_inputs - Tool inputs
  * tool\_outputs - Tool outputs
  * tool\_config - Tool configuration
  * time\_cost - Time cost
  * error - Error information, if any
  * tool\_parameters - Tool parameters
  * message\_file\_id - Message file ID
  * created\_by\_role - Role of the creator
  * created\_user\_id - User ID of the creator

**Generate Name Trace Information**

**Used to track conversation title generation**

<table>
  <thead>
    <tr>
      <th>Generate Name</th>
      <th>Phoenix Tool</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>user\_id</td>
      <td>user.id (fallback); metadata.user\_id</td>
    </tr>

    <tr>
      <td>generate\_name</td>
      <td>name</td>
    </tr>

    <tr>
      <td>start\_time</td>
      <td>start\_time\_unix\_nano</td>
    </tr>

    <tr>
      <td>end\_time</td>
      <td>end\_time\_unix\_nano</td>
    </tr>

    <tr>
      <td>inputs</td>
      <td>input.value</td>
    </tr>

    <tr>
      <td>outputs</td>
      <td>output.value</td>
    </tr>

    <tr>
      <td>metadata</td>
      <td>metadata</td>
    </tr>
  </tbody>
</table>

**Generate Name Trace Info**

* conversation\_id - Conversation ID
* inputs - Input data
* outputs - Generated conversation name
* start\_time - Start time
* end\_time - End time
* tenant\_id - Tenant ID
* Metadata
  * conversation\_id - Conversation ID
  * tenant\_id - Tenant ID


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.