Monitoring Categories – Logging and Monitoring – ANS-C01 Study Guide

Monitoring Categories

There are three different types of monitoring that allow you to pick which one best fits your needs and budget. By selecting either default, detailed, or custom monitoring, you are selecting the time interval between measurements.

Standard monitoring is the default and supported by all AWS services. The interval is 5 minutes, and there is no charge for this service level.

FIGURE 5.2 CloudWatch metric groups

The detailed monitoring type is at a 1-minute interval, must be user enabled, and has a charge applied. However, detailed monitoring at 1-minute intervals is the default configuration for the elastic load balancer and relational database services. Custom metrics can be defined down to the 1-second level and are available at an additional cost.

Custom detailed monitoring has a 1-minute interval and can be applied per instance metric, so it does not require you to enable it globally, thereby saving costs. The cost is applied only to the instance that consumes the service to control expenses.

Detailed monitoring is useful where quick responses are required. For example, you may apply detailed monitoring to the CPU utilization for a web server or its connection count to be able to proactively add capacity compared to standard monitoring, which will have a longer measurement window and slower reaction time. Custom monitoring gives you the most granular interfaces down to 1 second. A use case for custom measurements would be when running containers such as ECS or Fargate where it is beneficial to create containers quickly. The 1-second interval increases your response to events and allows you to scale much faster than if you were measuring at 1- or 5-minute intervals. Detailed monitoring is available only on selected services and can be enabled in the EC2 console, as shown in Figure 5.3.

Agents

In addition to the CloudWatch integration with AWS managed services, there is also CloudWatch agent code that can be installed on your Windows or Linux servers to collect data and forward it to the CloudWatch service.

The agent is installed on your servers and runs in the background. The agent collects logs from EC2 instances and on-premise Linux and Windows servers. Once the agent is installed, internal system metrics are collected using the EC2 instance metrics and custom guest metrics. There is a long list of metrics that can be collected by the agent that can be viewed on the AWS documentation site at https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/metrics-collected-by-CloudWatch-agent.html. The agent can be installed on hybrid servers and servers that are not managed by AWS.

The CloudWatch agent is open-source under the MIT license and is hosted on GitHub at https://github.com/aws/amazon-cloudwatch-agent. The agent listens on the default socket tcp:25888.

FIGURE 5.3 Enabling detailed monitoring

You can store and view the agent metrics that are processed using the CloudWatch service the same as with AWS-generated metrics. The namespace used is CWAgent and can be modified. All logging data collected by the agents can be forwarded to CloudWatch just as with any other logging you are operating. These are stored in CloudWatch logs.

All metrics collected by the agent will be billed as custom metrics.