AWS Monitoring & Observability: Reviewing Application Health
Review application health by using dashboards and insights
Reviewing Application Health using Dashboards and Insights
This guide focuses on Skill 4.1.5 of the AWS Certified Developer - Associate (DVA-C02) exam. It covers how to aggregate operational data into visual dashboards and use automated "Insights" services to perform root cause analysis and health monitoring.
Learning Objectives
By the end of this guide, you should be able to:
- Differentiate between CloudWatch Dashboards, Logs Insights, Container Insights, and Lambda Insights.
- Construct a basic CloudWatch Logs Insights query to filter application errors.
- Identify which AWS service to use for monitoring high-level service availability versus granular resource performance.
- Understand the role of Embedded Metric Format (EMF) in creating real-time health visuals.
Key Terms & Glossary
- Namespace: A container for CloudWatch metrics (e.g.,
AWS/EC2or a custom string likeMyCompany/App). - Dimension: A name/value pair that is part of a metric's identity (e.g.,
InstanceId). - Resolution: The granularity of data. Standard resolution is 1 minute; High resolution can be up to 1 second.
- Log Group: A group of log streams that share the same retention, monitoring, and access control settings.
- CloudWatch Insights: A suite of specialized monitoring tools (Logs, Container, Lambda, Application) that provide deeper analysis than standard metrics.
The "Big Idea"
In a distributed system, individual resource health (CPU/RAM) is only half the story. To truly understand Application Health, you must correlate logs, metrics, and traces across multiple services. Dashboards provide the "Single Pane of Glass" for visual confirmation, while Insights services automate the heavy lifting of querying massive datasets to find patterns or anomalies that indicate a pending failure.
Formula / Concept Box
| Feature | Primary Purpose | Key Capability |
|---|---|---|
| CloudWatch Dashboards | Visualization | Single view of metrics/alarms from different regions/accounts. |
| Logs Insights | Ad-hoc Querying | Fast, interactive log searching using a SQL-like syntax. |
| Lambda Insights | Function Performance | Tracks memory usage, CPU, and cold starts at the function level. |
| Container Insights | Microservice Health | Aggregates performance data for ECS, EKS, and Fargate. |
| Application Insights | Problem Detection | Automatically sets up dashboards and monitors for .NET/Java apps. |
Hierarchical Outline
- I. Amazon CloudWatch Dashboards
- Customization: Adding widgets (line charts, stacked area, numbers).
- Cross-Account/Cross-Region: Aggregating health status globally.
- Automatic Dashboards: Built-in dashboards for AWS services (e.g., Lambda, DynamoDB).
- II. CloudWatch Logs Insights
- Query Syntax: Using
filter,stats,sort, andlimitcommands. - Visualization: Converting query results into bar, line, or pie charts for dashboards.
- Query Syntax: Using
- III. Specialized Insights Services
- Lambda Insights: Using the CloudWatch Lambda Extension to gather high-res metrics.
- Container Insights: Deep-dive into pod/node performance.
- Contributor Insights: Identifying the "Top-N" contributors (e.g., which IP is making the most requests).
Visual Anchors
Monitoring Data Flow
Dashboard Layout Logic
\begin{tikzpicture}[scale=0.8] \draw[thick] (0,0) rectangle (10,6); \node at (5,5.5) {\textbf{Application Health Dashboard}}; \draw[fill=gray!10] (0.5,3.5) rectangle (4.5,5) node[midway] {\small Error Rate (Line Graph)}; \draw[fill=gray!10] (5.5,3.5) rectangle (9.5,5) node[midway] {\small Latency (P99)}; \draw[fill=green!20] (0.5,1) rectangle (3,3) node[midway, align=center] {\small Status\OK}; \draw[fill=gray!10] (4,1) rectangle (9.5,3) node[midway] {\small Logs Insight: 5xx Errors Table}; \end{tikzpicture}
Definition-Example Pairs
- Embedded Metric Format (EMF): A JSON specification used to instruct CloudWatch Logs to automatically extract metrics from log data.
- Example: A Lambda function logs a JSON object containing
"ProcessingTime": 500. CloudWatch automatically creates a custom metric forProcessingTimewithout extra API calls.
- Example: A Lambda function logs a JSON object containing
- CloudWatch Contributor Insights: A tool to analyze log data to create time series that display contributor data.
- Example: Identifying which specific user ID is causing the highest number of
403 Access Deniederrors in an API Gateway log.
- Example: Identifying which specific user ID is causing the highest number of
Worked Examples
Task: Querying Slowest Lambda Executions
You need to find the 10 slowest executions for a specific Lambda function in the last hour to investigate a performance degradation.
Solution using Logs Insights:
- Select the Log Group:
/aws/lambda/MyFunctionName. - Enter the following query:
filter @type = "REPORT"
| stats max(@duration) as max_duration by @requestId
| sort max_duration desc
| limit 10- Explanation: This filters for
REPORTlines (generated at the end of every Lambda execution), calculates the maximum duration per request ID, sorts by the longest time, and limits the output to the top 10 results.
Checkpoint Questions
- Which tool would you use to find the top 5 IP addresses hitting your web server with the most requests?
- Answer: CloudWatch Contributor Insights.
- True or False: CloudWatch Dashboards are region-specific and cannot show metrics from multiple regions in one view.
- Answer: False. Dashboards can include widgets from different regions and accounts if cross-account/cross-region functionality is enabled.
- A developer wants to monitor memory usage of a Lambda function more granularly than the standard metrics allow. Which Insight service should they enable?
- Answer: CloudWatch Lambda Insights.
- What is the advantage of using Logs Insights over standard CloudWatch Logs searching?
- Answer: Logs Insights allows for complex filtering, mathematical aggregation (stats), and visualization of results, which is much faster than manual keyword searching.", "word_count": 850, "suggested_title": "DVA-C02: Application Health & Dashboards" }