Study DVA-C02 Logs, Metrics, Alerts, and Health Checks: key concepts, common traps, and exam decision cues.
This lesson is about building observability into the application instead of hoping infrastructure will explain everything later. DVA-C02 wants developers to understand logging strategy, custom metrics, alerts, tracing annotations, and the difference between liveness and readiness signals.
Structured logging: Logging approach where fields such as user ID, request ID, action, and status are emitted in a machine-readable format.
Health check: Probe or endpoint used to determine whether an application instance is alive, ready, or safe to receive traffic.
AWS wants you to know:
| Need | Strongest first control | Why |
|---|---|---|
| search and correlate failures quickly | structured logging | Queryable fields outperform free-form text under pressure. |
| measure business or app-specific behavior | custom metrics | Infra defaults do not capture app semantics. |
| alert only when action is required | thresholds tied to meaningful symptoms | Actionable alerts reduce noise fatigue. |
| know whether the process is alive | liveness health check | This is not the same as traffic readiness. |
| know whether the instance can safely receive requests | readiness health check | Prevents sending traffic to a warming or broken dependency path. |
| connect application logs to metrics | EMF or deliberate structured emission | Bridges application events into CloudWatch metric workflows. |
flowchart LR
A["Application code"] --> B["Structured logs"]
A --> C["Custom metrics / EMF"]
A --> D["Tracing annotations"]
A --> E["Health endpoints"]
C --> F["Dashboards and alerts"]
E --> G["Traffic decisions and deployment safety"]
Strong answers usually prefer:
Developers often log too much text and too little structure. DVA-C02 prefers instrumentation that helps future diagnosis:
Small Python example:
1import json
2import time
3
4def emit_order_metric(order_id: str, started_at: float) -> None:
5 print(json.dumps({
6 "orderId": order_id,
7 "latencyMs": int((time.time() - started_at) * 1000),
8 "status": "success",
9 }))
The point is not a logging framework choice. The point is that application instrumentation should preserve searchable context and measurable signals.
| Pair | How to separate them |
|---|---|
| logging vs monitoring | event detail vs aggregate signal and thresholds |
| custom metrics vs raw log search | measurable trends and alarms vs ad hoc investigation detail |
| liveness vs readiness | process alive vs safe to receive traffic |
| alerting vs dashboarding | proactive notification vs operator inspection surface |