Management Tools > CloudWatch
CloudWatch is available for several different AWS services
- EC2
- ELB
- S3
- DynamoDB
- RDS
- Etc.
- Basic Monitoring every 5 minutes
- Advanced (Detailed) Monitoring every minute – but is not free.
Dashboards
Dashboard widgets, outside of Text, allow you to add as many ‘metrics’ to a graph (Line or Stacked) or Number as you wish.
- Dashboard > [Create Dashboard]
- Widgets (4)
- Text (Markdown text)
- [Add Widget] > Text > [Configure]
- Uses Markdown language
- # Heading 1, ## Heading 2
- [link text](http://url.com)
- *italics*, **bold**, ~~strikethrough~~
- Line (Basic Line)
- [Add Widget] > Line > [Configure] > Select service type (EC2) > ‘Per-Instance Metrics’
- Available metrics listed by Instance Name / ID
- Select Metric *Know these for the exam!
- CPU Related
- Credit Balance
- Credit Useage
- Utilization
- Disk Related
- Read Bytes
- Write Bytes
- Read Ops
- Write Ops
- Network Related
- In
- Out
- Packets In
- Packets Out
- Status Check
- For the Instance
- For the Hypervisor (Host)
- If a Metric is not listed, you will need to create a “Custom Metric” for it.
- RAM Utilization
- Disk Space Available
- CPU Related
- Stacked Area (Same as Line, but lower half colored in)
- Number (actual value of Metric during last poll)
- [Add Widget] > Line > [Configure] > Select service type (EC2) > ‘Per-Instance Metrics’
- Text (Markdown text)
Alarms
Unlike Dashboard widgets, Alarms only allow you to set trigger points on a single specific Metric.
- Select Metric
- Select the metric you wish to set the trigger point for > [Next]
- Create Alarm
- Alarm Threshold
- Name (Must be unique?)
- Description -> This is the alert that will be sent
- Set Trigger value (<, <=, >=, >)
- Set ‘Consecutive Periods’ (A period is the time delays between polls. Standard is 5 minutes.
- Additional Settings
- Treat Missing data as:
- good (not breaching threshold – will clear an active alert)
- bad (breaching threshold – will cause an alert)
- ignore (maintain current alert status)
- missing (default – definition not clear)
- Treat Missing data as:
- Actions
- You can add as many ‘Actions’ as you wish
- Notifications
- Whenever this alarm: (Select Alarm state)
- State is ALARM
- State is OK
- State is INSUFFICIENT
- Send notification to: (Notification List)
- All Recipients must ‘Opt In’
- New List
- Enter Topic Name (seems like a ‘Key’ type value. No spaces!)
- Add Email Recipient(s?)
- separate with semicolon?
- Whenever this alarm: (Select Alarm state)
- AutoScaling Action
- EC2 Action
- Whenever this alarm: (Select Alarm state, see above)
- Take this action
- Recover this instance (Reboot?)
- Stop this instance
- Terminate this instance
- Reboot this instance
- * AWS will automatically create a new IAM Role to allow these actions!
- Alarm Threshold
- Events (Understand at high level)
- Respond to state changes to AWS resources.
- Examples
- Automatically invoke an AWS Lambda function to update DNS entries when an event notifies you that Amazon EC2 instance enters the Running state
- Direct specific API records from CloudTrail to a Kinesis stream for detailed analysis of potential security or availability risks
- Take a snapshot of an Amazon EBS volume on a schedule
- Logs (Understand at high level)
- Examples
- Monitor HTTP response codes in Apache logs
- Receive alarms for errors in kernel logs
- Count exceptions in application logs
- Install the Agent to send your logs to the CloudWatch Logs service.
- Create metric filters to automatically monitor the logs that are sent.
- View the log data you sent and is stored in CloudWatch Logs.
- Examples
- Metrics
- Easy. Use this instead of creating dashboards.
Exam Tips
- Standard Monitoring every 5 minutes
- Detailed Monitoring every 1 minute
- What can you do?
- Create dashboards
- Set Alarms
- Trigger Events based on rules
- Aggregate, monitor and store logs.
- Difference between CloudWatch and CloudTrail
- CloudWatch is for MONITORING
- CloudTrail is for AUDITING (Who did what, when and where)