Now with the Cloud9 workspace provisioned and setup, we’ll proceed with installing the tooling needed to add observability to our Lambda functions.
The steps we will execute are as follows:
All of the artifacts that we will use for this exercise are available in the repository for our sandboxed environment. To clone, let’s make sure that we are in the environment directory. Execute the following command:
If the result is /home/ec2-user/environment, then we are ready to go. Otherwise, change to the environment directory by running the following in your terminal window:
To clone the repo, run the below command in the terminal:
git clone https://github.com/Appdynamics/appd_aws_lambda_lab.git
This repo contains the following artifacts:
Now that we have a local copy of the repository, we will install the tooling needed. All of the tooling installation is contained within a single script. Our next steps are to change to the repository directory and run the installation script.
cd appd_aws_lambda_lab source ./install_tooling.sh
This script increases the disk size of the EC2 instance and installs the following components:
The final outputs of the script will display the versions of each of the components installed.
The sandboxed version of our application runs as a Docker compose application. To install all of the components, first make sure that we are within the repository directory:
If the output is /home/ec2-user/environment/appd_aws_lambda_lab, then we are ready to go. Otherwise change to the repository directory in the terminal.
Now, execute the setup script by running the following command:
This script will take anywhere from 5-10 minutes to execute and does the following:
All that is left to do is to start our application! We’re going to move to the docker-compose folder within our repository and run a startup script.
cd $HOME/environment/appd_aws_lambda_lab/docker-compose source ./start.sh
This script pulls down all of the appropriate containers and starts up the docker-compose application.
If you happen to get an error about running out of disk space, then you will need to manually resize the EBS volume attached to the EC2 instance. The setup script resizes the volume to 80 GB. See the AWS documentation for how to resize the instance.
The next thing that we will do is introduce load to our application. By putting our application under load, AppDynamics will be able to not only detect the different components of the application, but it will map out data flows between application components.
Allow 2-3 minutes for all of the application components to fully come online. During this period of time, the following things are happening for each service:
Once the 2-3 minutes have passed, start the load by executing the following command:
You will see a message stating
appending output to 'nohup.out'. This is totally expected for how we are running the load generation for the application. We’ll let the application run under load for about 5 minutes or so to allow AppDynamics to fully learn the components and data flows between components. Once this amount of time has passed, we’ll view our application in AppDynamics before instrumenting our Lambda functions.