Ref: https://learn.cantrill.io/courses/1820301/lectures/41301628 [ASSOCIATESHARED]
DEMO: https://learn.cantrill.io/courses/1820301/lectures/41301629 [ASSOCIATESHARED]
CloudWatch Service and Architecture
- š§Ā Collects & manages operational data ā provides operational management & monitoring
- Operation data includes service performance, run metrics, logsā¦
- Core support service used by almost all other AWS services
- Public service
- Three main components:
- CW Metrics = "CW itselfā (āVanillaā CW)
- e.g. CPU utilization of EC2 instance, disk usage on an on-premise serverā¦
- Can ingest metrics from AWS products, apps, or on-premises infrastructure
- Some metrics are gathered natively by AWS products
- Configuration of a CW Agent is needed for:
- Collecting metrics inside AWS that are not gathered natively
- e.g. internal processes in an EC2 instance
- Collecting metrics outside of AWS
- CW Logs
- Can ingest logs from AWS products, apps, or on-premises infrastructure
- Some logs generated natively by AWS products, other products need CW Agent
- CW Events
- Works with AWS services and schedules
- Generates events which can trigger actions (e.g. send a notification email)
- Events can be generated based on:
- condition (e.g. an EC2 instance is created or terminated)
- schedule (e.g. tomorrow at 13:45, or every Friday at 18:00)
- š”Ā The Billing Alarm was set with CW Events ā send a notification when billing surpasses a budget
- Architecture Diagram
CW Concepts
- Datapoint = Timestamp + Value (Pair)
- e.g. CPU usage is 98.3% at 08:45:45 on 2019-12-03
- Metric = Sequence of datapoints ordered in time = Time-ordered set of datapoints
- e.g. CPU usage, NW I/O, Disk I/Oā¦ (in a given time frame)
- ā¼ļøĀ NOT necessarily related to a single server!
- e.g. CPU usage will be displaying by default the usage across all EC2 instances! Must specify otherwise if you want to limit to one instance!
- Metric and Datapoints Diagram
- Namespace = Name container for monitoring data, contains name-related metrics
- š”Ā Keeps things from becoming messy
- Can have any rule-complying name
- e.g.
AWS/
ā namespace where all AWS data goes to
- e.g.
AWS/EC2
ā namespace for all EC2 data
- Dimensions = Criteria that separate datapoints of same metric into different perspectives
- e.g. Inside
AWS/EC2
namespace, separate into dimensions: Instance A, Instance Bā¦
- Powerful & Flexible
- Dimensions and Namespace Diagram
- Alarms take actions based on a specific metric reaching specified values/thresholds
- e.g. Send a notification when budget has been exceeded (billing alarm)
- States:
INSUFFICIENT DATA
(initial state), OK
or ALARM
- alarm uses SNS (Simple Notification System) when the state is
ALARM
- Alarm Diagram