本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
使用 Amazon EventBridge 事件來追蹤畫面錄製狀態
使用 Amazon EventBridge,您可以近乎即時地檢視客服人員畫面錄製的狀態。每個客服人員畫面錄製的事件包括成功/失敗狀態、失敗代碼與描述、錄製位置、錄製大小、已安裝的用戶端版本,以及畫面錄製開始和結束時間。
注意
除了 AWS GovCloud (美國西部) 之外,支援 Connect Customer 客服人員畫面錄製的每個 AWS 區域都可以使用 Amazon EventBridge 進行畫面錄製狀態追蹤。 在 Connect Customer 中設定和檢閱客服人員畫面錄製
您可以與其他 AWS 服務整合,以取得客服人員畫面錄製的分析或監控洞見:
-
在 Amazon Quick
儀表板中取得近乎即時的提醒 -
在 Connect Customer 外部建立彙總報告
-
將您的其他自訂資料管道解決方案與 Amazon EventBridge 連線
Amazon EventBridge 事件承載格式
具有畫面錄製狀態的事件 - INITIATED
客服人員接受聯絡人時,會針對啟用客服人員畫面錄製的每個聯絡人發出此事件,這可能是在錄製開始之前。
{ "version": "0", "id": "the_event_id_from_eventbridge", "detail-type": "Screen Recording Status Changed", "source": "aws.connect", "account": "your_aws_account_id", "time": "2026-01-01T00:00:00Z", "region": "us-west-2", "resources": [ "arn:aws:connect:us-west-2:your_aws_account_id:instance/your_instance_id/contact/your_contact_id", "arn:aws:connect:us-west-2:your_aws_account_id:instance/your_instance_id" ], "detail": { "version": "1.0", "recordingStatus": "INITIATED", "eventDeduplicationId": "unique_uuid", "instanceArn": "arn:aws:connect:us-west-2:your_aws_account_id:instance/your_instance_id", "contactArn": "arn:aws:connect:us-west-2:your_aws_account_id:instance/your_instance_id/contact/your_contact_id", "agentArn": "arn:aws:connect:us-west-2:your_aws_account_id:instance/your_instance_id/agent/your_agent_id", "clientInfo": { "appVersion": "3.0.2.0", } } }
具有畫面錄製狀態的事件 - 已完成
在客服人員桌面上結束畫面錄製時,會發出此事件。這並不表示螢幕錄製已成功上傳到您的 Amazon S3 儲存貯體。
{ "version": "0", "id": "the_event_id_from_eventbridge", "detail-type": "Screen Recording Status Changed", "source": "aws.connect", "account": "your_aws_account_id", "time": "2026-01-01T00:00:00Z", "region": "us-west-2", "resources": [ "arn:aws:connect:us-west-2:your_aws_account_id:instance/your_instance_id/contact/your_contact_id", "arn:aws:connect:us-west-2:your_aws_account_id:instance/your_instance_id" ], "detail": { "version": "1.0", "recordingStatus": "COMPLETED", "eventDeduplicationId": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeee", "instanceArn": "arn:aws:connect:us-west-2:your_aws_account_id:instance/your_instance_id", "contactArn": "arn:aws:connect:us-west-2:your_aws_account_id:instance/your_instance_id/contact/your_contact_id", "agentArn": "arn:aws:connect:us-west-2:your_aws_account_id:instance/your_instance_id/agent/your_agent_id", "clientInfo": { "appVersion": "3.0.2.0", }, "recordingInfo": { "startTime": "2026-01-01T00:00:00.000Z", "endTime": "2026-01-01T00:00:00.000Z", } } }
具有畫面錄製狀態的事件 - PUBLISHED
當畫面錄製成功上傳至 Amazon S3 儲存貯體時,會發出此事件。詳細資訊包括 Amazon S3 儲存貯體位置、記錄大小和記錄持續時間。
{ "version": "0", "id": "the_event_id_from_eventbridge", "detail-type": "Screen Recording Status Changed", "source": "aws.connect", "account": "your_aws_account_id", "time": "2026-01-01T00:00:00Z", "region": "us-west-2", "resources": [ "contactArn", "instanceArn" ], "detail": { "version": "1.0", "recordingStatus": "PUBLISHED", "eventDeduplicationId": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeee", "instanceArn": "arn:aws:connect:us-west-2:your_aws_account_id:instance/your_instance_id", "contactArn": "arn:aws:connect:us-west-2:your_aws_account_id:instance/your_instance_id/contact/your_contact_id", "agentArn": "arn:aws:connect:us-west-2:your_aws_account_id:instance/your_instance_id/agent/your_agent_id", "clientInfo": { "appVersion": "3.0.2.0", }, "recordingInfo": { "startTime": "2026-01-01T00:00:00.000Z", "endTime": "2026-01-01T00:00:00.000Z", "publishTime": "2026-01-01T00:00:00.000Z", "location": "s3://your-bucket-name/connect/your-instance-alias/object-prefix/object-key", "durationInMillis": 100000, "sizeInBytes": 1000000 } } }
具有畫面錄製狀態的事件 - 失敗
如果畫面錄製失敗,則會發出此事件。失敗資訊包括我們能夠偵測的可能失敗原因的最佳嘗試估計。
{ "version": "0", "id": "the_event_id_from_eventbridge", "detail-type": "Screen Recording Status Changed", "source": "aws.connect", "account": "your_aws_account_id", "time": "2026-01-01T00:00:00Z", "region": "us-west-2", "resources": [ "arn:aws:connect:us-west-2:your_aws_account_id:instance/your_instance_id/contact/cccccccc-cccc-cccc-cccc-ccccccccccccc", "arn:aws:connect:us-west-2:your_aws_account_id:instance/your_instance_id" ], "detail": { "version": "1.0", "recordingStatus": "FAILED", "eventDeduplicationId": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeee", "instanceArn": "arn:aws:connect:us-west-2:your_aws_account_id:instance/your_instance_id", "contactArn": "arn:aws:connect:us-west-2:your_aws_account_id:instance/your_instance_id/contact/cccccccc-cccc-cccc-cccc-ccccccccccccc", "agentArn": "arn:aws:connect:us-west-2:your_aws_account_id:instance/your_instance_id/agent/your_agent_id", "clientInfo": { "appVersion": "3.0.2.0", }, "failureInfo": { "code": "UNKNOWN", "message": "Unknown failure", "source": "UNKNOWN" }, "recordingInfo": { "startTime": "2026-01-01T00:00:00.000Z" } } }
下表列出 failureInfo 物件中的可能值。
| code | message | source |
|---|---|---|
CLIENT_LOCAL_NETWORK_ACCESS_BLOCKED |
瀏覽器的本機網路存取政策封鎖了與 Amazon Connect 用戶端應用程式的連線 | CLIENT |
CLIENT_APP_NOT_RUNNING |
Amazon Connect 用戶端應用程式未在代理程式的桌面上執行 | CLIENT |
CLIENT_UNSUPPORTED_OS |
不支援代理程式的作業系統進行畫面錄製 | CLIENT |
CLIENT_AUTH_ERROR |
Amazon Connect 用戶端應用程式無法驗證 | CLIENT |
CLIENT_CONNECTION_ERROR |
Amazon Connect 用戶端應用程式未連線 | CLIENT |
MULTIPLE_CCP_INTERACTION |
偵測到多個瀏覽器與 CCP 的互動 | CLIENT |
USER_ERROR |
請求遇到使用者組態錯誤 | CLIENT |
SERVICE_ISSUE |
請求遇到服務例外狀況 | SERVICE |
UNKNOWN |
未知失敗 | UNKNOWN |
建立規則以符合 Amazon EventBridge 事件
若要訂閱螢幕錄製狀態的 Amazon EventBridge 事件,您需要建立符合已定義事件來源和事件詳細資訊類型的 Amazon EventBridge 規則。這可以透過 AWS 主控台或 AWS CDK 程式庫達成。
使用 AWS 主控台建立規則
在 AWS 主控台中,在 Amazon EventBridge 中建立新規則 → 匯流排 → 規則。
使用預設事件匯流排
使用範本事件模式
從下拉式清單中選取定義的事件模式。
如果事件類型未顯示在下拉式清單中,您也可以使用自訂模式 (JSON 編輯器) 搭配下列項目來建立相同的模式:
{ "source": [ "aws.connect" ], "detailType": [ "Screen Recording Status Changed" ] }
使用 建立規則 AWS CDK
或者,如果您使用 管理 AWS 資源 AWS CDK,以下是建構 Amazon EventBridge 規則的範例 TypeScript 程式碼片段:
import { Rule } from 'aws-cdk-lib/aws-events'; const eventBridgeRule = new Rule(this, 'YourEventBridgeRuleLogicalName', { ruleName: 'your-event-bridge-rule-name', description: 'your rule description', eventPattern: { source: [ "aws.connect" ], detailType: [ "Screen Recording Status Changed" ] } });
設定已建立 Amazon EventBridge 規則的目標
Amazon EventBridge 支援許多 AWS 服務做為目標。根據您的需求,您可以靈活地與其他 AWS 服務一起建置自己的事件處理管道。您最多可以為每個規則定義五個目標。如需詳細資訊,請參閱 Amazon EventBridge 使用者指南中的 Amazon EventBridge 目標。
Amazon CloudWatch 日誌群組做為範例目標
下列範例使用 Amazon CloudWatch 日誌群組做為目標。
在 AWS CDK 程式碼中,建立資源並將其新增至 Amazon EventBridge 規則:
import { LogGroup, RetentionDays } from "aws-cdk-lib/aws-logs"; import { CloudWatchLogGroup } from 'aws-cdk-lib/aws-events-targets'; const logGroup = new LogGroup(this, 'YourLogGroupLogicalName', { logGroupName: '"/aws/events/your-log-group-name', retention: RetentionDays.ONE_YEAR }); eventBridgeRule.addTarget(new CloudWatchLogGroup((logGroup)));
Amazon CloudWatch Log Insights 查詢範例
使用 Amazon CloudWatch Insights 查詢語言,以下是一些範例查詢:
-
成功率的範例查詢
fields @timestamp, @message, detail | stats sum(detail.recordingStatus= "PUBLISHED") as Count_Success, sum(detail.recordingStatus= "INITIATED") as Count_Total, Count_Success / Count_Total as Success_Ratio -
取得每個記錄狀態計數的範例查詢
fields @timestamp, @message, detail | stats count(*) as Count group by detail.recordingStatus as recordingStatus -
具有最常見失敗代碼的失敗聯絡範例查詢
fields @timestamp, @message, detail | filter detail.recordingStatus = "FAILED" | stats count(*) as Count group by detail.failureInfo.code as FailureCode | sort by Count desc -
大部分聯絡失敗的客服人員範例查詢
fields @timestamp, @message, detail | filter detail.recordingStatus = "FAILED" | stats count(*) as Count group by detail.agentArn as AgentArn | sort by Count desc