Visualizing ECS Scaling Metrics

Visualizing ECS Metrics with CloudWatch Dashboards

Before we start testing our cluster scaling, let’s check out how to visualize the scaling activities in the cluster.Go back to your initial terminal and run the command below to create the CloudWatch dashboard to watch key metrics

cd ~/environment/ec2-spot-workshops/workshops/ecs-spot-capacity-providers/
sed -i -e "s#%AWS_REGION%#$AWS_REGION#g" cwt-dashboard.json
aws cloudwatch put-dashboard --dashboard-name EcsSpotWorkshop --dashboard-body file://cwt-dashboard.json

The output of the command appears as below.

{
"DashboardValidationMessages": []
}

In the AWS Cloudwatch console select the newly created dashboard, drag it right/down to expand to view the graphs properly and save the dashboard.

Cloud Watch

Question: What are initial values of CapacityProviderReservation metrics for CP-OD and CP-SPOT capacity providers when there are no tasks or instances running in the ECS cluster, and why?

Click to expand the answer.

Visualizing ECS and Cluster metrics with C3VIS (Cloud Container Cluster Visualizer) Tool

C3vis is an open source tool useful to show the visual representation of the tasks placements across instances in an ECS Cluster. We will use it as an example to display how tasks are placed in different capacity providers. Let’s first setup the application. Go back to the in your Cloud9 Environment, and create a new terminal, we will use that terminal to run and expose C3VIS.

The following screenshot shows how to create a new terminal : c3vis

The following lines, clone the c3vis tool repository, build the c3is application docker image and run the container.

cd ~/environment/
git clone https://github.com/ExpediaDotCom/c3vis.git
cd c3vis 
docker build -t c3vis .
docker run -e "AWS_REGION=$AWS_REGION" -p 8080:3000 c3vis

Open the preview application in your cloud9 environment and click on the arrow on the top right to open the application in the browser

c3vis

The initial screen will appear as below, since there are no tasks or instances running in the cluster for now.

c3vis

Since our ECS cluster is empty and does not have any instances, the c3vis application shows an empty page.