diff --git a/docs.json b/docs.json index c37a76f9..2b102412 100644 --- a/docs.json +++ b/docs.json @@ -130,10 +130,11 @@ "pages": [ "en/use-dify/monitor/integrations/integrate-langsmith", "en/use-dify/monitor/integrations/integrate-langfuse", - "en/use-dify/monitor/integrations/integrate-arize", "en/use-dify/monitor/integrations/integrate-opik", + "en/use-dify/monitor/integrations/integrate-weave", + "en/use-dify/monitor/integrations/integrate-arize", "en/use-dify/monitor/integrations/integrate-phoenix", - "en/use-dify/monitor/integrations/integrate-weave" + "en/use-dify/monitor/integrations/integrate-aliyun" ] } ] @@ -504,10 +505,11 @@ "pages": [ "zh/use-dify/monitor/integrations/integrate-langsmith", "zh/use-dify/monitor/integrations/integrate-langfuse", - "zh/use-dify/monitor/integrations/integrate-arize", "zh/use-dify/monitor/integrations/integrate-opik", + "zh/use-dify/monitor/integrations/integrate-weave", + "zh/use-dify/monitor/integrations/integrate-arize", "zh/use-dify/monitor/integrations/integrate-phoenix", - "zh/use-dify/monitor/integrations/integrate-weave" + "zh/use-dify/monitor/integrations/integrate-aliyun" ] } ] @@ -877,10 +879,11 @@ "pages": [ "ja/use-dify/monitor/integrations/integrate-langsmith", "ja/use-dify/monitor/integrations/integrate-langfuse", - "ja/use-dify/monitor/integrations/integrate-arize", "ja/use-dify/monitor/integrations/integrate-opik", + "ja/use-dify/monitor/integrations/integrate-weave", + "ja/use-dify/monitor/integrations/integrate-arize", "ja/use-dify/monitor/integrations/integrate-phoenix", - "ja/use-dify/monitor/integrations/integrate-weave" + "ja/use-dify/monitor/integrations/integrate-aliyun" ] } ] @@ -1352,7 +1355,8 @@ "versions/3-0-x/zh/user-guide/monitoring/integrate-external-ops-tools/integrate-langfuse", "versions/3-0-x/zh/user-guide/monitoring/integrate-external-ops-tools/integrate-langsmith", "versions/3-0-x/zh/user-guide/monitoring/integrate-external-ops-tools/integrate-opik", - "versions/3-0-x/zh/user-guide/monitoring/integrate-external-ops-tools/integrate-weave" + "versions/3-0-x/zh/user-guide/monitoring/integrate-external-ops-tools/integrate-weave", + "versions/3-0-x/zh/user-guide/monitoring/integrate-external-ops-tools/integrate-aliyun" ] }, "versions/3-0-x/zh/user-guide/monitoring/analysis" @@ -1546,7 +1550,8 @@ "versions/3-0-x/en/user-guide/monitoring/integrate-external-ops-tools/integrate-langsmith", "versions/3-0-x/en/user-guide/monitoring/integrate-external-ops-tools/integrate-langfuse", "versions/3-0-x/en/user-guide/monitoring/integrate-external-ops-tools/integrate-opik", - "versions/3-0-x/en/user-guide/monitoring/integrate-external-ops-tools/integrate-weave" + "versions/3-0-x/en/user-guide/monitoring/integrate-external-ops-tools/integrate-weave", + "versions/3-0-x/en/user-guide/monitoring/integrate-external-ops-tools/integrate-aliyun" ] } ] @@ -1704,7 +1709,8 @@ "group": "外部Opsツールの統合", "pages": [ "versions/legacy/ja/user-guide/monitoring/integrate-external-ops-tools/integrate-langfuse", - "versions/legacy/ja/user-guide/monitoring/integrate-external-ops-tools/integrate-langsmith" + "versions/legacy/ja/user-guide/monitoring/integrate-external-ops-tools/integrate-langsmith", + "versions/legacy/ja/user-guide/monitoring/integrate-external-ops-tools/integrate-aliyun" ] } ] @@ -1914,7 +1920,8 @@ "versions/3-0-x/zh/user-guide/monitoring/integrate-external-ops-tools/integrate-langfuse", "versions/3-0-x/zh/user-guide/monitoring/integrate-external-ops-tools/integrate-langsmith", "versions/3-0-x/zh/user-guide/monitoring/integrate-external-ops-tools/integrate-opik", - "versions/3-0-x/zh/user-guide/monitoring/integrate-external-ops-tools/integrate-weave" + "versions/3-0-x/zh/user-guide/monitoring/integrate-external-ops-tools/integrate-weave", + "versions/3-0-x/zh/user-guide/monitoring/integrate-external-ops-tools/integrate-aliyun" ] }, "versions/3-0-x/zh/user-guide/monitoring/analysis" @@ -2102,7 +2109,8 @@ "versions/3-0-x/en/user-guide/monitoring/integrate-external-ops-tools/integrate-langsmith", "versions/3-0-x/en/user-guide/monitoring/integrate-external-ops-tools/integrate-langfuse", "versions/3-0-x/en/user-guide/monitoring/integrate-external-ops-tools/integrate-opik", - "versions/3-0-x/en/user-guide/monitoring/integrate-external-ops-tools/integrate-weave" + "versions/3-0-x/en/user-guide/monitoring/integrate-external-ops-tools/integrate-weave", + "versions/3-0-x/en/user-guide/monitoring/integrate-external-ops-tools/integrate-aliyun" ] } ] @@ -2254,7 +2262,8 @@ "group": "外部Opsツールの統合", "pages": [ "versions/legacy/ja/user-guide/monitoring/integrate-external-ops-tools/integrate-langfuse", - "versions/legacy/ja/user-guide/monitoring/integrate-external-ops-tools/integrate-langsmith" + "versions/legacy/ja/user-guide/monitoring/integrate-external-ops-tools/integrate-langsmith", + "versions/legacy/ja/user-guide/monitoring/integrate-external-ops-tools/integrate-aliyun" ] } ] @@ -2647,7 +2656,8 @@ "versions/3-0-x/en/user-guide/monitoring/integrate-external-ops-tools/integrate-langsmith", "versions/3-0-x/en/user-guide/monitoring/integrate-external-ops-tools/integrate-langfuse", "versions/3-0-x/en/user-guide/monitoring/integrate-external-ops-tools/integrate-opik", - "versions/3-0-x/en/user-guide/monitoring/integrate-external-ops-tools/integrate-weave" + "versions/3-0-x/en/user-guide/monitoring/integrate-external-ops-tools/integrate-weave", + "versions/3-0-x/en/user-guide/monitoring/integrate-external-ops-tools/integrate-aliyun" ] } ] @@ -2797,7 +2807,8 @@ "group": "外部Opsツールの統合", "pages": [ "versions/legacy/ja/user-guide/monitoring/integrate-external-ops-tools/integrate-langfuse", - "versions/legacy/ja/user-guide/monitoring/integrate-external-ops-tools/integrate-langsmith" + "versions/legacy/ja/user-guide/monitoring/integrate-external-ops-tools/integrate-langsmith", + "versions/legacy/ja/user-guide/monitoring/integrate-external-ops-tools/integrate-aliyun" ] } ] diff --git a/en/use-dify/monitor/integrations/integrate-aliyun.mdx b/en/use-dify/monitor/integrations/integrate-aliyun.mdx new file mode 100644 index 00000000..7f81eab5 --- /dev/null +++ b/en/use-dify/monitor/integrations/integrate-aliyun.mdx @@ -0,0 +1,396 @@ +--- +title: Integrate with Alibaba Cloud Monitor +sidebarTitle: Alibaba Cloud Monitor +--- + +## 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](https://github.com/alibaba/loongsuite-python-agent) 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](https://www.alibabacloud.com/help/en/cms/cloudmonitor-1-0/product-overview/what-is-cloudmonitor?spm=a3c0i.63551.2277339270.1.76c7112eeKEvSr). + + +*** + +## How to Configure Alibaba Cloud Monitor + +### 1. Get Alibaba Cloud Endpoint and License Key + +1. Log in to the [ARMS console](https://account.alibabacloud.com/login/login.htm?spm=5176.12901015-2.0.0.68d74b84XRatpU), 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](https://dify-public-resources.oss-cn-hangzhou.aliyuncs.com/dify-doc/get_endpoint.png) + +4. 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](https://dify-public-resources.oss-cn-hangzhou.aliyuncs.com/dify-doc/config_cms.png) + +4. 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 Component | Agent | Details | +|----------------|-------|---------| +| Nginx | OpenTelemetry Agent | [Use OpenTelemetry for Nginx Tracing](https://www.alibabacloud.com/help/en/opentelemetry/user-guide/use-opentelemetry-to-perform-tracing-analysis-on-nginx?spm=a2c63.l28256.help-menu-search-90275.d_1) | +| API | LoongSuite-Python Agent | [loongsuite-python-agent](https://github.com/alibaba/loongsuite-python-agent/blob/main/README.md) | +| Sandbox | LoongSuite-Go Agent | [loongsuite-go-agent](https://github.com/alibaba/loongsuite-go-agent/blob/main/README.md) | +| Worker | OpenTelemetry Agent | [Submit Python Application Data via OpenTelemetry](https://www.alibabacloud.com/help/en/opentelemetry/user-guide/use-managed-service-for-opentelemetry-to-submit-the-trace-data-of-python-applications?spm=a2c63.p38356.help-menu-90275.d_2_0_5_0.18ee53a4EGoGuS) | +| Plugin-Daemon | LoongSuite-Go Agent | [loongsuite-go-agent](https://github.com/alibaba/loongsuite-go-agent/blob/main/README.md) | + +*** + +## 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 diff --git a/en/use-dify/monitor/integrations/integrate-arize.mdx b/en/use-dify/monitor/integrations/integrate-arize.mdx index 32714300..016f2127 100644 --- a/en/use-dify/monitor/integrations/integrate-arize.mdx +++ b/en/use-dify/monitor/integrations/integrate-arize.mdx @@ -1,5 +1,6 @@ --- -title: Arize +title: Integrate with Arize +sidebarTitle: Arize --- diff --git a/en/use-dify/monitor/integrations/integrate-langfuse.mdx b/en/use-dify/monitor/integrations/integrate-langfuse.mdx index 69b53999..85c97fa4 100644 --- a/en/use-dify/monitor/integrations/integrate-langfuse.mdx +++ b/en/use-dify/monitor/integrations/integrate-langfuse.mdx @@ -1,5 +1,6 @@ --- -title: Langfuse +title: Integrate with Langfuse +sidebarTitle: Langfuse --- ### What is Langfuse diff --git a/en/use-dify/monitor/integrations/integrate-langsmith.mdx b/en/use-dify/monitor/integrations/integrate-langsmith.mdx index 8e741460..e2f54082 100644 --- a/en/use-dify/monitor/integrations/integrate-langsmith.mdx +++ b/en/use-dify/monitor/integrations/integrate-langsmith.mdx @@ -1,5 +1,6 @@ --- -title: LangSmith +title: Integrate with LangSmith +sidebarTitle: LangSmith --- diff --git a/en/use-dify/monitor/integrations/integrate-opik.mdx b/en/use-dify/monitor/integrations/integrate-opik.mdx index 71570581..e9ec52d2 100644 --- a/en/use-dify/monitor/integrations/integrate-opik.mdx +++ b/en/use-dify/monitor/integrations/integrate-opik.mdx @@ -1,5 +1,6 @@ --- -title: Opik +title: Integrate with Opik +sidebarTitle: Opik --- diff --git a/en/use-dify/monitor/integrations/integrate-phoenix.mdx b/en/use-dify/monitor/integrations/integrate-phoenix.mdx index 11e400dd..8638bbba 100644 --- a/en/use-dify/monitor/integrations/integrate-phoenix.mdx +++ b/en/use-dify/monitor/integrations/integrate-phoenix.mdx @@ -1,5 +1,6 @@ --- -title: Phoenix +title: Integrate with Phoenix +sidebarTitle: Phoenix --- diff --git a/en/use-dify/monitor/integrations/integrate-weave.mdx b/en/use-dify/monitor/integrations/integrate-weave.mdx index 728996d9..03c58c2c 100644 --- a/en/use-dify/monitor/integrations/integrate-weave.mdx +++ b/en/use-dify/monitor/integrations/integrate-weave.mdx @@ -1,5 +1,6 @@ --- -title: W&B Weave +title: Integrate with W&B Weave +sidebarTitle: W&B Weave description: Dify Cloud | Community version ≥ v1.3.1 --- diff --git a/ja/use-dify/monitor/integrations/integrate-aliyun.mdx b/ja/use-dify/monitor/integrations/integrate-aliyun.mdx new file mode 100644 index 00000000..92930068 --- /dev/null +++ b/ja/use-dify/monitor/integrations/integrate-aliyun.mdx @@ -0,0 +1,395 @@ +--- +title: Alibaba Cloud Monitorの統合 +--- + +## Alibaba Cloud Monitorとは + +Alibaba Cloudは、Difyアプリケーションのワンクリック監視、トレース、評価を可能にする、フルマネージドかつメンテナンス不要のオブザーバビリティプラットフォームを提供します。 + + + Alibaba Cloud Monitorは、[LoongSuite](https://github.com/alibaba/loongsuite-python-agent)エージェントやオープンソースのOpenTelemetryエージェントを通じて、Python/Golang/Javaアプリケーションをネイティブにサポートします。Dify LLMアプリケーションのワンクリック監視に加え、非侵入型エージェントによるDifyコンポーネントおよびその上下流依存関係のエンドツーエンドの可観測性もサポートします。 + + 詳細は[Cloud Monitorドキュメント](https://www.alibabacloud.com/help/en/cms/cloudmonitor-1-0/product-overview/what-is-cloudmonitor?spm=a3c0i.63551.2277339270.1.76c7112eeKEvSr)をご参照ください。 + + +*** + +## Alibaba Cloud Monitorの設定方法 + +### 1. Alibaba Cloudのエンドポイントとライセンスキーの取得 + +1. [ARMSコンソール](https://account.alibabacloud.com/login/login.htm?spm=5176.12901015-2.0.0.68d74b84XRatpU)にログインし、左側のナビゲーションバーで**Integration Center**をクリックします。 +2. **Server-side Applications**エリアで**OpenTelemetry**カードをクリックします。 +3. 表示された**OpenTelemetry**パネルで、エクスポートプロトコルとして**gRPC**を選択し、実際のデプロイに応じて接続方法とリージョンを選択します。 + +![Alibaba Cloudアクセスポイントの取得](https://dify-public-resources.oss-cn-hangzhou.aliyuncs.com/dify-doc/get_endpoint.png) + +4. **Public Endpoint**と**Authentication Token (License Key)**を保存します。 + + + エンドポイントにはポート番号が含まれていません(例: `http://tracing-cn-heyuan.arms.aliyun.com`)。 + + +### 2. DifyでCloud Monitorを設定 + + + **前提条件**: Dify CloudまたはCommunity Editionのバージョンがv1.6.0以上である必要があります。 + + +1. Difyコンソールにログインし、監視したいアプリケーションに移動します。 +2. 左側のナビゲーションバーで**Monitoring**を開きます。 +3. **Tracing app performance**をクリックし、**Cloud Monitor**エリアで**Configure**をクリックします。 + +![Alibaba Cloud Monitorの設定](https://dify-public-resources.oss-cn-hangzhou.aliyuncs.com/dify-doc/config_cms.png) + +4. 表示されたダイアログで、手順1で取得した**License Key**と**Endpoint**を入力し、**App Name**(ARMSコンソールに表示されるアプリケーション名)をカスタマイズして**Save & Enable**をクリックします。 + +*** + +## Alibaba Cloud Monitorでの監視データの表示 + +設定後、Difyのアプリケーションからのデバッグまたは本番データはCloud Monitorで監視できます。 + +### 方法1: DifyアプリケーションからARMSコンソールにジャンプ + +Difyコンソールでトレースが有効になっているアプリケーションを選択し、**Tracing Configuration**に移動して、**Cloud Monitor**エリアの**View**をクリックします。 + +### 方法2: ARMSコンソールで直接表示 + +ARMSコンソールの**LLM Application Monitoring > Application List**ページで、対応するDifyアプリケーションに移動します。 + +*** + +## より多くのデータにアクセス + +Cloud Monitorは、Difyクラスターのさまざまなコンポーネントにアクセスしてエンドツーエンドのトレースを実現するマルチランゲージの非侵入型エージェントを提供します。 + +| Difyコンポーネント | エージェント | 詳細 | +|----------------|-------|---------| +| Nginx | OpenTelemetry Agent | [NginxトレースにOpenTelemetryを使用](https://www.alibabacloud.com/help/en/opentelemetry/user-guide/use-opentelemetry-to-perform-tracing-analysis-on-nginx?spm=a2c63.l28256.help-menu-search-90275.d_1) | +| API | LoongSuite-Python Agent | [loongsuite-python-agent](https://github.com/alibaba/loongsuite-python-agent/blob/main/README.md) | +| Sandbox | LoongSuite-Go Agent | [loongsuite-go-agent](https://github.com/alibaba/loongsuite-go-agent/blob/main/README.md) | +| Worker | OpenTelemetry Agent | [OpenTelemetryを介してPythonアプリケーションデータを送信](https://www.alibabacloud.com/help/en/opentelemetry/user-guide/use-managed-service-for-opentelemetry-to-submit-the-trace-data-of-python-applications?spm=a2c63.p38356.help-menu-90275.d_2_0_5_0.18ee53a4EGoGuS) | +| Plugin-Daemon | LoongSuite-Go Agent | [loongsuite-go-agent](https://github.com/alibaba/loongsuite-go-agent/blob/main/README.md) | + +*** + +## 監視データリスト + +Cloud Monitorは、DifyのWorkflow/Chatflow/Chat/Agentアプリケーションからデータを収集することをサポートしており、ワークフローおよびワークフローノードの実行詳細、モデル呼び出し、ツール呼び出し、知識取得、さまざまなプロセスノードの実行詳細、会話やユーザー情報などのメタデータをカバーしています。 + +### ワークフロー/Chatflowトレース情報 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
WorkflowAlibaba Cloud Monitor Trace
workflow\_idワークフローの一意の識別子
conversation\_id会話ID
workflow\_run\_idこの実行のID
tenant\_idテナントID
elapsed\_timeこの実行の所要時間
status実行ステータス
versionワークフローのバージョン
total\_tokensこの実行で使用されたトークンの総数
file\_list処理されたファイルのリスト
triggered\_fromこの実行をトリガーしたソース
workflow\_run\_inputsこの実行の入力データ
workflow\_run\_outputsこの実行の出力データ
errorこの実行中に発生したエラー
query実行時に使用されたクエリ
workflow\_app\_log\_idワークフローアプリケーションログID
message\_id関連するメッセージID
start\_time実行開始時刻
end\_time実行終了時刻
+ +**ワークフロートレースメタデータ** + +* workflow\_id - ワークフローの一意の識別子 +* conversation\_id - 会話ID +* workflow\_run\_id - この実行のID +* tenant\_id - テナントID +* elapsed\_time - この実行の所要時間 +* status - 実行ステータス +* version - ワークフローのバージョン +* total\_tokens - この実行で使用されたトークンの総数 +* file\_list - 処理されたファイルのリスト +* triggered\_from - トリガーソース + +### メッセージトレース情報 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MessageAlibaba Cloud Monitor Trace
message\_idメッセージID
message\_dataメッセージデータ
user\_session\_idユーザーのsession\_id
conversation\_model会話モデル
message\_tokensメッセージ内のトークン数
answer\_tokens回答内のトークン数
total\_tokensメッセージと回答のトークンの総数
errorエラー情報
inputs入力データ
outputs出力データ
file\_list処理されたファイルのリスト
start\_time開始時刻
end\_time終了時刻
message\_file\_dataメッセージに関連するファイルデータ
conversation\_mode会話モード
+ +**メッセージトレースメタデータ** + +* conversation\_id - メッセージが属する会話のID +* ls\_provider - モデルプロバイダー +* ls\_model\_name - モデルID +* status - メッセージステータス +* from\_end\_user\_id - 送信ユーザーのID +* from\_account\_id - 送信アカウントのID +* agent\_based - エージェントベースかどうか +* workflow\_run\_id - ワークフロー実行ID +* from\_source - メッセージソース +* message\_id - メッセージID + +### データセット取得トレース情報 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Dataset RetrievalAlibaba Cloud Monitor Trace
message\_idメッセージID
inputs入力コンテンツ
documentsドキュメントデータ
start\_time開始時刻
end\_time終了時刻
message\_dataメッセージデータ
+ +**データセット取得トレースメタデータ** + +* message\_id - メッセージID +* ls\_provider - モデルプロバイダー +* ls\_model\_name - モデルID +* status - メッセージステータス +* from\_end\_user\_id - 送信ユーザーのID +* from\_account\_id - 送信アカウントのID +* agent\_based - エージェントベースかどうか +* workflow\_run\_id - ワークフロー実行ID +* from\_source - メッセージソース + +### ツールトレース情報 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ToolAlibaba Cloud Monitor Trace
message\_idメッセージID
tool\_nameツール名
start\_time開始時刻
end\_time終了時刻
tool\_inputsツール入力
tool\_outputsツール出力
message\_dataメッセージデータ
errorエラー情報(該当する場合)
inputsメッセージの入力コンテンツ
outputsメッセージの回答コンテンツ
tool\_configツール設定
time\_costコスト時間
tool\_parametersツールパラメータ
file\_url関連ファイルのURL
+ +**ツールトレースメタデータ** + +* message\_id - メッセージID +* tool\_name - ツール名 +* tool\_inputs - ツール入力 +* tool\_outputs - ツール出力 +* tool\_config - ツール設定 +* time\_cost - コスト時間 +* error - エラー情報 +* tool\_parameters - ツールパラメータ +* message\_file\_id - メッセージファイルID +* created\_by\_role - 作成者の役割 +* created\_user\_id - 作成者のユーザーID \ No newline at end of file diff --git a/versions/3-0-x/en/user-guide/monitoring/integrate-external-ops-tools/README.mdx b/versions/3-0-x/en/user-guide/monitoring/integrate-external-ops-tools/README.mdx index c34fc537..fa357bc7 100644 --- a/versions/3-0-x/en/user-guide/monitoring/integrate-external-ops-tools/README.mdx +++ b/versions/3-0-x/en/user-guide/monitoring/integrate-external-ops-tools/README.mdx @@ -1,5 +1,6 @@ --- -title: Integrate External Ops Tools +title: Integrate with External Ops Tools +sidebarTitle: Overview --- diff --git a/versions/3-0-x/en/user-guide/monitoring/integrate-external-ops-tools/integrate-aliyun.mdx b/versions/3-0-x/en/user-guide/monitoring/integrate-external-ops-tools/integrate-aliyun.mdx new file mode 100644 index 00000000..7f81eab5 --- /dev/null +++ b/versions/3-0-x/en/user-guide/monitoring/integrate-external-ops-tools/integrate-aliyun.mdx @@ -0,0 +1,396 @@ +--- +title: Integrate with Alibaba Cloud Monitor +sidebarTitle: Alibaba Cloud Monitor +--- + +## 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](https://github.com/alibaba/loongsuite-python-agent) 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](https://www.alibabacloud.com/help/en/cms/cloudmonitor-1-0/product-overview/what-is-cloudmonitor?spm=a3c0i.63551.2277339270.1.76c7112eeKEvSr). + + +*** + +## How to Configure Alibaba Cloud Monitor + +### 1. Get Alibaba Cloud Endpoint and License Key + +1. Log in to the [ARMS console](https://account.alibabacloud.com/login/login.htm?spm=5176.12901015-2.0.0.68d74b84XRatpU), 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](https://dify-public-resources.oss-cn-hangzhou.aliyuncs.com/dify-doc/get_endpoint.png) + +4. 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](https://dify-public-resources.oss-cn-hangzhou.aliyuncs.com/dify-doc/config_cms.png) + +4. 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 Component | Agent | Details | +|----------------|-------|---------| +| Nginx | OpenTelemetry Agent | [Use OpenTelemetry for Nginx Tracing](https://www.alibabacloud.com/help/en/opentelemetry/user-guide/use-opentelemetry-to-perform-tracing-analysis-on-nginx?spm=a2c63.l28256.help-menu-search-90275.d_1) | +| API | LoongSuite-Python Agent | [loongsuite-python-agent](https://github.com/alibaba/loongsuite-python-agent/blob/main/README.md) | +| Sandbox | LoongSuite-Go Agent | [loongsuite-go-agent](https://github.com/alibaba/loongsuite-go-agent/blob/main/README.md) | +| Worker | OpenTelemetry Agent | [Submit Python Application Data via OpenTelemetry](https://www.alibabacloud.com/help/en/opentelemetry/user-guide/use-managed-service-for-opentelemetry-to-submit-the-trace-data-of-python-applications?spm=a2c63.p38356.help-menu-90275.d_2_0_5_0.18ee53a4EGoGuS) | +| Plugin-Daemon | LoongSuite-Go Agent | [loongsuite-go-agent](https://github.com/alibaba/loongsuite-go-agent/blob/main/README.md) | + +*** + +## 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 diff --git a/versions/3-0-x/en/user-guide/monitoring/integrate-external-ops-tools/integrate-langfuse.mdx b/versions/3-0-x/en/user-guide/monitoring/integrate-external-ops-tools/integrate-langfuse.mdx index d49c04d2..a8b6295b 100644 --- a/versions/3-0-x/en/user-guide/monitoring/integrate-external-ops-tools/integrate-langfuse.mdx +++ b/versions/3-0-x/en/user-guide/monitoring/integrate-external-ops-tools/integrate-langfuse.mdx @@ -1,5 +1,6 @@ --- -title: Integrate Langfuse +title: Integrate with Langfuse +sidebarTitle: Langfuse --- ### What is Langfuse diff --git a/versions/3-0-x/en/user-guide/monitoring/integrate-external-ops-tools/integrate-langsmith.mdx b/versions/3-0-x/en/user-guide/monitoring/integrate-external-ops-tools/integrate-langsmith.mdx index e34d1879..e2f54082 100644 --- a/versions/3-0-x/en/user-guide/monitoring/integrate-external-ops-tools/integrate-langsmith.mdx +++ b/versions/3-0-x/en/user-guide/monitoring/integrate-external-ops-tools/integrate-langsmith.mdx @@ -1,5 +1,6 @@ --- -title: Integrate LangSmith +title: Integrate with LangSmith +sidebarTitle: LangSmith --- diff --git a/versions/3-0-x/en/user-guide/monitoring/integrate-external-ops-tools/integrate-opik.mdx b/versions/3-0-x/en/user-guide/monitoring/integrate-external-ops-tools/integrate-opik.mdx index d4bbc592..e9ec52d2 100644 --- a/versions/3-0-x/en/user-guide/monitoring/integrate-external-ops-tools/integrate-opik.mdx +++ b/versions/3-0-x/en/user-guide/monitoring/integrate-external-ops-tools/integrate-opik.mdx @@ -1,5 +1,6 @@ --- -title: Integrate Opik +title: Integrate with Opik +sidebarTitle: Opik --- diff --git a/versions/3-0-x/en/user-guide/monitoring/integrate-external-ops-tools/integrate-weave.mdx b/versions/3-0-x/en/user-guide/monitoring/integrate-external-ops-tools/integrate-weave.mdx index 4edf8b4d..5c217ae0 100644 --- a/versions/3-0-x/en/user-guide/monitoring/integrate-external-ops-tools/integrate-weave.mdx +++ b/versions/3-0-x/en/user-guide/monitoring/integrate-external-ops-tools/integrate-weave.mdx @@ -1,9 +1,10 @@ --- -title: Integrate W&B Weave +title: Integrate with W&B Weave +sidebarTitle: W&B Weave description: Dify Cloud | Community version ≥ v1.3.1 --- -### What is W&b Weave +### What is W&B Weave Weights & Biases (W&B) Weave is a framework for tracking, experimenting with, evaluating, deploying, and improving LLM-based applications. Designed for flexibility and scalability, Weave supports every stage of your LLM application development workflow. diff --git a/versions/3-0-x/zh/user-guide/monitoring/integrate-external-ops-tools/integrate-aliyun.mdx b/versions/3-0-x/zh/user-guide/monitoring/integrate-external-ops-tools/integrate-aliyun.mdx index e61107cd..06a932f5 100644 --- a/versions/3-0-x/zh/user-guide/monitoring/integrate-external-ops-tools/integrate-aliyun.mdx +++ b/versions/3-0-x/zh/user-guide/monitoring/integrate-external-ops-tools/integrate-aliyun.mdx @@ -1,18 +1,18 @@ --- -title: 集成 阿里云 云监控 +title: 集成阿里云云监控 --- -## 什么是 阿里云云监控 +## 什么是阿里云云监控 阿里云提供的全托管免运维可观测平台,一键开启 Dify 应用的监控追踪和评估。 阿里云云监控原生支持 Python/Golang/Java 应用通过 [LoongSuite](https://github.com/alibaba/loongsuite-python-agent) 探针 & 开源 OpenTelemetry 探针接入,在一键开启 Dify 大模型应用监控外,还支持通过无侵入探针对 Dify 组件及其上下游依赖的全链路可观测。 -更多详情,请参考 [云监控](https://help.aliyun.com/zh/cms/cloudmonitor-2-0/user-guide/model-application)。 +更多详情,请参考 [阿里云官方文档](https://help.aliyun.com/zh/cms/cloudmonitor-2-0/user-guide/model-application)。 -## 如何配置 云监控 +## 如何配置云监控 ### 1. 获取阿里云 Endpoint 和 License Key @@ -26,7 +26,7 @@ title: 集成 阿里云 云监控 > **说明** > Endpoint 不带端口号,例如 `http://tracing-cn-heyuan.arms.aliyuncs.com`。 -### 2. 将 云监控 与 Dify 集成 +### 2. 将云监控与 Dify 集成 > **📌 前提条件** > Dify Cloud | 社区版本号需 ≥ v1.6.0 @@ -39,9 +39,7 @@ title: 集成 阿里云 云监控 4. 在弹出的对话框中输入步骤 1 获取的 **License Key** 和 **Endpoint**,并自定义 **App Name**(ARMS 控制台显示的应用名称),然后单击 **保存并启用**。 - - -## 在 云监控 中查看监控数据 +## 在云监控中查看监控数据 配置完成后,Dify 内应用的调试或生产数据可以在 **云监控** 中进行监控。 diff --git a/versions/legacy/ja/user-guide/monitoring/integrate-external-ops-tools/integrate-aliyun.mdx b/versions/legacy/ja/user-guide/monitoring/integrate-external-ops-tools/integrate-aliyun.mdx new file mode 100644 index 00000000..38d8ad5f --- /dev/null +++ b/versions/legacy/ja/user-guide/monitoring/integrate-external-ops-tools/integrate-aliyun.mdx @@ -0,0 +1,395 @@ +--- +title: Alibaba Cloud Monitorとの統合 +--- + +## Alibaba Cloud Monitorとは + +Alibaba Cloudは、Difyアプリケーションのワンクリック監視、トレース、評価を可能にする、フルマネージドかつメンテナンス不要のオブザーバビリティプラットフォームを提供します。 + + + Alibaba Cloud Monitorは、[LoongSuite](https://github.com/alibaba/loongsuite-python-agent)エージェントやオープンソースのOpenTelemetryエージェントを通じて、Python/Golang/Javaアプリケーションをネイティブにサポートします。Dify LLMアプリケーションのワンクリック監視に加え、非侵入型エージェントによるDifyコンポーネントおよびその上下流依存関係のエンドツーエンドの可観測性もサポートします。 + + 詳細は[Cloud Monitorドキュメント](https://www.alibabacloud.com/help/en/cms/cloudmonitor-1-0/product-overview/what-is-cloudmonitor?spm=a3c0i.63551.2277339270.1.76c7112eeKEvSr)をご参照ください。 + + +*** + +## Alibaba Cloud Monitorの設定方法 + +### 1. Alibaba Cloudのエンドポイントとライセンスキーの取得 + +1. [ARMSコンソール](https://account.alibabacloud.com/login/login.htm?spm=5176.12901015-2.0.0.68d74b84XRatpU)にログインし、左側のナビゲーションバーで**Integration Center**をクリックします。 +2. **Server-side Applications**エリアで**OpenTelemetry**カードをクリックします。 +3. 表示された**OpenTelemetry**パネルで、エクスポートプロトコルとして**gRPC**を選択し、実際のデプロイに応じて接続方法とリージョンを選択します。 + +![Alibaba Cloudアクセスポイントの取得](https://dify-public-resources.oss-cn-hangzhou.aliyuncs.com/dify-doc/get_endpoint.png) + +4. **Public Endpoint**と**Authentication Token (License Key)**を保存します。 + + + エンドポイントにはポート番号が含まれていません(例: `http://tracing-cn-heyuan.arms.aliyun.com`)。 + + +### 2. DifyでCloud Monitorを設定 + + + **前提条件**: Dify CloudまたはCommunity Editionのバージョンがv1.6.0以上である必要があります。 + + +1. Difyコンソールにログインし、監視したいアプリケーションに移動します。 +2. 左側のナビゲーションバーで**Monitoring**を開きます。 +3. **Tracing app performance**をクリックし、**Cloud Monitor**エリアで**Configure**をクリックします。 + +![Alibaba Cloud Monitorの設定](https://dify-public-resources.oss-cn-hangzhou.aliyuncs.com/dify-doc/config_cms.png) + +4. 表示されたダイアログで、手順1で取得した**License Key**と**Endpoint**を入力し、**App Name**(ARMSコンソールに表示されるアプリケーション名)をカスタマイズして**Save & Enable**をクリックします。 + +*** + +## Alibaba Cloud Monitorでの監視データの表示 + +設定後、Difyのアプリケーションからのデバッグまたは本番データはCloud Monitorで監視できます。 + +### 方法1: DifyアプリケーションからARMSコンソールにジャンプ + +Difyコンソールでトレースが有効になっているアプリケーションを選択し、**Tracing Configuration**に移動して、**Cloud Monitor**エリアの**View**をクリックします。 + +### 方法2: ARMSコンソールで直接表示 + +ARMSコンソールの**LLM Application Monitoring > Application List**ページで、対応するDifyアプリケーションに移動します。 + +*** + +## より多くのデータにアクセス + +Cloud Monitorは、Difyクラスターのさまざまなコンポーネントにアクセスしてエンドツーエンドのトレースを実現するマルチランゲージの非侵入型エージェントを提供します。 + +| Difyコンポーネント | エージェント | 詳細 | +|----------------|-------|---------| +| Nginx | OpenTelemetry Agent | [NginxトレースにOpenTelemetryを使用](https://www.alibabacloud.com/help/en/opentelemetry/user-guide/use-opentelemetry-to-perform-tracing-analysis-on-nginx?spm=a2c63.l28256.help-menu-search-90275.d_1) | +| API | LoongSuite-Python Agent | [loongsuite-python-agent](https://github.com/alibaba/loongsuite-python-agent/blob/main/README.md) | +| Sandbox | LoongSuite-Go Agent | [loongsuite-go-agent](https://github.com/alibaba/loongsuite-go-agent/blob/main/README.md) | +| Worker | OpenTelemetry Agent | [OpenTelemetryを介してPythonアプリケーションデータを送信](https://www.alibabacloud.com/help/en/opentelemetry/user-guide/use-managed-service-for-opentelemetry-to-submit-the-trace-data-of-python-applications?spm=a2c63.p38356.help-menu-90275.d_2_0_5_0.18ee53a4EGoGuS) | +| Plugin-Daemon | LoongSuite-Go Agent | [loongsuite-go-agent](https://github.com/alibaba/loongsuite-go-agent/blob/main/README.md) | + +*** + +## 監視データリスト + +Cloud Monitorは、DifyのWorkflow/Chatflow/Chat/Agentアプリケーションからデータを収集することをサポートしており、ワークフローおよびワークフローノードの実行詳細、モデル呼び出し、ツール呼び出し、知識取得、さまざまなプロセスノードの実行詳細、会話やユーザー情報などのメタデータをカバーしています。 + +### ワークフロー/Chatflowトレース情報 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
WorkflowAlibaba Cloud Monitor Trace
workflow\_idワークフローの一意の識別子
conversation\_id会話ID
workflow\_run\_idこの実行のID
tenant\_idテナントID
elapsed\_timeこの実行の所要時間
status実行ステータス
versionワークフローのバージョン
total\_tokensこの実行で使用されたトークンの総数
file\_list処理されたファイルのリスト
triggered\_fromこの実行をトリガーしたソース
workflow\_run\_inputsこの実行の入力データ
workflow\_run\_outputsこの実行の出力データ
errorこの実行中に発生したエラー
query実行時に使用されたクエリ
workflow\_app\_log\_idワークフローアプリケーションログID
message\_id関連するメッセージID
start\_time実行開始時刻
end\_time実行終了時刻
+ +**ワークフロートレースメタデータ** + +* workflow\_id - ワークフローの一意の識別子 +* conversation\_id - 会話ID +* workflow\_run\_id - この実行のID +* tenant\_id - テナントID +* elapsed\_time - この実行の所要時間 +* status - 実行ステータス +* version - ワークフローのバージョン +* total\_tokens - この実行で使用されたトークンの総数 +* file\_list - 処理されたファイルのリスト +* triggered\_from - トリガーソース + +### メッセージトレース情報 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MessageAlibaba Cloud Monitor Trace
message\_idメッセージID
message\_dataメッセージデータ
user\_session\_idユーザーのsession\_id
conversation\_model会話モデル
message\_tokensメッセージ内のトークン数
answer\_tokens回答内のトークン数
total\_tokensメッセージと回答のトークンの総数
errorエラー情報
inputs入力データ
outputs出力データ
file\_list処理されたファイルのリスト
start\_time開始時刻
end\_time終了時刻
message\_file\_dataメッセージに関連するファイルデータ
conversation\_mode会話モード
+ +**メッセージトレースメタデータ** + +* conversation\_id - メッセージが属する会話のID +* ls\_provider - モデルプロバイダー +* ls\_model\_name - モデルID +* status - メッセージステータス +* from\_end\_user\_id - 送信ユーザーのID +* from\_account\_id - 送信アカウントのID +* agent\_based - エージェントベースかどうか +* workflow\_run\_id - ワークフロー実行ID +* from\_source - メッセージソース +* message\_id - メッセージID + +### データセット取得トレース情報 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Dataset RetrievalAlibaba Cloud Monitor Trace
message\_idメッセージID
inputs入力コンテンツ
documentsドキュメントデータ
start\_time開始時刻
end\_time終了時刻
message\_dataメッセージデータ
+ +**データセット取得トレースメタデータ** + +* message\_id - メッセージID +* ls\_provider - モデルプロバイダー +* ls\_model\_name - モデルID +* status - メッセージステータス +* from\_end\_user\_id - 送信ユーザーのID +* from\_account\_id - 送信アカウントのID +* agent\_based - エージェントベースかどうか +* workflow\_run\_id - ワークフロー実行ID +* from\_source - メッセージソース + +### ツールトレース情報 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ToolAlibaba Cloud Monitor Trace
message\_idメッセージID
tool\_nameツール名
start\_time開始時刻
end\_time終了時刻
tool\_inputsツール入力
tool\_outputsツール出力
message\_dataメッセージデータ
errorエラー情報(該当する場合)
inputsメッセージの入力コンテンツ
outputsメッセージの回答コンテンツ
tool\_configツール設定
time\_costコスト時間
tool\_parametersツールパラメータ
file\_url関連ファイルのURL
+ +**ツールトレースメタデータ** + +* message\_id - メッセージID +* tool\_name - ツール名 +* tool\_inputs - ツール入力 +* tool\_outputs - ツール出力 +* tool\_config - ツール設定 +* time\_cost - コスト時間 +* error - エラー情報 +* tool\_parameters - ツールパラメータ +* message\_file\_id - メッセージファイルID +* created\_by\_role - 作成者の役割 +* created\_user\_id - 作成者のユーザーID \ No newline at end of file diff --git a/zh/use-dify/monitor/integrations/integrate-aliyun.mdx b/zh/use-dify/monitor/integrations/integrate-aliyun.mdx new file mode 100644 index 00000000..06a932f5 --- /dev/null +++ b/zh/use-dify/monitor/integrations/integrate-aliyun.mdx @@ -0,0 +1,188 @@ +--- +title: 集成阿里云云监控 +--- + +## 什么是阿里云云监控 + +阿里云提供的全托管免运维可观测平台,一键开启 Dify 应用的监控追踪和评估。 + + +阿里云云监控原生支持 Python/Golang/Java 应用通过 [LoongSuite](https://github.com/alibaba/loongsuite-python-agent) +探针 & 开源 OpenTelemetry 探针接入,在一键开启 Dify 大模型应用监控外,还支持通过无侵入探针对 Dify 组件及其上下游依赖的全链路可观测。 +更多详情,请参考 [阿里云官方文档](https://help.aliyun.com/zh/cms/cloudmonitor-2-0/user-guide/model-application)。 + + +## 如何配置云监控 + +### 1. 获取阿里云 Endpoint 和 License Key + +1. 登录 [ARMS 控制台](https://arms.console.aliyun.com/),在左侧导航栏单击 **接入中心**。 +2. 在 **服务端应用** 区域单击 **OpenTelemetry** 卡片。 +3. 在弹出的 **OpenTelemetry** 面板中选择数据上报方式为 **gRPC**,并依据实际部署情况选择连接方式和地域。 + + ![](https://help-static-aliyun-doc.aliyuncs.com/assets/img/zh-CN/3938280571/p976945.png) + +4. 保存 **公网接入点(Endpoint)** 和 **鉴权 Token(License Key)**。 +> **说明** +> Endpoint 不带端口号,例如 `http://tracing-cn-heyuan.arms.aliyuncs.com`。 + +### 2. 将云监控与 Dify 集成 + +> **📌 前提条件** +> Dify Cloud | 社区版本号需 ≥ v1.6.0 + +1. 登录 **Dify 控制台**,并进入需要监控的 Dify 应用。 +2. 在左侧导航栏单击 **监测**。 +3. 单击 **追踪应用性能**,然后在 **云监控** 区域单击 **配置**。 + + ![](https://help-static-aliyun-doc.aliyuncs.com/assets/img/zh-CN/9647222571/p984812.png) + +4. 在弹出的对话框中输入步骤 1 获取的 **License Key** 和 **Endpoint**,并自定义 **App Name**(ARMS 控制台显示的应用名称),然后单击 **保存并启用**。 + +## 在云监控中查看监控数据 + +配置完成后,Dify 内应用的调试或生产数据可以在 **云监控** 中进行监控。 + +### 方式一:从 Dify 应用跳转 ARMS 控制台 + +在 Dify 控制台选择已开启应用追踪的应用,进入 **追踪配置**,在 **云监控** 区域单击 **查看**。 + +![](https://help-static-aliyun-doc.aliyuncs.com/assets/img/zh-CN/9647222571/p984818.png) + +### 方式二:直接在 ARMS 控制台查看 + +在 ARMS 控制台的 **LLM 应用监控 > 应用列表** 页面进入对应的 Dify 应用。 + +## 接入更多数据 + +云监控提供了多语言无侵入探针,支持接入Dify集群的各个组件,实现全链路追踪。 + +| Dify 组件 | 探针 | 详情 | +|---------------|--------------------|----------------| +| Nginx | OpenTelemetry 探针 | [使用OpenTelemetry对Nginx进行链路追踪](https://help.aliyun.com/zh/opentelemetry/user-guide/use-opentelemetry-to-perform-tracing-analysis-on-nginx) | +| Api | LoongSuite-Python 探针 | [loongsuite-python-agent](https://github.com/alibaba/loongsuite-python-agent/blob/main/README.md) | +| Sandbox | LoongSuite-Go 探针 | [loongsuite-go-agent](https://github.com/alibaba/loongsuite-go-agent/blob/main/README.md) | +| Worker | OpenTelemetry 探针 | [通过OpenTelemetry上报Python应用数据](https://help.aliyun.com/zh/opentelemetry/user-guide/use-managed-service-for-opentelemetry-to-submit-the-trace-data-of-python-applications) | +| Plugin-Daemon | LoongSuite-Go 探针 | [loongsuite-go-agent](https://github.com/alibaba/loongsuite-go-agent/blob/main/README.md) | + +## 监测数据清单 + +云监控支持采集Dify的Workflow/Chatflow/Chat/Agent应用,采集数据包括工作流和工作流节点的执行明细,涵盖模型调用、工具调用、知识检索和各类流程节点的执行明细数据以及会话和用户信息等元数据 + +### Workflow/Chatflow Trace信息 + +**Workflow Trace Info** + +* workflow\_id - Workflow 的唯一标识 +* conversation\_id - 对话 ID +* workflow\_run\_id - 此次运行的 ID +* tenant\_id - 租户 ID +* elapsed\_time - 此次运行耗时 +* status - 运行状态 +* version - Workflow 版本 +* total\_tokens - 此次运行使用的 token 总数 +* file\_list - 处理的文件列表 +* triggered\_from - 触发此次运行的来源 +* workflow\_run\_inputs - 此次运行的输入数据 +* workflow\_run\_outputs - 此次运行的输出数据 +* error - 此次运行中发生的错误 +* query - 运行时使用的查询 +* workflow\_app\_log\_id - Workflow 应用日志 ID +* message\_id - 关联的消息 ID +* start\_time - 运行开始时间 +* end\_time - 运行结束时间 +* workflow node executions - workflow 节点运行信息 +* Metadata + * workflow\_id - Workflow 的唯一标识 + * conversation\_id - 对话 ID + * workflow\_run\_id - 此次运行的 ID + * tenant\_id - 租户 ID + * elapsed\_time - 此次运行耗时 + * status - 运行状态 + * version - Workflow 版本 + * total\_tokens - 此次运行使用的 token 总数 + * file\_list - 处理的文件列表 + * triggered\_from - 触发来源 + +### Message Trace信息 + +**Message Trace Info** + +* message\_id - 消息 ID +* message\_data - 消息数据 +* user\_session\_id - 用户的 session\_id +* conversation\_model - 对话模式 +* message\_tokens - 消息中的令牌数 +* answer\_tokens - 回答中的令牌数 +* total\_tokens - 消息和回答中的总令牌数 +* error - 错误信息 +* inputs - 输入数据 +* outputs - 输出数据 +* file\_list - 处理的文件列表 +* start\_time - 开始时间 +* end\_time - 结束时间 +* message\_file\_data - 消息关联的文件数据 +* conversation\_mode - 对话模式 +* Metadata + * conversation\_id - 消息所属对话的 ID + * ls\_provider - 模型提供者 + * ls\_model\_name - 模型 ID + * status - 消息状态 + * from\_end\_user\_id - 发送用户的 ID + * from\_account\_id - 发送账户的 ID + * agent\_based - 是否基于代理 + * workflow\_run\_id - 工作流运行 ID + * from\_source - 消息来源 + * message\_id - 消息 ID + +### Dataset Retrieval Trace信息 + +**Dataset Retrieval Trace Info** + +* message\_id - 消息 ID +* inputs - 输入内容 +* documents - 文档数据 +* start\_time - 开始时间 +* end\_time - 结束时间 +* message\_data - 消息数据 +* Metadata + * message\_id 消息 ID + * ls\_provider 模型提供者 + * ls\_model\_name 模型 ID + * status 消息状态 + * from\_end\_user\_id 发送用户的 ID + * from\_account\_id 发送账户的 ID + * agent\_based 是否基于代理 + * workflow\_run\_id 工作流运行 ID + * from\_source 消息来源 + +### Tool Trace信息 + +**Tool Trace Info** + +* message\_id 消息 ID +* tool\_name 工具名称 +* start\_time 开始时间 +* end\_time 结束时间 +* tool\_inputs 工具输入 +* tool\_outputs 工具输出 +* message\_data 消息数据 +* error 错误信息,如果存在 +* inputs 消息的输入内容 +* outputs 消息的回答内容 +* tool\_config 工具配置 +* time\_cost 时间成本 +* tool\_parameters 工具参数 +* file\_url 关联文件的 URL +* Metadata + * message\_id 消息 ID + * tool\_name 工具名称 + * tool\_inputs 工具输入 + * tool\_outputs 工具输出 + * tool\_config 工具配置 + * time\_cost 时间成本 + * error 错误信息 + * tool\_parameters 工具参数 + * message\_file\_id 消息文件 ID + * created\_by\_role 创建者角色 + * created\_user\_id 创建者用户 ID \ No newline at end of file