0
0
AWScloud~5 mins

Why monitoring matters in AWS - Why It Works

Choose your learning style9 modes available
Introduction
Monitoring helps you see how your cloud services and applications are working. It shows if something is wrong so you can fix it quickly before users notice.
When you want to know if your website is slow or down.
When you need to track how much memory or CPU your app is using.
When you want to get alerts if your database stops responding.
When you want to understand how many users are using your app at once.
When you want to improve your app by seeing which parts are slow or fail often.
Commands
This command creates an alarm in AWS CloudWatch that watches the CPU usage of an EC2 instance. It alerts you if CPU usage goes above 80% for two periods of 5 minutes each.
Terminal
aws cloudwatch put-metric-alarm --alarm-name HighCPUUtilization --metric-name CPUUtilization --namespace AWS/EC2 --statistic Average --period 300 --threshold 80 --comparison-operator GreaterThanThreshold --dimensions Name=InstanceId,Value=i-0123456789abcdef0 --evaluation-periods 2 --alarm-actions arn:aws:sns:us-east-1:123456789012:MyTopic --unit Percent
Expected OutputExpected
No output (command runs silently)
--alarm-name - Name of the alarm to identify it easily
--threshold - The CPU usage percentage that triggers the alarm
--alarm-actions - The action to take when alarm triggers, like sending a notification
This command checks the status of the alarm you created to see if it is OK, in alarm, or insufficient data.
Terminal
aws cloudwatch describe-alarms --alarm-names HighCPUUtilization
Expected OutputExpected
{ "MetricAlarms": [ { "AlarmName": "HighCPUUtilization", "AlarmArn": "arn:aws:cloudwatch:us-east-1:123456789012:alarm:HighCPUUtilization", "StateValue": "OK", "StateReason": "Threshold Crossed: 1 datapoint [75.0 (12/06/24 10:00:00)] was not greater than the threshold (80.0).", "MetricName": "CPUUtilization" } ] }
--alarm-names - Specify which alarm to describe
Key Concept

If you remember nothing else, remember: monitoring lets you catch problems early before they affect your users.

Common Mistakes
Setting alarm thresholds too high or too low without understanding normal usage
This causes false alarms or missed real problems, making monitoring useless or annoying
Check normal CPU or memory usage first, then set thresholds just above normal peaks
Not setting up alarm actions like notifications
You won't know when something goes wrong because no alert is sent
Always configure alarm actions to send emails or messages to your team
Summary
Create CloudWatch alarms to watch important metrics like CPU usage.
Check alarm status to know if your resources are healthy or need attention.
Set proper thresholds and notification actions to get useful alerts.