概要

Amazon Elastic Compute Cloud (Amazon EC2) は、クラウド内でサイズ変更可能なコンピューティング能力を提供する Web サービスです。開発者が Web スケールのコンピューティングを簡単に利用できるように設計されています。

このインテグレーションを有効にすると、すべての EC2 メトリクスと、スケジュール設定されたメンテナンスなどの追加イベントが Datadog に表示されます。

計画と使用

インフラストラクチャーリスト

Amazon Web Services インテグレーションをまだセットアップしていない場合は、最初にセットアップします。

ブラウザトラブルシューティング

  1. AWS インテグレーションページで、Metric Collection タブの下にある EC2 が有効になっていることを確認します。

  2. Amazon EC2 のメトリクスを収集するには、次の必須アクセス許可を Datadog IAM ポリシーに追加します。詳細については、AWS ウェブサイト上の EC2 ポリシーを参照してください。

    AWS アクセス許可説明
    ec2:DescribeInstanceStatusインスタンスの健全性をアサートするために、ELB インテグレーションによって使用されます。すべてのインスタンスの健全性を記述するために、EC2 インテグレーションによって使用されます。
    ec2:DescribeSecurityGroupsEC2 インスタンスに SecurityGroup 名とカスタムタグを追加します。
    ec2:DescribeInstancesEC2 インスタンスと EC2 Cloudwatch メトリクスにタグを追加します。
  3. Datadog - Amazon EC2 インテグレーションをインストールします。

: Datadog で EC2 インスタンスのサブセットを監視したい場合、それらの EC2 インスタンスに datadog:true などの AWS タグを付与します。Datadog AWS インテグレーションページMetric Collection タブにある Limit metric collection to specific resources テキストボックスで、そのタグを指定します。

EC2 オートミュート

Datadog は、CloudWatch API からのホストステータスに基づいて、EC2 インスタンスの手動シャットダウンや AWS オートスケーリングによってトリガーされるインスタンスの停止に関連するモニターを事前にミュートすることができます。オートミュートされた EC2 インスタンスは、[モニターのダウンタイム][6ページで Show automatically muted hosts をオンにするとリストされます。

オートミュートを有効にするには、EC2 インテグレーションをインストールする必要があります。メトリクスの収集が何らかのタグが付いたホストに限られている場合は、それらのタグと一致するインスタンスだけがオートミュートされます。

EC2 インスタンスのシャットダウンが予期される場合にモニターをオフにするには、AWS インテグレーションページEC2 automuting チェックボックスをオンにします。

Amazon EC2 オートミュート

AWS Systems Manager (SSM) を使用した Agent のインストール

次の手順に従い、AWS Systems Manager を使用して Datadog Agent を EC2 インスタンスにインストールします。Amazon EC2 インスタンスに Agent をインストールするメリットについては、クラウドインスタンスに Datadog Agent をインストールする理由を参照してください。

Amazon Systems Manager UI による Agent のインストール (推奨)

  1. EC2 インスタンスの IAM ロールを構成し、AmazonSSMManagedInstanceCore 権限を有効にします。

  2. AWS SSM のドキュメントタブに移動します。

  3. datadog を検索します。注: 上記のリンクは US East-1 リージョンのものです。AWS Management コンソールのトップナビゲーションバーでリージョンを切り替えて、自分のリージョンに合ったドキュメントを見つける必要があるかもしれません。

  4. ニーズに応じて Linux または Windows のドキュメントを選択します。

  • Linux: datadog-agent-installation-linux
  • Windows: datadog-agent-installation-windows
  1. コマンドパラメーターを入力します。
  2. Agent をインストールする対象のインスタンスを選択します。
  3. Run をクリックします。
  4. 確認ステータスが終了するまで待ち、Datadog のインフラストラクチャーリストを確認します。

カスタム Agent の代替インストール

パラメーターストア

パラメーターストアで、以下のように指定してパラメーターを作成します。

  • 名前: dd-api-key-for-ssm
  • 説明: (オプション)
  • タイプ: 安全な文字列
  • KMS の主要なソース: 現在のアカウント
  • KMS キー ID: 選択されているデフォルト値を使用します
  • 値: Datadog API キー
ドキュメント

Systems Manager で、新しいドキュメントを作成します。

  • 名前: dd-agent-install
  • ターゲットタイプ: (オプション)
  • ドキュメントタイプ: コマンドのドキュメント
  • コンテンツ: JSON

Datadog US サイトの場合は、runCommand をご使用の <AWS_REGION> (例: us-east-1) で更新した dd-agent-install-us-site.json ファイルを使用します。Datadog EU サイトの場合は、dd-agent-install-eu-site.json を使用します。

コマンドの実行

Run Command で、Run command ボタンをクリックし、次の手順に従います。

  • コマンドのドキュメント:
    • 検索ボックスをクリックし、Owner -> Owned by me を選択します。
    • ドキュメントの横にあるラジオボタンをクリックします。
    • 必要に応じて、ドキュメントのバージョンを選択します。
  • ターゲット:
    • 対象の EC2 インスタンスを選択します。
  • 出力オプション (オプション):
    • CloudWatch output チェックボックスをオンにして、問題をログに記録します。
  • 他のセクション (オプション):
    • 他のセクションはセットアップに応じて変更します。

Run ボタンをクリックすると、ステータスを示す確認ページが表示されます。終了後に、Datadog でインフラストラクチャーリストをチェックします。

収集データ

Datadog Agent または別のログシッパーを使用して、Datadog にログを送信します。

リアルユーザーモニタリング

データセキュリティ

aws.ec2.cpucredit_balance
(gauge)
Number of CPU credits that an instance has accumulated.
Shown as unit
aws.ec2.cpucredit_usage
(gauge)
Number of CPU credits consumed.
Shown as unit
aws.ec2.cpusurplus_credit_balance
(gauge)
The number of surplus credits that have been spent by an unlimited instance when its CPUCreditBalance value is zero.
Shown as unit
aws.ec2.cpusurplus_credits_charged
(gauge)
The number of spent surplus credits that are not paid down by earned CPU credits, and which thus incur an additional charge.
Shown as unit
aws.ec2.cpuutilization
(gauge)
Average percentage of allocated EC2 compute units that are currently in use on the instance.
Shown as percent
aws.ec2.cpuutilization.maximum
(gauge)
Maximum percentage of allocated EC2 compute units that are currently in use on the instance.
Shown as percent
aws.ec2.disk_read_bytes
(gauge)
Bytes read from all ephemeral disks available to the instance.
Shown as byte
aws.ec2.disk_read_ops
(gauge)
Completed read operations from all ephemeral disks available to the instance.
Shown as operation
aws.ec2.disk_write_bytes
(gauge)
Bytes written to all ephemeral disks available to the instance.
Shown as byte
aws.ec2.disk_write_ops
(gauge)
Completed write operations to all ephemeral disks available to the instance.
Shown as operation
aws.ec2.ebsbyte_balance
(gauge)
Percentage of throughput credits remaining in the burst bucket for Nitro-based instances.
Shown as percent
aws.ec2.ebsiobalance
(gauge)
Percentage of I/O credits remaining in the burst bucket for Nitro-based instances."
Shown as percent
aws.ec2.ebsread_bytes
(gauge)
Average bytes read from all EBS volumes attached to the instance for Nitro-based instances.
Shown as byte
aws.ec2.ebsread_bytes.sum
(gauge)
Total bytes read from all EBS volumes attached to the instance for Nitro-based instances.
Shown as byte
aws.ec2.ebsread_ops
(count)
Average completed read operations from all Amazon EBS volumes attached to the instance for Nitro-based instances.
Shown as operation
aws.ec2.ebsread_ops.sum
(count)
Total completed read operations from all Amazon EBS volumes attached to the instance for Nitro-based instances.
Shown as operation
aws.ec2.ebswrite_bytes
(gauge)
Average bytes written to all EBS volumes attached to the instance for Nitro-based instances.
Shown as byte
aws.ec2.ebswrite_bytes.sum
(gauge)
Total bytes written to all EBS volumes attached to the instance for Nitro-based instances.
Shown as byte
aws.ec2.ebswrite_ops
(gauge)
Average completed write operations to all EBS volumes attached to the instance for Nitro-based instances.
Shown as operation
aws.ec2.ebswrite_ops.sum
(gauge)
Total completed write operations to all EBS volumes attached to the instance for Nitro-based instances.
Shown as operation
aws.ec2.host_ok
(gauge)
1 if the instance's system status is ok.
aws.ec2.instance_age
(gauge)
Time since instance launch
Shown as second
aws.ec2.network_address_usage
(gauge)
The maximum number of NAU units for a VPC.
Shown as unit
aws.ec2.network_address_usage_peered
(gauge)
The maximum number of NAU units for a VPC and all of its peered VPCs.
Shown as unit
aws.ec2.network_in
(gauge)
Average number of bytes received on all network interfaces by the instance.
Shown as byte
aws.ec2.network_in.maximum
(gauge)
Maximum number of bytes received on all network interfaces by the instance.
Shown as byte
aws.ec2.network_out
(gauge)
Average number of bytes sent out on all network interfaces by the instance.
Shown as byte
aws.ec2.network_out.maximum
(gauge)
Maximum number of bytes sent out on all network interfaces by the instance.
Shown as byte
aws.ec2.network_packets_in
(gauge)
Number of packets received on all network interfaces by the instance
Shown as packet
aws.ec2.network_packets_out
(gauge)
Number of packets sent out on all network interfaces by the instance
Shown as packet
aws.ec2.status_check_failed
(gauge)
1 if one of the status checks failed.
aws.ec2.status_check_failed_instance
(gauge)
0 if the instance has passed the EC2 instance status check.
aws.ec2.status_check_failed_system
(gauge)
0 if the instance has passed the EC2 system status check.

AWS から取得される各メトリクスには、ホスト名やセキュリティ グループなど、AWS コンソールに表示されるのと同じタグが割り当てられます。

:

  • Datadog - EC2 インテグレーションでは、デフォルトでは aws.ec2.instance_age メトリクスは収集されません。このメトリクスの収集を有効にするには、Datadog サポートまでお問い合わせください。
  • Amazon EC2 インテグレーションでメトリクスの収集を無効にしても、aws.ec2.host_ok はデフォルトで収集され、インフラストラクチャーのリストに想定外のホストが表示される可能性があります。不要なホストを除外したい場合、それらの EC2 インスタンスに datadog:true などの AWS タグを付与します。Datadog AWS インテグレーションページMetric Collection タブにある Limit metric collection to specific resources テキストボックスで、そのタグを指定します。

ヘルプ

aws.ec2.host_status
Returns your EC2 instance statuses as reported by the AWS console. Returns CRITICAL when there is a problem with your instance. Returns UNKNOWN when AWS does not have sufficient data to run a status check. Returns OK when your instance is running or is shut down properly.
Statuses: ok, critical, unknown

すぐに使える監視

Amazon EC2 インテグレーションは、パフォーマンスを監視し最適化するために、すぐに使える監視機能を提供します。

  • Amazon EC2 Overview ダッシュボード: すぐに使える Amazon EC2 Overview ダッシュボードを使用して、EC2 インスタンスの包括的な概要を得ることができます。
  • 推奨モニター: Amazon EC2 の推奨モニターを有効にすると、問題をプロアクティブに検出し、タイムリーなアラートを受信することができます。

ヘルプ

ご不明な点は、Datadog のサポートチームまでお問合せください。

その他の参考資料