Which AWS service collects metrics from running EC2 instances?
I want to send memory and disk metrics from my Amazon Elastic Compute Cloud (Amazon EC2) instances to Amazon CloudWatch Metrics. How can I do this? Show
Short descriptionResolutionNote: If you receive errors when running AWS Command Line Interface (AWS CLI) commands, make sure that you’re using the most recent AWS CLI version. You can download and install the CloudWatch agent manually using the AWS CLI or you can integrate it with AWS Systems Manager Agent (SSM Agent). The CloudWatch agent is supported on both Linux and Windows systems. Use these steps to install the CloudWatch agent: 1. Create IAM roles or users that enable the agent to collect metrics from the server and, optionally, integrate with AWS Systems Manager. Attach this IAM role to the EC2 instance that you want to install the agent on. 2. Download the agent package and install the agent package. 3. Create the CloudWatch agent configuration file and specify the metrics that you want to collect. This example shows a basic agent configuration file that reports memory usage and disk usage metrics on a Linux system: EC2 instances running on Linux that use the Elastic Network Adapter (ENA) publish network performance metrics. Version 1.246396.0 and later of the CloudWatch agent enable you to import these network performance metrics into CloudWatch. When you import these network performance metrics into CloudWatch, they are charged as CloudWatch custom metrics. For more information about the ENA driver, see Enabling enhanced networking with the Elastic Network Adapter (ENA) on Linux instances and Enabling enhanced networking with the Elastic Network Adapter (ENA) on Windows instances. How you set up the collection of network performance metrics differs on Linux servers and Windows servers. The following table lists these network performance metrics enabled by the ENA adapter. When the CloudWatch agent imports these metrics into CloudWatch from Linux instances, it prepends MetricDescription Name on Linux servers: Name on Windows servers: The number of packets queued and/or dropped because the inbound aggregate bandwidth exceeded the maximum for the instance.. This metric is collected only if you have listed it in the Unit: None Name on Linux servers: Name on Windows servers: The number of packets queued and/or dropped because the outbound aggregate bandwidth exceeded the maximum for the instance. This metric is collected only if you have listed it in the Unit: None Name on Linux servers: 1Name on Windows servers: 2The number of packets dropped because connection tracking exceeded the maximum for the instance and new connections could not be established. This can result in packet loss for traffic to or from the instance. This metric is collected only if you have listed it in the Unit: None Name on Linux servers: 5Name on Windows servers: 6The number of packets dropped because the PPS of the traffic to local proxy services exceeded the maximum for the network interface. This impacts traffic to the DNS service, the Instance Metadata Service, and the Amazon Time Sync Service. This metric is collected only if you have listed it in the Unit: None Name on Linux servers: 9Name on Windows servers: The number of packets queued and/or dropped because the bidirectional PPS exceeded the maximum for the instance. This metric is collected only if you have listed it in the Unit: None Linux setupOn Linux servers, the ethtool plugin enables you to import the network performance metrics into CloudWatch. ethtool is a standard Linux utility that can collect statistics about Ethernet devices on Linux servers. The statistics it collects depend on the network device and driver. Examples of these statistics include When the CloudWatch agent imports metrics into CloudWatch, it adds an On Linux servers, to import ethtool metrics, add an
The following example displays part of the CloudWatch agent configuration file. This configuration collects the standard ethtool metrics For more information about the CloudWatch agent configuration file, see Manually create or edit the CloudWatch agent configuration file.
Windows setupOn Windows servers, the network performance metrics are available through Windows Performance Counters, which the CloudWatch agent already collects metrics from. So you do not need a plugin to collect these metrics from Windows servers. The following is a sample configuration file to collect network performance metrics from Windows. For more information about editing the CloudWatch agent configuration file, see Manually create or edit the CloudWatch agent configuration file.
Viewing network performance metricsAfter importing network performance metrics into CloudWatch, you can view these metrics as time series graphs, and create alarms that can watch these metrics and notify you if they breach a threshold that you specify. The following procedure shows how to view ethtool metrics as a time series graph. For more information about setting alarms, see Using Amazon CloudWatch alarms . Because all of these metrics are aggregate counters, you can use CloudWatch metric math functions such as To view network performance metrics in the CloudWatch console
|