Application Insights
Amazon CloudWatch Application Insights β a powerful service that helps you monitor and troubleshoot applications running on AWS services like EC2, ECS, Lambda, RDS, and more with minimal manual setup.
π What is CloudWatch Application Insights?¶
CloudWatch Application Insights automatically sets up intelligent monitoring for your applications by:
-
Detecting common performance and availability problems
-
Creating relevant CloudWatch Alarms
-
Enabling detailed Log Insights queries
-
Providing automated dashboards for root cause analysis
Itβs designed to reduce the effort of setting up monitoring for applications across EC2, Lambda, containers, etc.
β Supported Environments¶
-
EC2 Instances
-
Lambda functions
-
Amazon RDS / SQL Server
-
Containerized apps (ECS, EKS)
-
.NET, SQL Server, IIS, Java, etc.
π Key Features¶
| Feature | Description |
|---|---|
| Automatic anomaly detection | Detects common issues like high CPU, memory leaks, failed deployments |
| Log pattern analysis | Identifies unusual log messages and errors |
| Pre-built dashboards | Auto-generates dashboards with metrics, logs, alarms |
| Integrated with CloudWatch | Uses CW Logs, Metrics, Alarms, Contributor Insights, etc. |
π§ͺ Demo Example β Monitor a Lambda Application¶
π― Goal:¶
Automatically monitor a Lambda app for errors, latency, and throttles.
π§ Step-by-step Setup (via Console)¶
-
Go to CloudWatch β Application Insights
-
Click "Add application"
-
Select Lambda application
-
Choose your Lambda function(s)
-
Click "Create"
CloudWatch will:
-
Detect logs and metrics
-
Create Alarms (e.g., high error rate, timeout rate)
-
Enable Log Insights queries
-
Build a dashboard for your Lambda
π What You Get¶
-
Dashboards like:
-
Errors over time
-
Duration vs. timeout threshold
-
Cold starts
-
-
Logs linked to specific issues
-
Alarms auto-created for common issues
-
Log patterns identified (e.g., stack traces, exceptions)
π₯ Example Problem Detected¶
CloudWatch App Insights might detect:
βHigh Lambda Timeout Rate Detected
Function:my-payment-processor
Suggested Action: Check for long-running processes or increase timeout limit.
It'll link you directly to:
-
Related CloudWatch metrics
-
Related Log Insights queries
π Other Use Case Examples¶
1. Monitoring EC2-based .NET app¶
CloudWatch App Insights can detect:
-
Memory leaks
-
Slow HTTP responses
-
SQL query failures
-
IIS restarts
2. Java App on ECS¶
Itβll detect:
-
High GC pauses
-
Thread deadlocks
-
Memory utilization spikes
-
Container restarts
π Summary¶
| Benefit | Details |
|---|---|
| π Automates monitoring setup | No need to manually configure CloudWatch alarms |
| π¨ Early problem detection | Built-in anomaly detection for logs and metrics |
| π Auto dashboards | Detailed visualizations with drill-down options |
| π Root cause analysis | One-click access to logs and metrics for issues |
βοΈ Optional: IaC via CloudFormation¶
You can also create monitored applications via IaC:
Resources:
MyAppInsights:
Type: AWS::ApplicationInsights::Application
Properties:
ResourceGroupName: MyAppGroup
AutoConfigurationEnabled: true