Creating a Dashboard to Monitor your AWS Lambda function
Lab Steps
Introduction
Amazon CloudWatch allows you to create dashboards to monitor your applications and services. A dashboard is a collection of graphs and other widgets configured to display relevant information about your services or applications.
In this Lab Step, you will use CloudWatch to create a dashboard for your scheduled Lambda Function.
Â
Instructions
1. Navigate to CloudWatch in the AWS Console.
Â
2. Click Dashboards:
Â
3. To start creating a new dashboard, click Create dashboard:
Â
4. In the Dashboard name textbox, enter lab-dashboard and click Create dashboard:
Â
5. In the Add to this dashboard form, from the available widget types, select Line:
A CloudWatch dashboard contains one or more widgets. Widgets can be graphs, numbers, or plain text. In this Lab Step, you are using a Line graph to display the number of invocations over time.
In a production scenario, you might have many dashboards, each configured to monitor parts of your infrastructure. Dashboards are useful for displaying the health of services and applications, with a well-configured dashboard you can get this information by quickly and efficiently just by looking at it.
Â
6. In the Add to this dashboard box select Metrics:
Â
7. To open the time-range drop-down, click custom:
Â
8. In the minutes section, click 15:
Â
9. In the Metrics search box, type lab-function, and press enter:
10. Click Lambda > By Function Name:
Â
11. In the list of metrics, check the box for the Invocations metric and click Create widget:
Â
Your dashboard will look similar to the following:
Â
12. To save the dashboard, click Save:
Â
Summary
In this Lab Step, you created a dashboard in CloudWatch and added a graph of your Lambda functions invocations to it.
This concludes the Lab where you used Amazon Lambda to create a simple function that monitors a website. You used Amazon EventBridge to run your Lambda function on a schedule once per minute. Finally, you used Amazon CloudWatch to verify that your Lambda was being run on a schedule.
Check if the CloudWatch dashboard has been created