Monitor Elastic Beanstalk with CloudWatch metrics, alarms, and SNS
Michael Wittig – 14 Mar 2018 (updated 17 Aug 2021)
AWS Elastic Beanstalk is a platform to run your applications on AWS. Elastic Beanstalk also provides features to help you to monitor your applications. In this post, we look at those features and how you can use them to monitor EB.
Each EC2 instance sends metrics to CloudWatch that we can monitor with CloudWatch alarms. We recommend creating alarms for the following metrics:
CPUUtilization: The percentage of CPU used.
CPUCreditBalance: The number of CPU credits left (only applies to t* instance types).
Elastic Beanstalk comes with a mechanism to customize environments that you can use to automate the creation of CloudWatch alarms.
- In your Elastic Beanstalk project’s source code, create a folder
- Copy a file such as marbot-elastic-beanstalk.config into the
.ebextensionsfolder (file must end with .config!).
- Adjust the MarbotEndpointId option_settings in the
- Deploy the application.
Events via SNS
Besides metrics, Elastic Beanstalk sends out notifications if the state of the environment has changed. E.g., because of a failed deployment.
AWS does not support filtering the notifications. You likely end up with a lot of noise and the risk of missing the critical notifications without a custom filter.
Set up instructions
Monitor Elastic Beanstalk and receive alerts in Slack or Microsoft Teams! marbot filters the events for you as well.
It couldn't be easier!
- Add marbot to Slack or Microsoft Teams.
- Invite marbot to a channel.
- Follow the setup wizard.
Take your AWS monitoring to a new level! Chatbot for AWS Monitoring: Configure monitoring, escalate alerts, solve incidents.