Implement Custom Metrics and Logs in Application Using CloudWatch

Implement Custom Metrics and Logs in Application Using CloudWatch
Implement Custom Metrics and Logs in Application Using CloudWatch

CLOUD LABS



Implement Custom Metrics and Logs in Application Using CloudWatch

In this Cloud Lab, you’ll learn how to instrument an application to publish custom logs and metrics to Amazon CloudWatch using Embedded Metric Format (EMF) and the CloudWatch SDK. You’ll also explore how to query and analyze these logs and metrics using CloudWatch Metrics Insights and CloudWatch Log Insights.

8 Tasks

beginner

2hr

Certificate of Completion

Desktop OnlyDevice is not compatible.
No Setup Required
Amazon Web Services

Learning Objectives

Understanding of CloudWatch Embedded Metric Format and SDK to publish custom metrics and logs
Hands-on experience querying custom metrics using CloudWatch Metric Insights
Hands-on experience querying logs using CloudWatch Log Insights
Working knowledge of building and managing custom CloudWatch dashboards for real-time application visibility

Technologies
CloudWatch logoCloudWatch
EC2 logoEC2
Cloud Lab Overview

Amazon CloudWatch custom metrics allow you to publish your application-specific data points to CloudWatch. Similarly, CloudWatch Logs enable you to collect, monitor, and analyze log data from your applications and services. Together, they provide more granular monitoring beyond the default AWS metrics, allowing you to track key performance indicators, troubleshoot issues, and gain deeper visibility into your environment.

In this Cloud Lab, you’ll use AWS custom metrics to publish logs and metrics for a simple API. You’ll start by launching an EC2 instance and configuring it to publish custom metrics to CloudWatch. Then you’ll set up a simple Flask API and send requests. Moving on, you’ll query your logs and metrics using CloudWatch Log Insights and CloudWatch Metrics Insights to gain insights about the data. Finally, you’ll visualize the status of the application by designing a CloudWatch dashboard.

By the end of this Cloud Lab, you’ll be well-equipped to instrument your application to generate custom CloudWatch metrics and logs and query them. The provisioned infrastructure you’ll build in this Cloud Lab is shown below:

Publish and query custom metrics and logs using CloudWatch
Publish and query custom metrics and logs using CloudWatch
Cloud Lab Tasks
1.Introduction
Getting Started
2.Setting Up the Application
Launch an EC2 Instance
Set Up the Application
3.Exploring CloudWatch
CloudWatch Metrics Insights
CloudWatch Logs Insights
Build a Dashboard
4.Conclusion
Clean Up
Wrap Up
Labs Rules Apply
Stay within resource usage requirements.
Do not engage in cryptocurrency mining.
Do not engage in or encourage activity that is illegal.

Before you start...

Try these optional labs before starting this lab.

Relevant Courses

Use the following content to review prerequisites or explore specific concepts in detail.

Hear what others have to say
Join 1.4 million developers working at companies like