DynamoD CloudWatch B 贡献者见解入门 - Amazon DynamoDB
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

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

DynamoD CloudWatch B 贡献者见解入门

本节介绍如何在亚马逊 DynamoDB 控制台或 Amazon Command Line Interface () 中使用亚马逊 CloudWatch 贡献者见解。Amazon CLI

在以下示例中,您将使用 DynamoDB 入门教程中定义的 DynamoDB 表。

使用 Contributor Insights(控制台)

  1. 登录 Amazon Web Services Management Console 并打开 DynamoDB 控制台,网址为 https://console.aws.amazon.com/dynamodb/。

  2. 在控制台左侧的导航窗格中,选择

  3. 选择 Music 表。

  4. 选择 Monitor(监控)选项卡。

  5. 选择 “开启投 CloudWatch 稿人见解”。

    
                        显示监控选项卡和按钮的控制台屏幕截图。
  6. Manage Contributor Insights (管理 Contributor Insights) 对话框的 Contributor Insights Status (Conductor Insights 状态) 下方,为 Music 基表和 AlbumTitle-index 全局二级索引选择 Enabled (已启用)。然后,选择确认

    
                        显示 Contributor Insights 状态列表选项的控制台屏幕截图。

    如果操作失败,请参阅亚马逊 DynamoDB API 参考DescribeContributorInsights FailureException中的可能原因。

  7. 选择 View in DynamoDB (在 DynamoDB 中查看)

    
                        显示 Contributor Insights 设置中的“在 DynamoDB 中查看”按钮的控制台屏幕截图。
  8. Contributor Insights 图表现在可以在 Music 表的 Contributor Insights 选项卡查看。

    
                        显示 Contributor Insights 选项卡和 music 表多个图表的控制台屏幕截图。

创建 CloudWatch 警报

按照以下步骤创建 CloudWatch 警报,并在任何分区键消耗超过 50,000 ConsumedThroughputUnits时收到通知。

  1. 登录 Amazon Web Services Management Console 并打开 CloudWatch 控制台,网址为 https://console.aws.amazon.com/cloudwatch/

  2. 在控制台左侧的导航窗格中,选择 Contributor Insights

  3. 选择 DynamoDB-pkc-M ContributorInsights usic 规则

  4. 选择 Actions (操作) 下拉菜单。

  5. 选择 View in metrics (查看指标)

  6. 选择 Max Contributor Value (最大贡献者值)

    注意

    Max Contributor ValueMaximum 返回有用的统计信息。此列表中的其他统计信息不返回有意义的值。

    
                        显示 Contributor Insights 选项卡和按钮的控制台屏幕截图。
  7. Actions (操作) 列选择 Create Alarm (创建告警)

    
                        显示 Contributor Insights 状态列表选项的控制台屏幕截图。
  8. 阈值输入值 50000,然后选择 Next (下一步)

    
                        显示 Contributor Insights 选项卡和按钮的控制台屏幕截图。
  9. 有关如何为 CloudWatch 警报配置通知的详细信息,请参阅使用 Amazon 警报。

使用 Contributor Insights(Amazon CLI)

  1. 在基表上Music启用 DynamoDB 的 CloudWatch 贡献者见解。

    aws dynamodb update-contributor-insights --table-name Music --contributor-insights-action=ENABLE
  2. AlbumTitle-index 全局二级索引启用 Contributor Insights for DynamoDB。

    aws dynamodb update-contributor-insights --table-name Music --index-name AlbumTitle-index --contributor-insights-action=ENABLE
  3. 获取 Music 表及其所有索引的状态与规则。

    aws dynamodb describe-contributor-insights --table-name Music
  4. 在全AlbumTitle-index局二级索引上禁用 DynamoDB 的 CloudWatch 贡献者见解。

    aws dynamodb update-contributor-insights --table-name Music --index-name AlbumTitle-index --contributor-insights-action=DISABLE
  5. 获取 Music 表及其所有索引的状态。

    aws dynamodb list-contributor-insights --table-name Music