Lesson 5 of 8 Amazon CloudWatch

Visualising Application Health with Dashboards and CloudWatch Insights

This lesson explains how dashboards and the CloudWatch insight features show an application's health at a glance and help find where a problem started, across services, accounts and Regions.

Learning outcomes

After completing this lesson, you will be able to:

  • Describe the CloudWatch features for seeing an application's state, such as dashboards and Lambda Insights.
  • Explain how a useful operational dashboard is organised.
  • Explain how Contributor Insights ranks the top contributors to errors or throttling.

Dashboards and insights

CloudWatch offers several features for seeing the state of an application at a glance and for drilling into a specific resource.

CloudWatch dashboards are customisable pages of widgets: graphs of metrics, the current state of alarms, results of Logs Insights queries and text. A single dashboard can show resources from several Regions. Cross-account observability links source accounts to a monitoring account, so that dashboards, alarms and queries in the monitoring account can use metrics, logs and traces from every linked account, which suits organisations with one account per team or environment.

Lambda Insights and Container Insights collect detailed resource metrics that the standard metrics omit: CPU time, memory and network use for each Lambda function, and CPU, memory, network and restarts for each ECS or EKS task, service and cluster. Contributor Insights analyses log events or DynamoDB traffic and ranks the top contributors, such as the client IP addresses with the most errors or the partition keys with the most throttled requests. The following table summarises the features.

FeatureWhat it shows
CloudWatch dashboardsMetrics, alarms and Logs Insights queries across services and Regions
Cross-account observabilityMetrics and logs from many accounts in one monitoring account
Lambda Insights, Container InsightsDetailed resource metrics for functions and containers
Contributor InsightsTop contributors to a pattern, such as the most-throttled DynamoDB keys

Example. During an incident, count errors per service in five-minute buckets to see when a problem started:

fields @timestamp, service, message
| filter level = "ERROR"
| stats count(*) as errors by bin(5m), service
| sort errors desc

Find the slowest requests:

fields @timestamp, @requestId, @duration
| filter @type = "REPORT"
| sort @duration desc
| limit 20

Building useful dashboards

CloudWatch dashboards present metrics, alarms and logs in a single view. The following list describes how useful dashboards are built.

  • Automatic dashboards exist for many services, such as Lambda and DynamoDB, with no setup.
  • Custom dashboards can combine metric graphs, alarm status, Logs Insights query results and text, across Regions and, with cross-account observability, across accounts.
  • Dashboards are defined as JSON, so they can be created with PutDashboard or CloudFormation and kept in source control.
  • Dashboards can be shared with people who have no AWS account through a link or SSO.
  • A good service dashboard shows request rate, error rate and latency percentiles first, with resource metrics below for investigation.

Contributor Insights

Contributor Insights analyses log events or DynamoDB traffic and ranks the top contributors, such as the IP addresses with the most errors or the partition keys with the most throttled requests. For DynamoDB it is enabled per table and index with one command:

aws dynamodb update-contributor-insights --table-name Orders --contributor-insights-action ENABLE
Worked example

A dashboard for an order service

An effective operational dashboard is organised so that each row answers a specific question. The following table describes the widgets in each row and the question they answer.

RowWidgetsQuestion answered
1Request count, 5XX error rate and p99 latency from Application SignalsAre users affected?
2Lambda duration, throttles and concurrent executionsIs compute the bottleneck?
3DynamoDB throttled requests and Contributor Insights top keysIs the database the bottleneck?
4Logs Insights query of errors by type in 5-minute binsWhat is failing?
5Alarm status widgetWhat is already alerting?

The dashboard is defined in the same CloudFormation stack as the service, so every environment gets an identical view. During an incident, the rows are read top to bottom: from user impact to the component responsible and then to the specific error.

Check yourself

Which CloudWatch feature shows the clients or keys that contribute most to traffic or errors?

Show answer

Contributor Insights. It analyses log events and shows the top contributors, such as the IP addresses or API keys with the most errors.

Exam Tips

Remember for the exam

  • To find the hottest DynamoDB keys, use Contributor Insights.
  • To view metrics from many accounts on one dashboard, use cross-account observability.
  • For CPU, memory and network metrics of individual functions, enable Lambda Insights.
  • To find when a problem started, query errors in time buckets with Logs Insights stats ... by bin(5m).