Dify observability integration

更新时间:
复制 MD 格式

After integrating your Dify application with ARMS, you can view traces for your LLM application. This lets you intuitively analyze inputs, outputs, token consumption, and other information for various operation types.

Note

This topic describes how to integrate Dify with Alibaba Cloud observability by using its native features. You can also use the Python agent to automatically instrument your Dify application. The Python agent, developed by Alibaba Cloud, provides automatic instrumentation for Python applications based on the OpenTelemetry standard. For more information, see Integrate LLM applications or inference services with ARMS.

Prerequisites

Dify version 1.6.0 or later

Step 1: Obtain endpoint and license key

  1. Log on to the ARMS console. In the left-side navigation pane, click Integration Center.

  2. On the Integration Center page, click the OpenTelemetry card in the Server-side Applications section.

  3. In the OpenTelemetry panel that appears, set the data reporting region to China (Heyuan) and the Reporting Method to gRPC.

    Set the Connection Method to Public Network. The public endpoint is http://tracing-cn-heyuan.arms.aliyuncs.com:8090. Copy the value of the authentication token. If you are using Go, remove the http:// prefix from the endpoint.

  4. Save the public endpoint (Endpoint) and the authentication token (License Key).

    Note

    For the Endpoint field in Dify, use the URL without the port number. For example: http://tracing-cn-heyuan.arms.aliyuncs.com.

Step 2: Configure performance tracing

  1. Log on to the Dify console and go to the Dify application that you want to monitor.

  2. In the left-side navigation pane, click Monitoring.

  3. Click Trace Application Performance, and then in the Cloud Monitoring section, click Configure.

    The Configure LLM Observability dialog box appears, with fields for License Key, Endpoint, and App Name.

  4. In the dialog box, enter the License Key and Endpoint that you obtained in Step 1. Specify a custom App Name, which will be the application name displayed in the ARMS console, and then click Save and Enable.

Step 3: View monitoring data

  • Method 1: Access the ARMS console from your Dify application

    In the Dify console, select your integrated application and go to its monitoring settings. In the Cloud Monitoring section, click View.

  • Method 2: View directly in the ARMS console

    In the ARMS console, navigate to the LLM Application Monitoring > Application List page and select your Dify application.

For a detailed explanation of the monitoring data, see LLM Application Details.