Collect metrics, logs, and traces with the CloudWatch agent - Amazon CloudWatch

Collect metrics, logs, and traces with the CloudWatch agent

The unified CloudWatch agent enables you to do the following:

  • Collect internal system-level metrics from Amazon EC2 instances across operating systems. The metrics can include in-guest metrics, in addition to the metrics for EC2 instances. The additional metrics that can be collected are listed in Metrics collected by the CloudWatch agent.

  • Collect system-level metrics from on-premises servers. These can include servers in a hybrid environment as well as servers not managed by AWS.

  • Retrieve custom metrics from your applications or services using the StatsD and collectd protocols. StatsD is supported on both Linux servers and servers running Windows Server. collectd is supported only on Linux servers.

  • Collect logs from Amazon EC2 instances and on-premises servers, running either Linux or Windows Server.

    Note

    The CloudWatch agent does not support collecting logs from FIFO pipes.

  • Version 1.300031.0 and later can be used to enable CloudWatch Application Signals. For more information, see Application Signals.

  • Version 1.300025.0 and later can collect traces from OpenTelemetry or X-Ray client SDKs, and send them to X-Ray.

    Using the CloudWatch agent allows you to collect traces without needing to run a separate trace collection daemon, helping to reduce the number of agents that you run and manage.

You can store and view the metrics that you collect with the CloudWatch agent in CloudWatch just as you can with any other CloudWatch metrics. The default namespace for metrics collected by the CloudWatch agent is CWAgent, although you can specify a different namespace when you configure the agent.

The logs collected by the unified CloudWatch agent are processed and stored in Amazon CloudWatch Logs, just like logs collected by the older CloudWatch Logs agent. For information about CloudWatch Logs pricing, see Amazon CloudWatch Pricing.

Metrics collected by the CloudWatch agent are billed as custom metrics. For more information about CloudWatch metrics pricing, see Amazon CloudWatch Pricing.

The CloudWatch agent is open-source under the MIT license, and is hosted on GitHub. If you would like to build, customize or contribute to the CloudWatch agent, see the GitHub repository for the latest instructions. If you think you’ve found a potential security issue, do not post it on GitHub or any public forum. Instead, please follow the instructions at Vulnerability Reporting or email AWS security directly.

The steps in this section explain how to install the unified CloudWatch agent on Amazon EC2 instances and on-premises servers. For more information about the metrics that the CloudWatch agent can collect, see Metrics collected by the CloudWatch agent.

Supported operating systems

The CloudWatch agent is supported on x86-64 architecture on the following operating systems. It is also supported on all minor version updates for each of the major versions listed here.

  • Amazon Linux 2023

  • Amazon Linux 2

  • Ubuntu Server versions 23.10, 22.04, 20.04, 18.04, 16.04, and 14.04

  • CentOS versions 9, 8, and 7

  • Red Hat Enterprise Linux (RHEL) versions 9, 8, and 7

  • Debian versions 12, 11 and 10

  • SUSE Linux Enterprise Server (SLES) versions 15 and 12

  • Oracle Linux versions 9, 8 and 7

  • AlmaLinux versions 9 and 8

  • Rocky Linux versions 9 and 8

  • The following macOS computers: EC2 M1 Mac1 instances, and computers running macOS 14 (Sonoma), macOS 13 (Ventura), and macOS 12 (Monterey)

  • 64-bit versions of Windows Server 2022, Windows Server 2019, and Windows Server 2016

  • 64-bit Windows 10

The agent is supported on ARM64 architecture on the following operating systems. It is also supported on all minor version updates for each of the major versions listed here.

  • Amazon Linux 2023

  • Amazon Linux 2

  • Ubuntu Server versions 23.10, 22.04, 20.04, 18.04, and 16.04

  • CentOS versions 9 and 8

  • Red Hat Enterprise Linux (RHEL) versions 9, 8, and 7

  • Debian versions 12, 11 and 10

  • SUSE Linux Enterprise Server 15

  • The following macOS computers: macOS 14 (Sonoma), macOS 13 (Ventura), and macOS 12 (Monterey)

Installation process overview

You can download and install the CloudWatch agent manually using the command line, or you can integrate it with SSM. The general flow of installing the CloudWatch agent using either method is as follows:

  1. Create IAM roles or users that enable the agent to collect metrics from the server and optionally to integrate with AWS Systems Manager.

  2. Download the agent package.

  3. Modify the CloudWatch agent configuration file and specify the metrics that you want to collect.

  4. Install and start the agent on your servers. As you install the agent on an EC2 instance, you attach the IAM role that you created in step 1. As you install the agent on an on-premises server, you specify a named profile that contains the credentials of the IAM user that you created in step 1.