Elastic Beanstalk monitoring
Hello Everyone
Welcome to CloudAffaire and this is Debjeet.
In the last blog post, we have discussed saved configurations in Elastic Beanstalk.
https://cloudaffaire.com/elastic-beanstalk-saved-configurations/
In this blog post, we will discuss Elastic Beanstalk monitoring.
Elastic Beanstalk monitoring:
Using elastic beanstalk, you can monitor your application, environment and resources associated with it. AWS Elastic Beanstalk uses information (CloudWatch metrics) from multiple sources (EC2, ELB, RDS, SQS, Autoscaling etc.) to determine your application health status. Elastic Beanstalk provides two types of monitoring scheme Basic and Enhanced.
Basic Health Reporting: In basic health reporting, metrics gathered by the resources in your environment is published to CloudWatch in five-minute intervals. This includes operating system metrics from EC2, request metrics from Elastic Load Balancing.
Note: With basic health reporting, the Elastic Beanstalk service does not publish any metrics to Amazon CloudWatch.
Enhances Health Reporting: In enhanced health reporting, metrics are gathered by health agent in your EC2 instance is published to CloudWatch every 10 seconds interval. This includes operating system metrics from EC2, request metrics from Elastic Load Balancing.
Note: With enhanced health reporting, the Elastic Beanstalk service directly publishes metrics to CloudWatch.
Next, we are going to explore different monitoring options available in Elastic Beanstalk using a demo.
Prerequisite for this demo:
- One EC2 AWS Linux 2 instance with proper access.
- One application with a running environment (This is a continuation from the previous demo).
Step 1: Login to the EC2 instance and assume access for EB CLI.
1 2 3 4 5 |
## Login to the EC2 instance ## Assume assess and get inside your application directory cd sh assume_role.sh cd MyShoppingListV2 |
Step 2: Configure your environment for basic health reporting.
1 2 3 4 5 6 |
## Configure your environment for basic health reporting. ## Update the Systemtype from enhanced to basic eb config ## Check your environment health eb health |
Note: If you create your environment in the Elastic Beanstalk console or with the EB CLI, enhanced health is enabled by default. Since our environment was configured with EB CLI, enhanced health reporting was enabled by default which we have changed to basic.
Our environment is set for basic health reporting.
Next, we are going to configure enhanced health reporting for our environment.
Step 3: Configure your environment for enhanced health reporting.
1 2 3 4 5 6 |
## Configure your environment for enhanced health reporting. ## Update the Systemtype from basic to enhanced eb config ## Check your environment health eb health |
Note: We have configured and updated the monitoring for our environment using EB CLI, but you can use AWS console as well as API for the same.
Cleanup:
1 2 3 4 5 6 7 8 |
## Delete the saved configuration eb config delete MyShoppingListV2 ## Terminate your application eb terminate MyShoppingListENV2 --force --all ## Clear application directory cd .. && rm -rf MyShoppingList Elastic-Beanstalk |
Hope you have enjoyed this article. In the next blog post, we will create an Elastic Beanstalk Application with custom VPC and RDS using configuration files (.ebextension).
To get more details on AWS Elastic Beanstalk, please refer below AWS documentation
https://docs.aws.amazon.com/elastic-beanstalk/index.html