< Back

Monitoring: Amazon EC2

Amazon Elastic Compute Cloud (EC2) is a web service provided by Amazon Web Services (AWS) that allows users to rent virtual machines, called instances, to run their applications. EC2 provides a scalable, secure, and flexible infrastructure for deploying various computing workloads, including web and mobile applications, large-scale data processing, and high-performance computing.

EC2 also provides a range of management and monitoring tools, such as Amazon CloudWatch and AWS Auto Scaling, which allow users to monitor their instances and automatically adjust capacity to maintain performance and reduce costs.

Why should you monitor an EC2 instance?

Monitoring an EC2 instance is important for several reasons, including:

  1. Performance optimization: Monitoring an EC2 instance allows you to identify performance bottlenecks and optimize the performance of your application. You can monitor key metrics such as CPU utilization, memory usage, network traffic, and disk I/O to ensure your application runs smoothly and responds quickly to user requests.
  2. Availability: Monitoring an EC2 instance ensures your application is available and responsive to user requests. You can monitor metrics such as HTTP response codes and error rates to quickly identify any issues and take action to resolve them before they impact your users.
  3. Cost optimization: Monitoring an EC2 instance can help you optimize your costs by identifying idle resources that can be shut down and underutilized resources that can be downsized or removed. This can reduce your overall infrastructure costs and maximize the value of your resources.

In summary, monitoring an EC2 instance is critical to ensuring your application’s performance, availability, and cost efficiency.

Monitoring: Amazon EC2

How does monitoring Amazon EC2 work?

Without further ado, marbot monitors all EC2 instances in your AWS accounts. The following figure shows an alert delivered to a Microsoft Teams channel.

Amazon EC2 alert in Microsoft Teams

And here is the same alert in Slack.

mazon EC2 alert in Slack

How do you set up monitoring of Amazon EC2?

marbot works with Slack and Microsoft Teams. Please select your platform and follow the Getting Started guide.

Which metrics and events does marbot monitor in detail?

marbot creates CloudWatch alarms to automatically monitor the following metrics of all running EC2 instances.

Metric Description
CPUUtilization Get alerted if an EC2 instance is under high load for significant periods.
CPUCreditBalance Get alerted if a burstable EC2 instance runs out of CPU credits, resulting in a significant performance drop.
EBSIOBalance% Get alerted if an EC2 instance runs out of burst credits for EBS.
EBSByteBalance% Get alerted if an EC2 instance runs out of burst credits for EBS.
StatusCheckFailed Get alerted if an EC2 instance fails.
NetworkIn + NetworkOut Get alerted if an EC2 instance is under high network load for significant periods.

marbot creates EventBridge rules to monitor the following events automatically.

Event Type Description
EC2 Spot Instance Interruption Warning Get notified if a spot instance is interrupted (2 minutes before termination).
EC2 Instance Rebalance Recommendation Get notified if a spot instance is likely interrupted shortly.

How to fine-tune the monitoring of EC2 instances?

It is possible to fine-tune the CloudWatch alarms created by marbot by adding tags to your EC2 instance.

Tags are read every six hours. Therefore, it can take up to six hours before the CloudWatch alarm is adjusted.

tag key default value allowed values
marbot on on,off
marbot:cpu-utilization static static,anomaly_detection,static_anomaly_detection,off
marbot:cpu-utilization:threshold 80 0-100
marbot:cpu-utilization:period 3600 <= 86400 and multiple of 60
marbot:cpu-utilization:evaluation-periods 1 >= 1 and $period*$evaluation-periods <= 86400
marbot:cpu-credit-balance static static,anomaly_detection,off
marbot:cpu-credit-balance:threshold 20 >= 0
marbot:cpu-credit-balance:period 600 <= 86400 and multiple of 60
marbot:cpu-credit-balance:evaluation-periods 1 >= 1 and $period*$evaluation-periods <= 86400
marbot:ebs-io-credit-balance static static,anomaly_detection,off
marbot:ebs-io-credit-balance:threshold 20 0-100
marbot:ebs-io-credit-balance:period 600 <= 86400 and multiple of 60
marbot:ebs-io-credit-balance:evaluation-periods 1 >= 1 and $period*$evaluation-periods <= 86400
marbot:ebs-throughput-credit-balance static static,anomaly_detection,off
marbot:ebs-throughput-credit-balance:threshold 20 0-100
marbot:ebs-throughput-credit-balance:period 600 <= 86400 and multiple of 60
marbot:ebs-throughput-credit-balance:evaluation-periods 1 >= 1 and $period*$evaluation-periods <= 86400
marbot:network-utilization static static,anomaly_detection,static_anomaly_detection,off
marbot:network-utilization:threshold 80 0-100
marbot:network-utilization:period 3600 <= 86400 and multiple of 60
marbot:network-utilization:evaluation-periods 1 >= 1 and $period*$evaluation-periods <= 86400

More help needed? Or want to share feedback?

If you experience any issues, let us know.

E-mail icon
marbot teaser

Chatbot for AWS Monitoring

Configure monitoring for Amazon Web Services: CloudWatch, EC2, RDS, EB, Lambda, and more. Receive and manage alerts via Slack. Solve incidents as a team.

Add to Slack
Microsoft Teams
Add to Teams