Verifying Your AWS Lambda Function Is Running on a Schedule

Lab Steps

lock
Logging In to the Amazon Web Services Console
lock
Creating an AWS Lambda Function for Scheduling
lock
Scheduling an AWS Lambda Function Using Amazon EventBridge Scheduler
lock
Verifying Your AWS Lambda Function Is Running on a Schedule
lock
Creating a Dashboard to Monitor your AWS Lambda function
Need help? Contact our support team

Here you can find the instructions for this specific Lab Step.

If you are ready for a real environment experience please start the Lab. Keep in mind that you'll need to start from the first step.

Introduction

Amazon CloudWatch is a fully-hosted and highly-scalable monitoring and observability service. CloudWatch can be used to monitor both AWS resources and services and applications external to AWS through integrations.

In this Lab Step, you will use CloudWatch to verify that the EventBridge schedule you created in the previous Lab Step is running your website monitoring Lambda function once per minute.

 

Instructions

1. In the search bar at the top, enter CloudWatch, and under Services, click the CloudWatch result:

alt

 

2. In the left-hand side menu click All metrics under Metrics:

alt

 

3. To open the time-range drop-down, click custom near the top above the chart:

alt

 

4. In the minutes section, click 15:

alt

You have changed the time range to 15 minutes. A time range is a time period over which to display multiple metrics. The time range can be set to a "relative" period as you have here, the last 15 minutes. Or it can be set to an "absolute" period, between two dates, as an example between the first and the third day of a specific month. 

 

5. In the Metrics search box, type lab-function, and press enter:

alt

 

6. Click Lambda > By Function Name:

alt

You will see a list of available metrics for your Lambda function.

The list will include the following metrics:

  • Invocations: How many times your function was ran
  • ConcurrentExecutions: The number of function instances that are processing events
  • Duration: How long your function took to execute
  • Errors: How many times your function threw an exception
  • Throttles: How many times your function was restricted from running due to multiple instances of the same function already running

 

7. In the list of metrics, check the box for the Invocations metric:

alt

 

8. Click on the Graphed metrics tab:

alt

 

9. Click the Period column on the metric and select 1 Minute:

alt

A "period" is the length of time associated with a specific Amazon CloudWatch statistic.

You can think of "period" as the precision of the graph. When set to 5 minutes all metric statistics in a 5 minute period are aggregated into one data point on the graph. When set to 1 minute, and when metric statistics are available at that level of granularity, the graph will show a data point for each minute.

 

10. Look at the graph and hover your mouse cursor over it. You will see a graph similar to the following:

alt

You will see a point on the graph for each minute the EventBridge schedule has been enabled in the last 15 minutes. Each data point represents one invocation of your Lambda function by your EventBridge schedule.

These metrics can take a few minutes to be populated in CloudWatch after creating the EventBridge schedule. If you aren't seeing any data points, wait a minute or two, and click the refresh button:

alt

 

Summary

In this Lab Step, you used CloudWatch to verify that EventBridge is running your Lambda function on a schedule once per minute.