AWS – AWS CloudWatch

Installing an FTP server

The real value of collecting metrics is the ability to spot trends and relationships (often unknown or unexpected) between disparate systems. With this kind of visibility, you are able to identify and troubleshoot issues before they become an incident.

In addition to providing a way to aggregate and view metrics from your systems, the
CloudWatch service also makes it easy to create monitoring dashboards, allowing you to quickly and clearly view the most important metrics.

Getting ready

You will need to have some metrics already present in CloudWatch in order to create a dashboard. If you have been using AWS services (for example EC2, RDS, DDB, and so on), then you should have plenty—almost all of the AWS services populate metrics in CloudWatch by default.

How to do it…

In this recipe, you will set up a simple CloudWatch dashboard, and you will learn about the different kinds of widgets that can be added to a dashboard:

  1. Log in to your AWS account and navigate to CloudWatch:

  1. Go to the Dashboards section of the console via the link on the left-hand menu and click the Create dashboard button:

Creating a dashboard
  1. Choose the type of widget that you want to use to display your metric. In this example, we will choose the most versatile, Line. Navigate to the All metrics tab to find the metric(s) you want to include, selecting it by clicking the tick box on the left of the metric details. You will see a preview of the metric(s) if there is any data to display:

Add metric graph screen
  1. Once selected, you can modify how the metric is displayed via the settings on the Graphed metrics tab. In this case, we have given the widget a name and changed the Period setting for our metric to 1 Minute to reflect the additional granularity that is available:

Edit graph screen
  1. Once you click Create widget, you will see your widget on the dashboard. Once you click Save dashboard, it will appear under the Dashboards heading on the left-hand menu:

Save dashboard screen
  1. At the dashboard level, you can turn on Auto refresh and the Refresh interval. You can resize and rearrange your widgets by dragging them. Just remember to click  Save dashboard to persist any changes. As you can see here, I have added widgets for DiskReadBytes and CPUCreditBalance to my dashboard:

Adding widgets

How it works…

CloudWatch dashboard’s value is the ease and simplicity with which it allows you to publicize your most important metrics.

As with any dashboard, make sure that the metrics you choose to display are relevant and actionable. There’s no point in displaying a metric if there’s no action required when it changes.

Widget types

Line graphs are not the only type of widget that can be displayed in a dashboard. The following types can also be displayed:

  • Stacked area
  • Number
  • Text
  • Query results

Depending on the type of metrics you are collecting or are interested in, you should experiment with different types of widgets to display them. Not all metrics are suited to line graphs.

You can use the Amazon CloudWatch API to automate the creation of dashboard widgets in response to new resources that are being created or terminated in your environment.

Comments are closed.