Over the past decade or two, we have seen an incredible advancement in the world of Cloud Computing. According to this 2018 Forbes article, “77% of enterprises have at least one application or a portion of their enterprise computing infrastructure in the cloud.” As more and more companies migrate their applications to the cloud, cloud providers have developed efficient ways to help these businesses monitor the state of their applications while providing useful insights into how best to optimize these applications.
Amazon Web Services, being the top cloud provider in terms of customer base, provides an extensive suite of applications to serve this purpose, with Amazon CloudWatch being its premier monitoring and observability offering. MetricFire integrates with AWS CloudWatch to give AWS users a second platform to make their monitoring dashboards more customized, and to integrate with a more diverse set of plugins. Sign up for the MetricFire free trial and integrate your CloudWatch with our Hosted Graphite and Grafana. You can also read more about our integrations on the Hosted Graphite Docs.
Amazon CloudWatch is a monitoring and observability service for AWS cloud resources and the applications running on AWS. CloudWatch seamlessly integrates with various compute services on the AWS platform, collecting logs and metrics for your apps that are running on those platforms. Using this data collected from your applications, CloudWatch can then provide you with actionable insights to help monitor your running applications, respond to system-wide performance changes, optimize resource utilization, and get a unified view of operational health. To read more about CloudWatch, refer to these MetricFire blogs: Kubernetes on AWS resources and Getting started with CloudWatch.
One of the services CloudWatch integrates with is Amazon’s Elastic Compute Cloud ( EC2 ), which is AWS’ main virtual machine compute offering. Given that EC2 instances, more often than not, serve as the core computing workers for most applications running on AWS, monitoring their “health” and performance is imperative. This monitoring is done with the use of certain metrics captured and processed by CloudWatch, and forms the basis of this article.
Amazon EC2 instances emit vast amounts of raw data and statistics on the state of its processes, its health, and its performance. This data is collected by CloudWatch, which is integrated into the EC2 suite, and is processed into readable, near real-time metrics, which are then displayed using easy to read graphs directly from the EC2 console. By default, EC2 instances spit out this data to CloudWatch in 5-minute periods, but if you want more granularity, you could enable detailed monitoring for your instances either before you create them, or for an already running instance using the EC2 console or the AWS CLI. Detailed monitoring allows CloudWatch to collect EC2 data in 1 minute granularities. More on this can be found in the AWS documentation here.
Amazon EC2 instances send raw data to CloudWatch about status, health and performance in the form of metrics. This data is sent every 5 minutes by default, or every minute if detailed monitoring is enabled. Given the possibly endless use cases of EC2 instances, there exist a vast amount of metrics that can be collected by CloudWatch to track literally every single aspect of these instances.
These metrics track the state of certain core operations on your instances. They Include:
If there are no instance store volumes, either the value is 0 or the metric is not reported:
There are certain EC2 instance types (T3, T3a, and T2 instances) called burstable performance instances, which are designed to provide a baseline level of CPU performance with the ability to burst to a higher level of performance when required by your workload. This burst capacity is governed by CPU credits - generally, the more CPU credits an instance accumulates over time, the longer its burst capacity. The following CPU metrics are available just for burstable instances as they help to track available credits and credit usage. One thing to note is, these metrics are not available for detailed monitoring:
There exist a special category of metrics to track the read and write speeds of Nitro Based instances using Elastic Block Storage ( EBS ). In an effort to keep this article within a reasonable length, you can head over here to read about these metrics given that this would require a certain understanding of what Nitro Based instances are.
This set of metrics record data on the status of your instance. By default, they are available at a 1-minute frequency at no charge. For a new instance, status check metric data is available only after the instance has completed the initialization state.
The StatusCheckFailed metric can be seen as a combination of StatusCheckFailed_Instance and StatusCheckFailed_System metrics.
Usage metrics are CloudWatch metrics meant to help provide visibility into your account's usage of resources. Currently, the only usage metric available for EC2 instances is the ResourceCount metric, which tracks the number of the specified resources running in your account. The resources are defined by the dimensions set with the metric. These dimensions include
You can use this metric to visualize your current EC2 usage on CloudWatch graphs and dashboards and you can set alarms on these metrics to ensure your EC2 usage does not exceed certain quotas.
All of these metrics and more are easily accessible from the EC2 dashboard for each instance. Check out the picture below for a view of how these metrics are graphed in the Monitoring tab of the EC2 dashboard for a demo instance I have running.
As mentioned earlier, monitoring the state of your instances is imperative to keeping your applications healthy, and using the above metrics (and the many others) provided by AWS, you can achieve this with relative ease.
Many CloudWatch users become interested in MetricFire when they are looking for a secondary platform that offers more flexibility. MetricFire allows for a broad set of plugins, such as those through Grafana labs, as well as unlimited dashboarding, querying and alerting.
You can actually connect your AWS CloudWatch account to MetricFire so you can reduce the amount of metrics you monitor with CloudWatch, while still getting the benefit of monitoring the essentials with CloudWatch.
MetricFire's hosted Graphite provides an Amazon AWS CloudWatch add-on available in the Add-Ons page of your account. This add-on syncs the metrics from the specified AWS services/regions into your account.
To connect to your CloudWatch account, you need to set up Identity and Access Management (IAM) access keys in your AWS Account, with the appropriate permissions to allow MetricFire's Hosted Graphite to connect and collect your metrics.
In this article we have seen how to use EC2 CloudWatch metrics, from understanding their role within the AWS environment to dashboarding EC2 metrics in CloudWatch.
Sign up for the MetricFire free trial to explore what MetricFire has to offer, and to try the AWS integration. Also, speak with the MetricFire team directly by booking a demo and talk with us about how to best monitor your EC2 setup.