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: