Collecting custom metrics on EC2
In Chapter 3, CloudWatch Logs, Metrics, and Dashboard (under the Life cycle of a log section), we talked about how to collect logs from an EC2 instance and send those logs to the CloudWatch Logs console. But the tool we used in that example is the former log collection tool from CloudWatch – the CloudWatch agent. CloudWatch has a new agent called the unified CloudWatch agent. This new agent is designed to be able to collect both logs and metrics from an EC2 instance, unlike the old setup that had two different agents to collect logs and metrics, respectively. It has the ability to collect system-level EC2 metrics (CPU, disk, memory, network), system-level metrics for on-premises servers, and it is also supported on a wide range of Linux distributions (such as Amazon Linux, Red Hat Enterprise Linux, Ubuntu, CentOS, and Kali Linux) and on Windows servers. It is also able to collect logs from a particular file, and can be configured to point to...