The course is part of these learning paths
CloudWatch is a monitoring service for cloud resources in the applications you run on Amazon Web Services. CloudWatch can collect metrics, set and manage alarms, and automatically react to changes in your AWS resources. Amazon Web Services Cloudwatch can monitor AWS resources such as Amazon EC2 instances, DynamoDB tables, and Amazon RDS DB instances. You can also create custom metrics generated by your applications and services and any log files your applications generate. You’ll see how we can use Amazon CloudWatch to gain system-wide visibility into resource utilization, application performance and operationally you’ll use these insights to keep applications running smoothly. This course includes a high-level overview of how to monitor EC2, monitor other Amazon resources, monitor custom metrics, monitor and store logs, set alarms, graph and view statistics, and how to monitor and react to resource changes.
- Systems Admins
- Operational Support
- Solution Architects working on AWS Certification
- Anyone concerned about monitoring data or AWS recurring billing
- AWS Console Login
- General knowledge of how to launch an Elastic Compute Cloud (EC2) instance on either Linux or Windows
- View CloudWatch Documentation at https://aws.amazon.com/cloudwatch/
- An operational EC2 (Windows/Linux)
- Monitor EC2 and other AWS resources
- Build custom metrics
- Monitor and store log information from Linux instances
- Set alarms for metrics to take action on an instance or auto-scaling group
- Create a dashboard to monitor EC2 instances
- React to load to trigger auto scaling horizontally within AWS.
This Course Includes:
- Over 90 minutes of high-definition video
- Console demos
What You'll Learn:
- Course Intro: What to expect from this course
- Getting Started: How to launch an EC2 instance
- Building a Dashboard: How to take the metrics from the instance and create a dashboard
- Monitoring EC2 Instances: How and why you should be monitoring the environment in Amazon Web Services
- Sending Log Files to Cloudwatch: A lesson on the importance of sending log files to Cloudwatch
- Alarms: How to specify alarms
- Course Conclusion: Course summary
Welcome to CloudWatch Lesson Three: Building a Dashboard. Our instance that we launched has been running for a few minutes now. During that time, it has been reporting metrics to CloudWatch. You'll notice that CloudWatch has begun to capture those metrics and create trend lines over time. Let's go ahead and head over to CloudWatch by clicking on the three-sided box and then selecting CloudWatch from Management Tools. If we wanted to look at these metrics all together, we could simply click on Dashboards and Create a Dashboard. Let's go ahead and give it a name.
Once named, Amazon Web Services will ask you to add a metric to this dashboard. Let's go ahead and select a line and configure; from this point, we would like to make a trend of the current CPU Utilization of our EC2 instance. We will select EC2 per instance metrics. Then we will find CPU Utilization and select it. Once you've selected it, click on the Create widget. We've now added a trend line of CPU Utilization to our dashboard. It's important to note that you must save the changes to the dashboard before you exit this screen. We're not quite done yet.
CPU Utilization trend is good, but it's also valuable to know what it is right now. Let's go ahead and add another widget. We're going to add a number, and we're going to configure it. We'll select EC2 per instance metrics, and we'll select the same metric again, but this time, it's as a number. Let's go ahead and create that widget. Now, we can see that our CPU Utilization is quite low. Now that we have two metrics in our dashboard, let's take a little tour around the dashboard.
As a best practice, it's a great idea to click Save Dashboard. If you forget, you will get a warning to save prior to abandoning this screen. Over on the right hand side, you have a selection for how long of a view do you want your metrics presented. You can do one hour, three hours, 12 hours, one day, three days, one week, or custom. The most interesting thing about custom is you can select the time zone you want your metrics reflected on. Many users in the enterprise will choose universal time coordinated. However, this can be confusing. Often, it's best to select the local time zone.
Now that we've selected the time zone that works best for our operation, let's take a look at some of the things you can do. You have the ability to expand or even resize your widget. You could make it smaller or not. The other thing is you can edit the graphing options. Let's assume, for CPU Utilization, we're not interested in the current range provided on the left access. We could decide that we want that to be zero to 100% CPU Utilization.
If we want to do that, all we have to do on the left access is put in zero for our minimum and 100 for our maximum, and update the widget. You'll see that the scale on the left is immediately updated. Again, this is considered a change, and if you like the change, you should save the dashboard. We can also make changes to the color of the trend line and the type of graph that it is. You'll find these options under the Edit menu. To change the type of graph, you could click Stacked Area or Number.
Let's click Stacked Area, and then, back under Graph Metrics, let's change the color. This color change is a new feature in Amazon CloudWatch, and we're glad to have it. It allows us to assign a color to different servers and helps with a visual separation. Once you've decided you like your color and change to a stacked graphic, go ahead and update the widget. You'll notice that right away, it changes the color of the trend line in our widget. If you like these changes, click Save Dashboard.
At some point, you're gonna have the desire to change the widget labels. In this case, we're going to change CPU Utilization. We're going to relabel it our Cloud Academy Instance CPU Utilization. It's critical that you click Enter, or Return if you're a Mac user, at this point because if you click away from it, it will not commit the change. Go ahead and press Enter or Return, and you'll update the label.
Another convenient feature of CloudWatch dashboards is the ability to duplicate an existing widget. To do this hover until you find the down chevron, and simply duplicate. The reason you might want to do this is to display the same data in a different way. For example, in this case, we have two metrics that are identical, but let's go back and edit this metric. We'll change the graphing option to a line. We'll update the widget, and now, we have a line which we can resize, expand. Duplicating a metric quickly solves two problems.
One is that it guarantees that you've selected the same metric twice, and it allows you to look at trend data as well as current data in the minimum number of steps. In our current example, it's important to note that we're actually looking at the same metric in three separate widgets. Interestingly, they don't look the same. In the top widget, you'll notice our scale is zero to 100% CPU Utilization, which we set manually by editing the left access scale. Because of the scale and the height of this particular widget, it appears that our CPU, which is the green line, is running at 0%.
We'll notice in the middle widget that our actual CPU Utilization, which is updated every five minutes with basic monitoring, is running at 3/100 of a percent. We'll also notice in the bottom widget that the CPU Utilization is moving around a bit. All of these are accurate, and they're based upon the scales at which we're using.
You'll notice that Amazon automatically creates a scale, where we can see some variability. If you want to add additional metrics to this dashboard, you'll continue the process that we used earlier. You'll add a widget. You'll select the type of widget that you want to see, and click Configure. We'll continue to look at EC2 metrics in a per instance basis. This time, we're gonna add two metrics.
We're going to add Read, and we're also gonna add Write. Let's create this widget, and we'll note that both of the metrics are put side-by-side. Again, we can move this metric or even rename it if we like. If you want to add text or a header or important information about what this dashboard monitors, we have a widget that does exactly that. We can click Add Widget and then select Text.
This allows you to configure anything that you like in a text header. You can also add buttons or a link, and it will allow you to put those buttons right in this section. We'll go ahead and click Create Widget. You'll see now that we have the ability to add important information, labels, buttons, and even code blocks to our CloudWatch dashboard.
You could make a nice header with this, and often, I provide a link to this dashboard. You'll provide a link by copying the link in your browser and inserting it in there. You have the ability to edit this, just like any other text box or widget. Note that the use of pound or pound pound creates a subheading, and the URLs are referenced with link in brackets. Let's go ahead and click Update Widget, Save Dashboard, and we've created our first CloudWatch dashboard. In the beginning of this lesson, we launched an EC2 instance.
If you need more information about that, you can consult the documents at amazon.com or other courses with Cloud Academy. We also looked at basic monitoring via the EC2 tab, and then we created a simple dashboard in CloudWatch. It's a best practice when using text box not to put the password for SSH or administrative passwords in the text box in CloudWatch. We also discovered that not all information about our instance was available yet. We'll look more at that in an upcoming lesson.
About the Author
Network engineer and program analyst.