Skip to main content

What is Alibaba Cloud Monitor

Alibaba Cloud provides a fully managed, maintenance-free observability platform that enables one-click monitoring, tracing, and evaluation of Dify applications.
Alibaba Cloud Monitor natively supports Python/Golang/Java applications through LoongSuite agents and open-source OpenTelemetry agents. In addition to one-click monitoring of Dify LLM applications, it also supports end-to-end observability of Dify components and their upstream and downstream dependencies through non-invasive agents.For more details, please refer to the Cloud Monitor documentation.

How to Configure Alibaba Cloud Monitor

1. Get Alibaba Cloud Endpoint and License Key

  1. Log in to the ARMS console, and click Integration Center in the left navigation bar.
  2. In the Server-side Applications area, click the OpenTelemetry card.
  3. In the OpenTelemetry panel that appears, select gRPC as the export protocol, and select the connection method and region according to your actual deployment.
Get Alibaba Cloud access point
  1. Save the Public Endpoint and Authentication Token (License Key).
The Endpoint does not include a port number, for example http://tracing-cn-heyuan.arms.aliyun.com.

2. Configure Cloud Monitor in Dify

Prerequisites: Dify Cloud or Community Edition version must be ≥ v1.6.0
  1. Log in to the Dify console and navigate to the application you want to monitor.
  2. Open Monitoring in the left navigation bar.
  3. Click Tracing app performance, then click Configure in the Cloud Monitor area.
Configure Alibaba Cloud Monitor
  1. In the dialog that appears, enter the License Key and Endpoint obtained in step 1, and customize the App Name (the application name displayed in the ARMS console), then click Save & Enable.

View Monitoring Data in Alibaba Cloud Monitor

After configuration, debug or production data from applications in Dify can be monitored in Cloud Monitor.

Method 1: Jump to ARMS Console from Dify Application

In the Dify console, select an application with tracing enabled, go to Tracing Configuration, and click View in the Cloud Monitor area.

Method 2: View Directly in ARMS Console

Go to the corresponding Dify application in the LLM Application Monitoring > Application List page of the ARMS console.

Access More Data

Cloud Monitor provides multi-language non-invasive agents that support accessing various components of the Dify cluster to achieve end-to-end tracing.
Dify ComponentAgentDetails
NginxOpenTelemetry AgentUse OpenTelemetry for Nginx Tracing
APILoongSuite-Python Agentloongsuite-python-agent
SandboxLoongSuite-Go Agentloongsuite-go-agent
WorkerOpenTelemetry AgentSubmit Python Application Data via OpenTelemetry
Plugin-DaemonLoongSuite-Go Agentloongsuite-go-agent

Monitoring Data List

Cloud Monitor supports collecting data from Dify’s Workflow/Chatflow/Chat/Agent applications, including execution details of workflows and workflow nodes, covering model calls, tool calls, knowledge retrieval, execution details of various process nodes, as well as metadata such as conversations and user information.

Workflow/Chatflow Trace Information

WorkflowAlibaba Cloud Monitor Trace
workflow_idUnique identifier of the Workflow
conversation_idConversation ID
workflow_run_idID of this run
tenant_idTenant ID
elapsed_timeDuration of this run
statusRun status
versionWorkflow version
total_tokensTotal tokens used in this run
file_listList of processed files
triggered_fromSource that triggered this run
workflow_run_inputsInput data for this run
workflow_run_outputsOutput data for this run
errorErrors that occurred during this run
queryQuery used during runtime
workflow_app_log_idWorkflow application log ID
message_idAssociated message ID
start_timeRun start time
end_timeRun end time
Workflow Trace Metadata
  • workflow_id - Unique identifier of the Workflow
  • conversation_id - Conversation ID
  • workflow_run_id - ID of this run
  • tenant_id - Tenant ID
  • elapsed_time - Duration of this run
  • status - Run status
  • version - Workflow version
  • total_tokens - Total tokens used in this run
  • file_list - List of processed files
  • triggered_from - Trigger source

Message Trace Information

MessageAlibaba Cloud Monitor Trace
message_idMessage ID
message_dataMessage data
user_session_idUser’s session_id
conversation_modelConversation model
message_tokensNumber of tokens in the message
answer_tokensNumber of tokens in the answer
total_tokensTotal tokens in message and answer
errorError information
inputsInput data
outputsOutput data
file_listList of processed files
start_timeStart time
end_timeEnd time
message_file_dataFile data associated with the message
conversation_modeConversation mode
Message Trace Metadata
  • conversation_id - ID of the conversation to which the message belongs
  • 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 it is agent-based
  • workflow_run_id - Workflow run ID
  • from_source - Message source
  • message_id - Message ID

Dataset Retrieval Trace Information

Dataset RetrievalAlibaba Cloud Monitor Trace
message_idMessage ID
inputsInput content
documentsDocument data
start_timeStart time
end_timeEnd time
message_dataMessage data
Dataset Retrieval Trace 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 it is agent-based
  • workflow_run_id - Workflow run ID
  • from_source - Message source

Tool Trace Information

ToolAlibaba Cloud Monitor Trace
message_idMessage ID
tool_nameTool name
start_timeStart time
end_timeEnd time
tool_inputsTool inputs
tool_outputsTool outputs
message_dataMessage data
errorError information (if any)
inputsInput content of the message
outputsAnswer content of the message
tool_configTool configuration
time_costTime cost
tool_parametersTool parameters
file_urlURL of associated file
Tool Trace 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
  • tool_parameters - Tool parameters
  • message_file_id - Message file ID
  • created_by_role - Creator role
  • created_user_id - Creator user ID