

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 监控 Amazon Transcribe
<a name="monitoring-transcribe"></a>

监控是维护和其他 AWS 解决方案的可靠性、可用性和性能的重要组成部分。 Amazon Transcribe AWS 提供以下监控工具 Amazon Transcribe，供您监视、报告问题并在适当时自动采取措施：
+ **Amazon CloudWatch**实时监控您的 AWS 资源和您运行 AWS 的应用程序。您可以收集和跟踪指标，创建自定义的控制面板，以及设置警报以在指定的指标达到您指定的阈值时通知您或采取措施。例如，您可以 CloudWatch 跟踪 Amazon EC2 实例的 CPU 使用率或其他指标，并在需要时自动启动新实例。
+ **Amazon CloudWatch Logs**可以监控、存储和访问来自 Amazon EC2 实例和其他来源的日志文件。 CloudTrail CloudWatch Logs 可以监视日志文件中的信息，并在达到特定阈值时通知您。您还可以在高持久性存储中检索您的日志数据。
+ **AWS CloudTrail**捕获由您或代表您发起的 API 调用 AWS 账户 和相关事件，并将日志文件传输到您指定的 Amazon S3 存储桶。您可以识别哪些用户和帐户拨打了电话 AWS、发出呼叫的源 IP 地址以及呼叫发生的时间。

有关更多信息，请参阅 *[Amazon CloudWatch 《用户指南》](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/WhatIsCloudWatch.html)*。

**Amazon EventBridge**是一项无服务器服务，它使用事件将应用程序组件连接在一起，使您可以更轻松地构建可扩展的事件驱动应用程序。 EventBridge 提供来自您自己的应用程序、软件即服务 (SaaS) 应用程序和 AWS 服务的实时数据流，并将这些数据路由到目标，例如 Lambda。您可以监控服务中发生的事件，并构建事件驱动型架构。有关更多信息，请参阅 *[Amazon EventBridge 《用户指南》](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-what-is.html)*。

**Topics**
+ [Amazon Transcribe 使用监控 Amazon CloudWatch](monitoring-cloudwatch.md)
+ [Amazon Transcribe 使用监控 AWS CloudTrail](monitoring-transcribe-cloud-trail.md)
+ [配合使用 Amazon EventBridge和 Amazon Transcribe](monitoring-events.md)

# Amazon Transcribe 使用监控 Amazon CloudWatch
<a name="monitoring-cloudwatch"></a>

您可以使用 Amazon Transcribe 进行监控 CloudWatch，它收集原始数据并将其处理为可读的近乎实时的指标。这些统计数据会保存 15 个月，从而使您能够访问历史信息，并能够更好地了解您的 Web 应用程序或服务的执行情况。此外，可以设置用于监测特定阈值的警报，并在达到相应阈值时发送通知或执行操作。有关更多信息，请参阅 [https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/WhatIsCloudWatch.html](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/WhatIsCloudWatch.html)。

## 将 Amazon CloudWatch 指标和维度与 Amazon Transcribe
<a name="monitoring-cwmetrics"></a>

Amazon Transcribe 支持 CloudWatch 指标和维度，这些数据可以帮助您监控性能。支持的指标类别包括与转录作业相关的流量、错误、数据传输和延迟。支持的指标位于 **AWS/Transcribe 命名空间 CloudWatch 中。**

**注意**  
CloudWatch 监控指标是免费的，不计入 CloudWatch 服务配额。

有关 CloudWatch 指标的更多信息，请参阅[使用 Amazon CloudWatch 指标](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/working_with_metrics.html)。


**CloudWatch 的指标 Amazon Transcribe**  

| 指标 | 服务类型 | 说明 | 
| --- | --- | --- | 
| TotalRequestCount | 批处理、流式 |  显示事务数量。表示向 Transcribe 发出的所有成功和失败的请求。 **单位**：计数 **相关统计数据**：总计、平均值 **有效维度**：`Domain`、`ServiceType`、`Operation`、`LanguageCode`  | 
| SuccessfulRequestCount | 批处理 |  显示成功的请求数。成功请求的响应代码范围为 200 到 299。 **单位**：计数 **相关统计数据**：总计、平均值 **有效维度**：`Domain`、`ServiceType`、`Operation`  | 
| SyncServerErrorCount | 批处理 |  显示服务器错误的数量。服务器错误的响应代码范围为 500 到 599。 **单位**：计数 **相关统计数据**：总计、平均值 **有效维度**：`Domain`、`ServiceType`、`Operation`  | 
| SyncUserErrorCount | 批处理 |  显示用户错误的数量，例如无效的参数、文件和权限以及限制错误。用户错误的响应代码范围为 400 到 499。 **单位**：计数 **相关统计数据**：总计、平均值 **有效维度**：`Domain`、`ServiceType`、`Operation`  | 
| ThrottledCount | 批处理、流式 |  显示因超出交易速率配额**LimitExceededException**而返回的请求数。 Amazon Transcribe 限制客户每秒可以发出的请求数量。如果经常超过 AWS 账户 为你设置的配额限制，你可以申请增加配额。要请求提高配额，请参阅 [AWS 服务 配额](https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html)。 **单位**：计数 **相关统计数据**：总计、平均值 **有效维度**：`Domain`、`ServiceType`、`Operation`  | 
| LimitExceededCount | 批处理、流式 |  显示因超出非速率配额**LimitExceededException**而返回的请求数。 Amazon Transcribe 限制并发作业数量、转录总数、最大音频文件大小等。如果经常超过 AWS 账户 为你设置的上限，你可以申请增加配额。要请求提高配额，请参阅 [AWS 服务 配额](https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html)。 **单位**：计数 **相关统计数据**：总计、平均值 **有效维度**：`Domain`、`ServiceType`、`Operation`  | 
| AsyncUserErrorCount | 批处理 |  异步（后端）用户错误的数量，例如：给定的音频格式与检测到的格式不匹配、无效的采样率、客户 Amazon S3 访问错误。 **单位**：计数 **相关统计数据**：总计、平均值 **有效维度**：`Domain`、`ServiceType`、`Operation` **操作**：`StartCallAnalyticsJob`、`StartMedicalTranscriptionJob`、`StartTranscriptionJob`、`CreateMedicalVocabulary`、`CreateVocabulary`、`UpdateMedicalVocabulary`、`UpdateVocabulary`  | 
| AsyncServerErrorCount | 批处理 |  异步（后端）服务器错误的数量，或者更具体地说，是自动语音识别 (ASR) 处理错误的数量。 **单位**：计数 **相关统计数据**：总计、平均值 **有效维度**：`Domain`、`ServiceType`、`Operation` **操作**：`StartCallAnalyticsJob`、`StartMedicalTranscriptionJob`、`StartTranscriptionJob`、`CreateMedicalVocabulary`、`CreateVocabulary`、`UpdateMedicalVocabulary`、`UpdateVocabulary`  | 
| AudioDurationTime | 批处理 |  音频或视频文件的最大长度（以秒为单位）。 **单位**：秒 **相关统计数据**：平均、最小、最大 **有效维度**：`Domain`、`ServiceType`、`LanguageCode`  | 
| ConcurrentStreamsCount | 流式处理 |  显示当前正在处理的并发流的数量。 **单位**：计数 **相关统计数据**：平均值、最大值 **有效维度**：`Domain`、`ServiceType`  | 
| ConcurrentPostStreamJobsCount | 流式处理 |  显示当前正在处理的并发 AWS HealthScribe 直播后分析的数量。 **单位**：计数 **相关统计数据**：平均值、最大值 **有效维度**：`Domain`、`ServiceType`、`Operation`  | 
| PostStreamJobLimitExceededCount | 流式处理 |  显示展示因超出并发流后作业限额的配额而返回 `LimitExceededException` 的请求的数量。 **单位**：计数 **相关统计数据**：总计、平均值 **有效维度**：`Domain`、`ServiceType`、`Operation`  | 


**CloudWatch 的尺寸 Amazon Transcribe**  

| 维度 | 说明 | 
| --- | --- | 
| Domain |  仅显示具有指定 Transcribe 类型的指标。 **有效选项**：Transcribe、Transcribe Medical、Transcribe 呼叫分析  | 
| ServiceType |  仅显示具有指定服务类型的指标。 **有效选项**：批量  | 
| Operation |  仅显示具有指定操作的指标。 **有效选项**：任何 Amazon Transcribe API  | 
| LanguageCode |  仅显示使用指定语言的指标。 **有效选项**：任何有效的语言代码，格式为 `en-US`  | 

# Amazon Transcribe 使用监控 AWS CloudTrail
<a name="monitoring-transcribe-cloud-trail"></a>

Amazon Transcribe 与 AWS CloudTrail一项服务集成，该服务提供了 AWS Identity and Access Management (IAM) 用户或角色或 AWS 服务所采取的操作的记录。 Amazon Transcribe CloudTrail 捕获所有 API 调用 Amazon Transcribe。这包括来自的调用 AWS 管理控制台 以及对的代码调用 Amazon Transcribe APIs，作为事件。通过创建跟踪，您可以将 CloudTrail 事件（包括的事件）持续传送到 Amazon S3 存储桶。 Amazon Transcribe如果您不创建跟踪，则仍可在 CloudTrail AWS 管理控制台 的**事件历史记录**中查看最新事件。使用收集的信息 CloudTrail，您可以查看向其发出的每个请求 Amazon Transcribe、发出请求的 IP 地址、谁发出了请求、何时发出请求以及其他详细信息。

要了解更多信息 CloudTrail，请参阅《[https://docs.aws.amazon.com/awscloudtrail/latest/userguide/](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/)。

## Amazon Transcribe 和 CloudTrail
<a name="transcribe-info-in-cloudtrail"></a>

CloudTrail 在您创建账户 AWS 账户 时已在您的账户上启用。当活动发生在中时 Amazon Transcribe，该活动会与其他 CloudTrail 事件一起记录在 AWS 服务 CloudTrail **事件历史**记录中。您可以在中查看、搜索和下载最近发生的事件 AWS 账户。有关更多信息，请参阅[使用 CloudTrail 事件历史记录查看事件](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/view-cloudtrail-events.html)。

要获取您的事件的持续记录 AWS 账户，包括的事件 Amazon Transcribe，请创建跟踪。*跟踪*是一种允许 CloudTrail 将事件作为日志文件传送到指定 Amazon S3 存储桶的配置。 CloudTrail 日志文件包含一个或多个日志条目。*事件* 表示来自任何源的单个请求。它包括有关请求的操作、操作的日期和时间、请求参数等的信息。 CloudTrail 日志文件不是公共 API 调用的有序堆栈跟踪，因此它们不会按任何特定的顺序出现。

默认情况下，当您在中创建跟踪时 AWS 管理控制台，该跟踪将应用于所有跟踪 AWS 区域。跟踪记录 AWS 分区 AWS 区域 中所有事件并将日志文件传送到您指定的 Amazon S3 存储桶。此外，您可以配置其他 AWS 服务 ，以进一步分析和处理 CloudTrail 日志中收集的事件数据。有关更多信息，请参阅:
+ [创建跟踪概述](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-create-and-update-a-trail.html)
+ [CloudTrail 支持的服务和集成](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-aws-service-specific-topics.html#cloudtrail-aws-service-specific-topics-integrations)
+ [为配置 Amazon SNS 通知 CloudTrail](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/getting_notifications_top_level.html)
+ [接收多个区域中的 CloudTrail 日志文件](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/receive-cloudtrail-log-files-from-multiple-regions.html)和[从多个账户中接收 CloudTrail 日志文件](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-receive-logs-from-multiple-accounts.html)

CloudTrail 记录所有 Amazon Transcribe 操作，这些操作记录在《[API 参考](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_Reference.html)》中。例如，[https://docs.aws.amazon.com/transcribe/latest/APIReference/API_CreateVocabulary.html](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_CreateVocabulary.html)、和[https://docs.aws.amazon.com/transcribe/latest/APIReference/API_StartTranscriptionJob.html](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_StartTranscriptionJob.html)操作会在 CloudTrail 日志文件中生成条目。在 CloudTrail 记录 Amazon Transcribe API 操作时， CloudTrail 日志条目使用空字符串存储请求和响应参数中的敏感信息，例如 Amazon S3 URI 值。

每个事件或日志条目都包含有关生成请求的人员信息。此信息可帮助您确定以下内容：
+ 请求是使用根凭证还是 IAM 用户凭证发出
+ 请求是使用 IAM 角色还是联合身份用户的临时安全凭证发出的
+ 请求是否由其他人提出 AWS 服务

有关更多信息，请参阅 [CloudTrail userIdentity 元素](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-event-reference-user-identity.html)。

您还可以将多个 AWS 区域 和多个 Amazon Transcribe 日志文件聚合 AWS 账户 到一个 Amazon S3 存储桶中。有关更多信息，请参阅[从多个区域接收 CloudTrail 日志文件](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/receive-cloudtrail-log-files-from-multiple-regions.html)和[从多个账户接收 CloudTrail 日志文件](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-receive-logs-from-multiple-accounts.html)。

### 示例： Amazon Transcribe 日志文件条目
<a name="cloud-trail-log-entry"></a>

*跟踪*是一种允许将事件作为日志文件传送到指定 Amazon S3 存储桶的配置。 CloudTrail 日志文件包含一个或多个日志条目。*事件* 表示来自任何源的单个请求。它包括有关所请求操作的信息，例如操作的日期和时间以及请求参数。 CloudTrail 日志文件不是公共 API 调用的有序堆栈跟踪，因此它们不会按任何特定的顺序出现。

调用 [https://docs.aws.amazon.com/transcribe/latest/APIReference/API_StartTranscriptionJob.html](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_StartTranscriptionJob.html) 和 [https://docs.aws.amazon.com/transcribe/latest/APIReference/API_GetTranscriptionJob.html](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_GetTranscriptionJob.html) API 操作将创建以下条目。

**注意**  
在 CloudTrail 记录 Amazon Transcribe API 操作时， CloudTrail 日志条目使用空字符串存储请求和响应参数中的敏感信息，例如 Amazon S3 URI 值。

```
{
    "Records": [
        {
            "eventVersion": "1.05",
            "userIdentity": {
                "type": "IAMUser",
                "principalId": "111122223333",
                "arn": "arn:aws:iam:us-west-2:111122223333:user/my-user-name",
                "accountId": "111122223333",
                "accessKeyId": "AKIAIOSFODNN7EXAMPLE",
                "userName": "my-user-name"
            },
            "eventTime": "2022-03-07T15:03:45Z",
            "eventSource": "transcribe.amazonaws.com",
            "eventName": "StartTranscriptionJob",
            "awsRegion": "us-west-2",
            "sourceIPAddress": "127.0.0.1",
            "userAgent": "[]",
            "requestParameters": {
                "mediaFormat": "flac",
                "languageCode": "en-US",
                "transcriptionJobName": "my-first-transcription-job",
                "media": {
                    "mediaFileUri": ""
                }
            },
            "responseElements": {
                "transcriptionJob": {
                    "transcriptionJobStatus": "IN_PROGRESS",
                    "mediaFormat": "flac",
                    "creationTime": "2022-03-07T15:03:44.229000-08:00",
                    "transcriptionJobName": "my-first-transcription-job",
                    "languageCode": "en-US",
                    "media": {
                        "mediaFileUri": ""
                    }
                }
            },
            "requestID": "47B8E8D397DCE7A6",
            "eventID": "cdc4b7ed-e171-4cef-975a-ad829d4123e8",
            "eventType": "AwsApiCall",
            "recipientAccountId": "111122223333"
        },
        {
            "eventVersion": "1.05",
            "userIdentity": {
                "type": "IAMUser",
                "principalId": "111122223333",
                "arn": "arn:aws:iam:us-west-2:111122223333:user/my-user-name",
                "accountId": "111122223333",
                "accessKeyId": "AKIAIOSFODNN7EXAMPLE",
                "userName": "my-user-name"
            },
            "eventTime": "2022-03-07T15:07:11Z",
            "eventSource": "transcribe.amazonaws.com",
            "eventName": "GetTranscriptionJob",
            "awsRegion": "us-west-2",
            "sourceIPAddress": "127.0.0.1",
            "userAgent": "[]",
            "requestParameters": {
                "transcriptionJobName": "my-first-transcription-job"
            },
            "responseElements": {
                "transcriptionJob": {
                    "settings": {
                        
                    },
                    "transcriptionJobStatus": "COMPLETED",
                    "mediaFormat": "flac",
                    "creationTime": "2022-03-07T15:03:44.229000-08:00",
                    "transcriptionJobName": "my-first-transcription-job",
                    "languageCode": "en-US",
                    "media": {
                        "mediaFileUri": ""
                    },
                    "transcript": {
                        "transcriptFileUri": ""
                    }
                }
            },
            "requestID": "BD8798EACDD16751",
            "eventID": "607b9532-1423-41c7-b048-ec2641693c47",
            "eventType": "AwsApiCall",
            "recipientAccountId": "111122223333"
        }        
    ]
}
```

# 配合使用 Amazon EventBridge和 Amazon Transcribe
<a name="monitoring-events"></a>

利用 Amazon EventBridge，您可以通过触发其它 AWS 服务中的事件来响应您的 Amazon Transcribe 作业中的状态更改。当转录作业更改状态时，EventBridge 会自动将事件发送到事件流。您可以创建规则来定义希望在事件流中监控的事件以及在这些事件发生时 EventBridge 应采取的操作。例如，将事件路由到其他服务（或目标），然后再采取操作。例如，您可以将规则配置为在成功完成转录作业时将事件路由到 AWS Lambda 函数。要定义 [EventBridge 规则](#defining-rules)，请参阅以下各节。

您可以通过多个渠道接收事件通知，包括电子邮件、[聊天应用程序中的 Amazon Q 开发者版](https://docs.aws.amazon.com/chatbot/latest/adminguide/what-is.html)聊天通知或 [AWS Console Mobile Application](https://docs.aws.amazon.com/consolemobileapp/latest/userguide/what-is-consolemobileapp.html) 推送通知。还可以在[控制台通知中心](https://console.aws.amazon.com/notifications/)中查看通知。如果要设置通知，您可以使用 [AWS 用户通知服务](https://docs.aws.amazon.com/notifications/latest/userguide/what-is.html)。AWS 用户通知服务 支持聚合，这可以减少您在特定事件期间收到的通知数量。

## 定义 EventBridge 规则
<a name="defining-rules"></a>

要定义 EventBridge 规则，请使用 [AWS 管理控制台](https://console.aws.amazon.com/events)。在定义规则时，将 Amazon Transcribe 用作服务名称。有关如何创建 EventBridge 规则的示例，请参阅 [Amazon EventBridge 规则](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-rules.html)。

在使用 EventBridge 之前，请注意以下定义：
+ **事件**–事件指示某个转录作业的状态发生更改。例如，当作业的 `TranscriptionJobStatus` 从 `IN_PROGRESS` 更改为 `COMPLETED` 时。
+ **目标**–目标是其它处理事件的 AWS 服务。例如，AWS Lambda 或 Amazon Simple Notification Service（Amazon SNS）。目标接收 JSON 格式的事件。
+ **规则**–规则与您希望 EventBridge 监视的传入事件匹配并将这些事件路由到目标以进行处理。如果规则将一个事件路由到多个目标，则所有目标将并行处理该事件。规则可以自定义发送到目标的 JSON。

Amazon EventBridge 事件是尽力发出的。有关在 EventBridge 中创建和管理事件的更多信息，请参阅**《Amazon EventBridge 用户指南》中的 [Amazon EventBridge 事件](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-events.html)。

以下是转录作业状态变为 `COMPLETED` 或 `FAILED` 时启动的 Amazon Transcribe 的 EventBridge 规则示例。

```
{
    "source": [
        "aws.transcribe"
    ],
    "detail-type": [
        "Transcribe Job State Change"
    ],
    "detail": {
        "TranscriptionJobStatus": [
            "COMPLETED",
            "FAILED"
        ]
    }
}
```

规则包含以下字段：
+ `source`–事件的来源。对于 Amazon Transcribe，这始终为 `aws.transcribe`。
+ `detail-type`–事件的详细信息的标识符。对于 Amazon Transcribe，这始终为 `Transcribe Job State Change`。
+ `detail`–转录作业的新作业状态。在此示例中，规则将在作业状态变为 `COMPLETED` 或 `FAILED` 时触发事件。

## Amazon Transcribe 事件
<a name="events"></a>

Amazon EventBridge 记录几个 Amazon Transcribe 事件：
+ [转录作业事件](#job-event)
+ [语言识别事件](#lang-id-event)
+ [呼叫分析事件](#analytics-event)
+ [呼叫分析通话后事件](#analytics-stream-event)
+ [词汇表事件](#vocab-event)

这些事件都包含以下共享字段：
+ `version`：事件数据的版本。此值始终为 `0`。
+ `id`：由 EventBridge 生成的事件的唯一标识符。
+ `detail-type`：事件的详细信息的标识符。例如 `Transcribe Job State Change`。
+ `source`：事件的来源。对于 Amazon Transcribe，这始终为 `aws.transcribe`。
+ `account`：生成了 API 调用的账户的 AWS 账户 ID。
+ `time`：事件的交付日期和时间。
+ `region`：在其中发出请求的 AWS 区域。
+ `resources`：API 调用使用的资源。对于 Amazon Transcribe，此字段始终为空。
+ `detail`：有关事件的其它详细信息。
  + `FailureReason`：如果状态更改为 `FAILED`，则会显示此字段，并描述 `FAILED` 状态的原因。
  + 每种事件类型都有额外的唯一字段，显示在 `detail` 下面。每个事件示例之后会在以下部分中定义这些唯一字段。

### 转录作业事件
<a name="job-event"></a>

当作业的状态从 `IN_PROGRESS` 更改为 `COMPLETED` 或 `FAILED` 时，Amazon Transcribe 会生成事件。要标识已更改状态并在您的目标中发起事件的作业，请使用事件的 `TranscriptionJobName` 字段。Amazon Transcribe 事件包含以下信息。如果您的转录作业状态为 `FAILED`，则会在 `detail` 下添加一个 `FailureReason` 字段。

请注意，此事件仅适用于 [https://docs.aws.amazon.com/transcribe/latest/APIReference/API_StartTranscriptionJob.html](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_StartTranscriptionJob.html) API 操作。

```
{
    "version": "0",
    "id": "event ID",
    "detail-type":"Transcribe Job State Change",
    "source": "aws.transcribe",
    "account": "111122223333",
    "time": "timestamp",
    "region": "us-west-2",
    "resources": [],
    "detail": {
          "TranscriptionJobName": "my-first-transcription-job",
          "TranscriptionJobStatus": "COMPLETED" (or "FAILED")
    }   
}
```
+ `TranscriptionJobName`：您为转录作业选择的唯一名称。
+ `TranscriptionJobStatus `：转录作业的状态。可以是 `COMPLETED` 或 `FAILED`。

### 语言识别事件
<a name="lang-id-event"></a>

启用[自动语言识别](lang-id.md)时，Amazon Transcribe 会在语言识别状态为 `COMPLETED` 或 `FAILED` 时生成一个事件。要标识已更改状态并在您的目标中发起事件的作业，请使用事件的 `JobName` 字段。Amazon Transcribe 事件包含以下信息。如果您的语言识别状态为 `FAILED`，则会在 `detail` 下添加一个 `FailureReason` 字段。

请注意，此事件仅适用于包含 [https://docs.aws.amazon.com/transcribe/latest/APIReference/API_LanguageIdSettings.html](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_LanguageIdSettings.html) 参数时的 [https://docs.aws.amazon.com/transcribe/latest/APIReference/API_StartTranscriptionJob.html](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_StartTranscriptionJob.html) API 操作。

```
{
    "version": "0",
    "id": "event ID",
    "detail-type": "Language Identification State Change",
    "source": "aws.transcribe",
    "account": "111122223333",
    "time": "timestamp",
    "region": "us-west-2",
    "resources": [],
    "detail": {
        "JobType": "TranscriptionJob",
        "JobName": "my-first-lang-id-job",
        "LanguageIdentificationStatus": "COMPLETED" (or "FAILED")
    }
}
```
+ `JobType`：对于转录作业，此值必须为 `TranscriptionJob`。
+ `JobName`: 您的转录作业的唯一名称。
+ `LanguageIdentificationStatus`：转录作业中语言识别的状态。可以是 `COMPLETED` 或 `FAILED`。

### 呼叫分析事件
<a name="analytics-event"></a>

当[呼叫分析](call-analytics.md)作业的状态从 `IN_PROGRESS` 更改为 `COMPLETED` 或 `FAILED` 时，Amazon Transcribe 会生成事件。要标识已更改状态并在您的目标中触发事件的呼叫分析作业，请使用事件的 `JobName` 字段。Amazon Transcribe 事件包含以下信息。如果您的呼叫分析作业状态为 `FAILED`，则会在 `detail` 下添加一个 `FailureReason` 字段。

请注意，此事件仅适用于 [https://docs.aws.amazon.com/transcribe/latest/APIReference/API_StartCallAnalyticsJob.html](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_StartCallAnalyticsJob.html) API 操作。

```
{
    "version": "0",
    "id": "event ID",
    "detail-type": "Call Analytics Job State Change",
    "source": "aws.transcribe",
    "account": "111122223333",
    "time": "timestamp",
    "region": "us-west-2",
    "resources": [],
    "detail": {
        "JobName": "my-first-analytics-job",
        "JobStatus": "COMPLETED" (or "FAILED"),
        "FailureReason": "failure reason", // only present when JobStatus is FAILED
        "AnalyticsJobDetails": { // only when you enable optional features such as Generative Call Summarization
            "Skipped": []
        }
    }
}
```
+ `JobName`：您的呼叫分析转录作业的唯一名称。
+ `JobStatus`：您的呼叫分析转录作业的状态。此值可以是 `COMPLETED` 或 `FAILED`。
+ `FailureReason`：此字段仅在 `JobStatus` 为 `FAILED` 时才会出现，用于描述失败的原因。
+ `AnalyticsJobDetails`：通话分析转录作业的详细信息，包括有关跳过的分析功能的信息。

### 呼叫分析通话后事件
<a name="analytics-stream-event"></a>

当[通话后分析](tca-post-call.md)转录的状态从 `IN_PROGRESS` 变为 `COMPLETED` 或 `FAILED` 时，Amazon Transcribe 会生成一个事件。要标识已更改状态并在您的目标中触发事件的呼叫分析通话后作业，请使用事件的 `StreamingSessionId` 字段。

请注意，此事件仅适用于包含 [https://docs.aws.amazon.com/transcribe/latest/APIReference/API_streaming_PostCallAnalyticsSettings.html](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_streaming_PostCallAnalyticsSettings.html) 参数时的 [https://docs.aws.amazon.com/transcribe/latest/APIReference/API_streaming_StartCallAnalyticsStreamTranscription.html](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_streaming_StartCallAnalyticsStreamTranscription.html) API 操作。

`COMPLETED` 事件包含以下信息：

```
{
    "version": "0",
    "id": "event ID",
    "detail-type": "Call Analytics Post Call Job State Change",
    "source": "aws.transcribe",
    "account": "111122223333",
    "time": "timestamp",
    "region": "us-west-2",
    "resources": [],
    "detail": {
        "StreamingSessionId": "session-id",
        "PostCallStatus": "COMPLETED",
        "Transcript": {
            "RedactedTranscriptFileUri": "s3://amzn-s3-demo-bucket/my-output-files/my-redacted-file.JSON",
            "TranscriptFileUri": "s3://amzn-s3-demo-bucket/my-output-files/my-file.JSON"
        },
        "Media": {
            "MediaFileUri": "s3://amzn-s3-demo-bucket/my-output-files/my-redacted-file.WAV",
            "RedactedMediaFileUri": "s3://amzn-s3-demo-bucket/my-output-files/my-redacted-file.WAV"
        }
    }
}
```

`FAILED` 事件包含以下信息：

```
{
    "version": "0",
    "id": "event ID",
    "detail-type": "Call Analytics Post Call Job State Change",
    "source": "aws.transcribe",
    "account": "111122223333",
    "time": "timestamp",
    "region": "us-west-2",
    "resources": [],
    "detail": {
        "StreamingSessionId": "session-id",
        "PostCallStatus": "FAILED"
    }
}
```
+ `StreamingSessionId`：分配给您的实时呼叫分析转录请求的识别码。
+ `PostCallStatus`：您的通话后呼叫分析转录的状态。此值可以是 `COMPLETED` 或 `FAILED`。
+ `Transcript`: 您已编辑和未编辑的转录的 URI。
+ `Media`: 您已编辑和未编辑的音频文件的 URI。

### AWS HealthScribe 流后分析事件
<a name="health-scribe-analytics-stream-event"></a>

当 AWS HealthScribe 流后分析操作的状态发生变化时（如 [ClinicalNoteGenerationResult](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_streaming_ClinicalNoteGenerationResult.html) 从 `IN_PROGRESS` 变为 `COMPLETED`），AWS HealthScribe 会生成一个包含以下信息的事件：

```
{
   "version":"0",
   "id":"event ID",
   "detail-type":"MedicalScribe Post Stream Analytics Update",
   "source":"aws.transcribe",
   "account":"111122223333",
   "time":"timestamp",
   "region":"us-east-1",
   "resources":[],
   "detail":{
      "SessionId": <SessionID>,
      "UpdateType": "ClinicalNoteGenerationResult",
      "ClinicalNoteGenerationResult": {
          "ClinicalNoteOutputLocation": s3://amzn-s3-demo-bucket/clinical-note-output-files/clinical-notes.JSON,
          "TranscriptOutputLocation": s3://amzn-s3-demo-bucket/my-output-files/my-file.JSON,
          "Status": <IN_PROGRESS | COMPLETED | FAILED>,
          "FailureReason": <failure_reason>
    }
   }
}
```
+ `UpdateType`：生成该事件的流后分析操作的类型。结果对象的内容因 `UpdateType` 而异。
+ `SessionId`：AWS HealthScribe 流的识别号。使用此 ID 可识别发起事件的流会话，进而找到生成该事件的流后分析。
+ `Status`：流后分析操作的状态。这可以是 `IN_PROGRESS`、`COMPLETED` 或 `FAILED`。
+ `ClinicalNoteOutputLocation`：用于 `ClinicalNoteGenerationResult` 的输出 Amazon S3 存储桶的 URI。
+ `TranscriptOutputLocation`：转录文本的 URI。

### 词汇表事件
<a name="vocab-event"></a>

当[自定义词汇表](custom-vocabulary.md)的状态从 `PENDING` 更改为 `READY` 或 `FAILED` 时，Amazon Transcribe 会生成一个事件。要标识已更改状态并在您的目标中发起事件的自定义词汇表，请使用事件的 `VocabularyName` 字段。Amazon Transcribe 事件包含以下信息。如果您的自定义词汇表状态为 `FAILED`，则会在 `detail` 下添加一个 `FailureReason` 字段。

**注意**  
此事件仅适用于 [https://docs.aws.amazon.com/transcribe/latest/APIReference/API_CreateVocabulary.html](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_CreateVocabulary.html) API 操作。

```
{
    "version": "0",
    "id": "event ID",
    "detail-type": "Vocabulary State Change",
    "source": "aws.transcribe",
    "account": "111122223333",
    "time": "timestamp",
    "region": "us-west-2",
    "resources": [],
    "detail": {
        "VocabularyName": "unique-vocabulary-name",
        "VocabularyState": "READY" (or "FAILED")
    }
}
```
+ `VocabularyName`: 您的自定义词汇表的唯一名称。
+ `VocabularyState`: 您的自定义词汇表的处理状态。可以是 `READY` 或 `FAILED`。