Monitoring AWS resources and costs is crucial for maintaining efficient cloud operations. In this guide, I'll walk you through setting up alerts for both EC2 instances and AWS billing in Grafana Cloud.
Prerequisites
Access to Grafana Cloud account
AWS account with appropriate IAM permissions
Configured CloudWatch data source in Grafana
Part 1: Setting Up EC2 Instance Alerts
1. Adding CloudWatch Data Source
Navigate to Connections → Data Sources
Search for "CloudWatch" in the search bar
Select CloudWatch from the available options
2. Configuring CloudWatch Connection
Configure AWS authentication details
Set up Access Key and Secret Key
Configure default region
-
Navigate to Alert Rules → New Alert Rule
3. Creating EC2 CPU Alert
Configure Query with:
Alert rule Name : CPU Usage
Namespace: AWS/EC2
Metric Name: CPUUtilization
Statistic: Average
4. Setting Alert Conditions
Set threshold conditions:
IS ABOVE 80%
Evaluation period: Every 1m
Pending Period: 1m
5. Configure Notifications
Set up email notifications
Add alert summary
Configure message details
Part 2: Setting Up AWS Billing Alerts
1. Creating Billing Alert
Start new alert rule creation
Select AWS/Billing namespace
Choose EstimatedCharges metric
2. Setting Cost Threshold
Configure alert conditions:
Set threshold to $1.25
Set evaluation period
Configure dimensions
3. Alert Organization
Add to AWS folder
Set evaluation group
Configure notifications
4. Notification Setup
Configure email notifications
Set alert summary
Add description
Verification and Monitoring
1. Alert Rules Overview
You can view all configured alerts in the Alert Rules dashboard
2. Alert Details
Monitor specific alert details and status
3. Alert Status
Check alert status and history
Best Practices Implemented
Organized alerts in proper folders (AWS)
Used consistent evaluation intervals (1m)
Added clear descriptions and summaries
Implemented email notifications
Used appropriate metrics and statistics
Monitoring and Maintenance
Regular review of alert thresholds
Monitor alert history
Adjust thresholds based on patterns
Keep contact information updated
This setup provides a foundation for AWS resource monitoring in Grafana Cloud, helping maintain both performance and cost efficiency.