Topic lessonTopic: CloudWatch, CloudTrail, Config and incident investigation
Amazon CloudWatch explained: metrics, logs and alarms
CloudWatch helps examine AWS resources and applications through metrics, logs, alarms and related tools. A measurement, an alarm condition and a delivered notification are different observations. Practice aligning the subject, time interval and aggregation using fictional report-API latency data.
Select a metric for the intended subject, interpret periods, statistics, missing data and alarm states, and choose the next evidence to inspect.
A metric is a measurement; a log records events. An alarm evaluates configured conditions. The numbers below are fixed teaching data, not live AWS measurements or monitoring of this website.
Separate measurements, events and condition evaluation
| Evidence | Example question | What else is needed |
|---|---|---|
| Metric | What latency or utilization was measured over an interval? | Subject, unit, period and statistic |
| Log | What was recorded for a request or operation? | Collection, identity, retention and clocks |
| Alarm | Was the configured condition met? | Evaluation settings, missing-data policy and state |
| Notification/action | Did the configured destination receive it? | Action configuration, permissions and delivery evidence |
- Metric → Alarm evaluationEvaluate the specified measurements
- Alarm evaluation → Notification actionRequest an action according to its configuration
- Metric
- Defined subject and period
- Alarm evaluation
- Threshold and evaluation periods
- Notification action
- Configured action and delivery checks
Standard service metrics differ from in-guest or application-specific telemetry. Additional collection through the CloudWatch agent or another mechanism requires appropriate scope, configuration and permissions. Seeing an EC2 instance does not establish that every memory metric or application log is available.
Match the subject and aggregation, not just the name
Check the metric’s namespace, name and dimensions. Dimensions are name/value pairs that distinguish a series. The same metric name in another environment or for another subject can refer to a different series. Also align period, statistic and unit before comparing graphs.
| Setting | Definition in this example |
|---|---|
| Namespace / name | Example/Reports / Latency |
| Dimensions | Environment=training, Route=/reports |
| Unit | Milliseconds |
| Period / statistic | 60 seconds / Average |
For three requests taking 20, 20 and 260 ms, the average is 100 ms and the maximum is 260 ms. An average of 100 does not mean every request was at most 100. Comparing one-minute and five-minute averages also requires attention to sample counts and aggregation.
A1: two of three periods above 100 milliseconds
| Period | Average | Greater than 100? |
|---|---|---|
| 1 | 120 ms | Yes |
| 2 | 70 ms | No |
| 3 | 140 ms | Yes |
Two of A1’s three periods breach the threshold, so it meets the ALARM condition. A 2-of-3 setting does not require two consecutive breaches. Because this comparison is strictly greater than 100, exactly 100 does not breach. This verifies the stipulated example, not a live alarm or delivered notification.
| State | Interpretation |
|---|---|
| OK | Evaluated values are within the configured condition; not a guarantee that every service is healthy. |
| ALARM | The configured threshold/expression is breached; notification receipt is separate. |
| INSUFFICIENT_DATA | Initialization or unavailable/insufficient data prevents sufficient evaluation. |
Do not silently turn missing data into zero or health
Missing data means an expected measurement is unavailable; it is not a measured zero. CloudWatch offers missing, ignore, breaching and notBreaching policies, while actual evaluation also depends on retrieved data, window mode and service-specific behavior. Replacing an A1 point with a blank does not create a universal live-alarm simulator.
| Symptom | Check first |
|---|---|
| Series not found | Account, Region, namespace, dimensions and time range |
| Gaps in values | Publishing/collection, period, clocks, permissions and missing-data policy |
| ALARM without a received notification | Action settings/enabled state, destination/permissions and delivery evidence |
| Values do not identify the cause | Correlated request/operation logs; averages alone do not establish a cause |
Choose log collection, retention and query scope deliberately. CloudWatch Logs defaults to indefinite retention and supports a selected retention period. Review collection, storage and query costs, and narrow by symptom and time before searching every subject over all history. This lesson queries and deletes no real data.
- Define the question and subject.
- Align metric identity, unit, period and statistic.
- Review threshold, M/N, missing data and actions separately.
- Correlate request logs and separate observations from hypotheses.
- Review collection, retention, query scope and cost.
Practice interpreting settings and measurements
Choose an option to see the result and explanation.
Check, then explain in your own words
- Explain C1’s subject, unit, period and statistic.
- Distinguish A1’s two-of-three condition from consecutive breaches.
- Separate missing data, ALARM state and notification receipt.
Check your understanding: Does a healthy-looking graph prove the entire service is healthy?
No. Check scope, aggregation, missing data and other observation points.
An average or one series does not describe every request or failure. Alarm state and notification receipt are also separate facts.
Sources and conditions checked
The official references used in this lesson are collected here with their scope, conditions and corresponding sections. Independent expert review and live AWS comparison have not been performed.
- Amazon CloudWatch overviewChecked:
Scope and conditionsOperational visibility through metrics, logs and related features. Documentation review, not live AWS verification.
Used in this lessonSeparate measurements, events and condition evaluation
- CloudWatch alarm evaluationChecked:
Scope and conditionsThree alarm states and M-of-N evaluation; state versus action. Documentation review, not live AWS verification.
Used in this lessonSeparate measurements, events and condition evaluation A1: two of three periods above 100 milliseconds Do not silently turn missing data into zero or health Practice interpreting settings and measurements
- CloudWatch agentChecked:
Scope and conditionsAdditional collection of in-guest metrics and logs requires configuration. Documentation review, not live AWS verification.
Used in this lessonSeparate measurements, events and condition evaluation Do not silently turn missing data into zero or health
- CloudWatch metrics conceptsChecked:
Scope and conditionsNamespace, metric name and dimensions; period and statistic selection. Documentation review, not live AWS verification.
Used in this lessonMatch the subject and aggregation, not just the name Do not silently turn missing data into zero or health Practice interpreting settings and measurements
Scope and conditionsMissing-data policies, evaluation range and window differences. Documentation review, not live AWS verification.
Used in this lessonDo not silently turn missing data into zero or health Practice interpreting settings and measurements
- CloudWatch Logs overviewChecked:
Scope and conditionsLog collection, search and retention; distinct from metrics or causal proof. Documentation review, not live AWS verification.
Used in this lessonDo not silently turn missing data into zero or health