Back to Blog
Lesson 28 of the AWS: AWS Core Services for Developers course
Cloud NativeAugust 4, 20264 min read

Creating CloudWatch Dashboards: A Beginner’s Monitoring Guide

Learn how to create CloudWatch Dashboards to monitor your AWS application. Master adding widgets for Lambda invocations and API latency for better visibility.

AWSCloudWatchMonitoringDashboardsServerlessDevOps
Close-up view of a computer displaying cybersecurity and data protection interfaces in green tones.

Previously in this course, we finished full-stack-api-integration-connecting-frontend-to-backend, which connected your frontend to your serverless backend. Now that your application is live, you need a "single pane of glass" to understand if it's actually working. In this lesson, we are building a CloudWatch Dashboard to visualize the health and performance of your infrastructure.

The Importance of Monitoring with Dashboards

In a distributed, serverless environment, you can't "log into the server" to see what's happening. Your application is a collection of fragmented services—API Gateway, Lambda, and DynamoDB.

Monitoring via Dashboards allows you to see the "heartbeat" of your system. Instead of checking logs for every individual component, a well-structured dashboard aggregates these metrics, allowing you to identify spikes in errors or latency before your users notice them.

Creating Your First CloudWatch Dashboard

A dashboard is simply a customizable collection of widgets that display CloudWatch metrics. To get started:

  1. Log into the AWS Management Console and navigate to CloudWatch.
  2. In the left-hand navigation pane, select Dashboards.
  3. Click Create dashboard and give it a descriptive name, like my-web-app-production.
  4. Once created, you will be prompted to add your first widget.

Adding Widgets for Lambda Invocations

The most basic health indicator for your serverless function is its invocation count. If this number drops to zero, your users likely can't access your service.

  1. In the Add to dashboard wizard, select the Line widget type.
  2. Click Configure.
  3. Select Metrics > Lambda > By Function Name.
  4. Locate your primary Lambda function (e.g., BackendFunction) and check the Invocations metric.
  5. Set the Statistic to Sum and the Period to 1 minute.
  6. Click Create widget.

You now have a real-time view of your function's activity. If you trigger your web app, you should see the graph update within a few minutes.

Visualizing API Latency

Latency is often the primary source of user frustration. To monitor how fast your API Gateway is responding, we need to track the Latency metric.

  1. On your dashboard, click Add widget (the plus icon).
  2. Select Line and click Configure.
  3. Select Metrics > ApiGateway.
  4. Drill down into By API, find your specific API ID, and select the Latency metric.
  5. Crucial Step: Instead of Sum, change the Statistic to Average or p99.
    • Note: Average gives you the mean, but p99 (the 99th percentile) is more useful; it shows you the latency experienced by the slowest 1% of your requests.
  6. Click Create widget.

Practice Exercise

  1. Dashboard Cleanup: Add a third widget to your dashboard that tracks 4XXError and 5XXError counts from your API Gateway.
  2. Refinement: Adjust the time range of your dashboard (top right corner) to view the "Last 3 hours" to see if there are any patterns in your traffic.
  3. Observation: Trigger your application five times in rapid succession and observe how the Invocations and Latency widgets reflect the increased load.

Common Pitfalls

  • Wrong Namespace/Region: Metrics are region-specific. If you don't see your resources, ensure you are looking at the same AWS region where you deployed your stack.
  • Statistic Confusion: As noted in measuring-system-latency-a-guide-to-profiling-and-performance, using the Sum statistic for latency is incorrect. Always use Average, Max, or Percentiles (p95, p99) for time-based metrics.
  • Missing Metrics: If you just created a resource, it might take 1–3 minutes for the first data points to appear in CloudWatch. Don't panic if the graph is empty immediately.

FAQ

Q: Do these dashboards cost money? A: You pay a small monthly fee for each custom dashboard you create. It is very affordable for small projects, but keep an eye on your usage as you scale.

Q: Can I share this dashboard? A: Yes, you can use the "Actions" menu to share your dashboard with other IAM users in your account.

Q: What is the difference between a metric and a log? A: Metrics are numerical data points (like counts or durations) that are easy to graph. Logs are text-based records that provide detailed context for specific events.

Recap

We’ve successfully transformed our raw infrastructure into a visual dashboard. You now have visibility into your Lambda invocation counts and API performance, which are the cornerstones of monitoring a production application.

Up next: We will go from simply watching our metrics to acting on them by Setting Up CloudWatch Alarms to notify us when things go wrong.

Similar Posts