

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

使用 CloudWatch 监控 Aurora DSQL，CloudWatch 会收集原始数据并将其处理为易读且近乎实时的指标。CloudWatch 将这些统计数据保留 15 个月，有助于您更好地了解 Web 应用程序或服务性能。设置警报以监视特定阈值，并在达到阈值时发送通知或采取行动。查看以下可用于 Aurora DSQL 的使用情况和可观测性指标。

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

## 可观测性和性能
<a name="observability-performance"></a>

此表概述了 Aurora DSQL 的可观测性指标。它包括用于跟踪只读事务数和总事务数的指标，以提供总体工作负载特征。包括查询超时和 OCC 冲突率等可操作指标，有助于识别性能问题和并发冲突。与会话相关的指标，包括有关活动状态和总数方面的指标，可供深入了解系统上的当前负载。


| CloudWatch 指标名称 | 指标 | 单位 | 说明 | 
| --- |--- |--- |--- |
| ReadOnlyTransactions | Read-only transactions | none | The number of read-only transactions | 
| TotalTransactions | Total transactions | none | The total number of transactions executed on the system, including read-only transactions. | 
| QueryTimeouts | Query timeouts | none | The number of queries which have timed out due to hitting the maximum transaction time | 
| OccConflicts | OCC conflicts | none | The number of transactions aborted due to key level OCC | 
| CommitLatency | Commit Latency | milliseconds | Time spent by commit phase of query execution (P50) | 
| BytesWritten | Bytes Written | bytes | Bytes written to storage | 
| BytesRead | Bytes Read | bytes | Bytes read from storage | 
| ComputeTime | QP compute time | milliseconds | QP wall clock time | 
| ClusterStorageSize | Cluster Storage Size | bytes | Cluster size | 

## 使用情况指标
<a name="usage-metrics"></a>

 Aurora DSQL 使用名为分布式处理单元（DPU）的单个标准化计费单位，来衡量所有基于请求的活动，例如查询处理、读取和写入。


| CloudWatch 指标名称 | 指标 | 维度：ResourceId | 单位 | 说明 | 
| --- |--- |--- |--- |--- |
| WriteDPU | Write Units | <cluster-id> | DPU | Approximates the write active-use component of your Aurora DSQL cluster DPU usage. | 
| MultiRegionWriteDPU | Multi-Region Write Units | <cluster-id> | DPU | Applicable for Multi-Region clusters: Approximates the multi-Region write active-use component of your Aurora DSQL cluster DPU usage. | 
| ReadDPU | Read Units | <cluster-id> | DPU | Approximates the read active-use component of your Aurora DSQL cluster DPU usage. | 
| ComputeDPU | Compute Units | <cluster-id> | DPU | Approximates the compute active-use component of your Aurora DSQL cluster DPU usage. | 
| TotalDPU | Total Units | <cluster-id> | DPU | Approximates the total active-use component of your Aurora DSQL cluster DPU usage. | 

## CDC 流指标
<a name="cdc-stream-metrics"></a>

Aurora DSQL 发布针对更改数据捕获（CDC）流的以下指标。这些指标使用 `ClusterId` 和 `StreamId` 维度，因此您可以独立监控每个 CDC 流。有关 CDC 流的更多信息，请参阅[更改数据捕获（CDC）流](https://docs.aws.amazon.com/aurora-dsql/latest/userguide/cdc-streams.html)。


| CloudWatch 指标名称 | 指标 | 单位 | 说明 | 
| --- |--- |--- |--- |
| IsImpaired | Is impaired | none | Indicates whether the stream is impaired. The value is 1 when the stream is in the IMPAIRED state, and 0 when the stream is healthy. Use this metric to create a CloudWatch alarm that notifies you when a stream becomes impaired. | 
| PublishedBytes | Published bytes | bytes | The total number of bytes that Aurora DSQL wrote to the target Kinesis data stream. | 
| PublishedRecords | Published records | none | The number of CDC records that Aurora DSQL wrote to the target Kinesis data stream. | 
| BehindSourceLag | Behind source lag | milliseconds | The delay, in milliseconds, between when a transaction commits in Aurora DSQL and when the CDC system processes the resulting record. A rising value indicates that the CDC pipeline is falling behind the write workload. If lag grows beyond the failure threshold, the stream transitions to FAILED. | 
| BytesStreamed | Bytes streamed | bytes | The total bytes streamed through the CDC pipeline for billing purposes. This metric reflects the data volume used to calculate streaming charges. | 
| StreamDPU | Stream DPU | DPU | The Distributed Processing Units (DPU) consumed by the CDC stream. This metric reflects the processing cost of streaming change data. | 