CloudWatch Contributor Insights for DynamoDB の開始方法 - Amazon DynamoDB

CloudWatch Contributor Insights for DynamoDB の開始方法

このセクションでは、Amazon DynamoDB コンソールまたは AWS Command Line Interface (AWS CLI) で Amazon CloudWatch Contributor Insights を使用する方法について説明します。

次の例では、「DynamoDB の使用開始」チュートリアルで定義された DynamoDB テーブルを使用します。

Contributor Insights の使用 (コンソール)

コンソールで Contributor Insights を使用するには
  1. AWS Management Console にサインインして DynamoDB コンソール (https://console.aws.amazon.com/dynamodb/) を開きます。

  2. コンソールの左側のナビゲーションペインで、[テーブル] を選択します。

  3. Music テーブルを選択します。

  4. [Monitor] (モニタリング) タブを選択します。

  5. [Turn on CloudWatch Contributor Insights] (CloudWatch Contributor Insights を有効にする) を選択します。

    モニタータブとボタンを表示するコンソールのスクリーンショット。
  6. [Manage Contributor Insights] (投稿者のインサイトを管理) ダイアログボックスの [Contributor Insights Status] (Contributor Insights のステータス) で、Music 基本テーブルと AlbumTitle-index グローバルセカンダリインデックスの両方に対して [Enabled] (有効) を選択します。[Confirm] (確認) を選択します。

    Contributor Insights のステータスリストオプションを示すコンソールスクリーンショット

    このオペレーションが失敗した場合は、Amazon DynamoDB API リファレンスの「DescribeContributorInsights FailureException」を参照して考えられる原因を検討してください。

  7. [View in DynamoDB] (DynamoDB で表示) を選択します。

    Contributor Insights 設定の [DynamoDB で表示] ボタンが表示されているコンソールのスクリーンショット。
  8. Contributor Insights グラフが Music テーブルの [Contributor Insights] (投稿者のインサイト) タブに表示されます。

    Music テーブルのいくつかのグラフを含む [Contributor Insights] タブを表示するコンソールのスクリーンショット

CloudWatch アラームの作成

以下のステップに従って、CloudWatch アラームを作成し、パーティションキーが 50,000 件の ConsumedThroughputUnits を超えたときに通知を受け取ります。

  1. AWS Management Console にサインインして、CloudWatch コンソール (https://console.aws.amazon.com/cloudwatch/) を開きます。

  2. コンソールの左側のナビゲーションペインで、[Contributor Insights] を選択します。

  3. [DynamoDBContributorInsights-PKC-Music] ルールを選択します。

  4. [アクション] ドロップダウンを選択します。

  5. [View in metrics (メトリクスで表示)] を選択します。

  6. [Max Contributor Value (寄稿者の最大値)] を選択します。

    注記

    Max Contributor ValueMaximum のみが有用な統計を返します。このリストの他の統計は、意味のある値を返しません。

    [Contributor Insights] タブとボタンを表示するコンソールのスクリーンショット
  7. [アクション] 列で、[Create Alarm (アラームの作成)] を選択します。

    Contributor Insights のステータスリストオプションを示すコンソールスクリーンショット
  8. [しきい値] として 50000 の値を入力し、[次へ] を選択します。

    [Contributor Insights] タブとボタンを表示するコンソールのスクリーンショット
  9. アラームの通知を設定する方法の詳細については、「Amazon CloudWatch アラームの使用」を参照してください。

Contributor Insights の使用 (AWS CLI)

AWS CLI で Contributor Insights を使用するには
  1. Music 基本テーブルで CloudWatch Contributor Insights for DynamoDB を有効化します。

    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 グローバルセカンダリインデックスで CloudWatch Contributor Insights for DynamoDB を無効化します。

    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