Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Metrics from terminated Amazon EC2 instance

Tags:

amazon-ec2

I have set an auto scaling policy for my EC2 instances when CPU usage crosses 70% for 5 minutes. But sometimes there is a sudden spike and the server crashes. That instance got terminated and a new instance fires up.

In EC2 instance lists I do not see that terminated instance when I logged in after some period of crash time.

From the Amazon CloudWatch FAQs:

Q: Can I access the metrics data for a terminated Amazon EC2 instance or a deleted Elastic Load Balancer?

Yes. Amazon CloudWatch stores metrics for terminated Amazon EC2 instances or deleted Elastic Load Balancers for 2 weeks.

It says metric are available for 2 weeks. I am unable to find that in CloudWatch. Is this stored any other place?

like image 413
chanchal118 Avatar asked Feb 07 '23 04:02

chanchal118


1 Answers

Amazon CloudWatch captures metrics for Amazon EC2 instances and retains them for 15 months. Metrics cover CPU, disk access and network access.

Metrics can be viewed from the Amazon EC2 management console, under the Monitoring tab for any instances that are displayed in the console. This includes Running instances, Stopped instances and any instances Terminated in the past 60 minutes.

Metrics can also be viewed from the Amazon CloudWatch management console. Select EC2 in the navigation panel and a list of instances will be displayed, together with their metrics:

CloudWatch metrics for Amazon EC2

Metrics can also be obtained grouped by Auto Scaling Group:

CloudWatch grouping for Amazon EC2

All you need is the Instance ID and you should see metrics there.

like image 90
John Rotenstein Avatar answered Feb 09 '23 20:02

John Rotenstein