Chapter 5. Monitoring Amazon EC2 Instances

In this chapter, we will cover recipes for:

  • Collecting EC2 metrics using AWS CloudWatch
  • Collecting custom metrics from EC2 instances
  • Monitoring costs using CloudWatch
  • Sending an e-mail based on a CloudWatch alarm
  • Using CloudWatch Logs

Introduction

Amazon CloudWatch is AWS's monitoring service. It can be used to monitor your applications and AWS resources. AWS CloudWatch works with all key AWS services including EC2, RDS, DynamoDB, Elastic MapReduce, Kinesis, CloudSearch, and so on. CloudWatch provides several out-of-the-box metrics such as CPU utilization, network utilization, and disk I/O metrics from EC2 instances. However, you can also collect custom metrics from your applications.

AWS Management Console can be used to view, search, and graph the metrics data loaded by Amazon CloudWatch. CloudWatch stores data as a series of time stamped data points.

One of most common use cases for CloudWatch is to use it to set alarms and take actions, based on the metrics. For example, you can stop, terminate, recover, or reboot an EC2 instance in response to a CloudWatch alarm being raised. CloudWatch Logs lets you collect your application, system, and custom log files into AWS CloudWatch Logs for analysis.

AWS CloudWatch dashboard is used to visualize the metrics. You can also build customized dashboards for your CloudWatch metrics. The data for these dashboards can be pulled in from multiple regions to provide an overall view of your environment.

In addition, you can create specific CloudWatch alarms to alert the user via e-mail or autoscale your application tiers based on the metrics. CloudWatch can also be used to manage your costs, for example, deleting idle instances or alerting you when costs exceed a certain threshold.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset