INFRASTRUCTURE LEARNINGINFRASTRUCTURE LEARNING
インフラ大全インフラ大全IT INFRASTRUCTURE / LEARNING
Infrastructure learning guide
Find a lesson or lab/

Esc to close · Search terms stay on your device

LEARNING日本語

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.

What you will learn

Select a metric for the intended subject, interpret periods, statistics, missing data and alarm states, and choose the next evidence to inspect.

Prerequisite

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

Choose evidence from the question
EvidenceExample questionWhat else is needed
MetricWhat latency or utilization was measured over an interval?Subject, unit, period and statistic
LogWhat was recorded for a request or operation?Collection, identity, retention and clocks
AlarmWas the configured condition met?Evaluation settings, missing-data policy and state
Notification/actionDid the configured destination receive it?Action configuration, permissions and delivery evidence
From a metric to an alarm and a configured action
From a metric to an alarm and a configured action1: Metric — Evaluate the specified measurements — Alarm evaluation. 2: Alarm evaluation — Request an action according to its configuration — Notification action12MetricAlarm evaluationNotification actionFrom a metric to an alarm and a configured action1: Metric — Evaluate the specified measurements — Alarm evaluation. 2: Alarm evaluation — Request an action according to its configuration — Notification action12MetricAlarmevaluationNotificationaction
  1. Metric → Alarm evaluationEvaluate the specified measurements
  2. 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.

Fixed case C1: a teaching custom metric for a report API
SettingDefinition in this example
Namespace / nameExample/Reports / Latency
DimensionsEnvironment=training, Route=/reports
UnitMilliseconds
Period / statistic60 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

Evaluate all three stipulated A1 points
PeriodAverageGreater than 100?
1120 msYes
270 msNo
3140 msYes

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.

States describe evaluation of the configured observations
StateInterpretation
OKEvaluated values are within the configured condition; not a guarantee that every service is healthy.
ALARMThe configured threshold/expression is breached; notification receipt is separate.
INSUFFICIENT_DATAInitialization 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.

Checks for an empty graph or an absent notification
SymptomCheck first
Series not foundAccount, Region, namespace, dimensions and time range
Gaps in valuesPublishing/collection, period, clocks, permissions and missing-data policy
ALARM without a received notificationAction settings/enabled state, destination/permissions and delivery evidence
Values do not identify the causeCorrelated 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.

  1. Define the question and subject.
  2. Align metric identity, unit, period and statistic.
  3. Review threshold, M/N, missing data and actions separately.
  4. Correlate request logs and separate observations from hypotheses.
  5. Review collection, retention, query scope and cost.

Practice interpreting settings and measurements

Choose an option to see the result and explanation.

How should you treat a series whose Route differs from C1?
Read the answer and reason

Answer: Check the definitions because the subject differs · Align environment and Route before treating values as answers to the same question.

What does A1 show for 120, 70 and 140 ms with two of three above 100?
Read the answer and reason

Answer: It meets the condition: 120 and 140 breach · Two available points breach in this fixed example; this setting does not require two consecutive points.

Is an unavailable measurement the same as a measured zero milliseconds?
Read the answer and reason

Answer: No; inspect collection and missing-data handling · Verify whether the required data is available and read the configured evaluation and state.

An alarm is ALARM, but no notification was received. What comes next?
Read the answer and reason

Answer: Action configuration, destination and delivery evidence · Inspect condition evaluation and the notification path separately.

Check, then explain in your own words

  1. Explain C1’s subject, unit, period and statistic.
  2. Distinguish A1’s two-of-three condition from consecutive breaches.
  3. 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.