โ˜๏ธAWSDVA Prep
← All cheat sheets
๐Ÿฉบ

CloudWatch & X-Ray

Troubleshooting and Optimization

Observability: metrics, logs, alarms, and distributed tracing.

CloudWatch Metrics & Alarms

  • โ–ธPutMetricData publishes custom application/business metrics.
  • โ–ธAlarms watch a metric/expression and change state on threshold breach, triggering SNS/Auto Scaling actions.
  • โ–ธStandard resolution: 1 minute; high resolution: down to 1 second.

CloudWatch Logs

  • โ–ธLog groups/streams collect application and Lambda logs automatically.
  • โ–ธLogs Insights: interactive query language to search/filter/aggregate logs directly.
  • โ–ธSubscription filters can stream logs in real time to Lambda, Kinesis, or OpenSearch.

X-Ray

  • โ–ธTraces requests across service boundaries; builds a visual service map.
  • โ–ธSegments (per service) and subsegments (per call/operation) capture timing and errors.
  • โ–ธSampling rules control what percentage of requests are traced, to control cost/volume.

Common failure signatures

  • โ–ธLambda "Task timed out": raise the timeout and/or optimize slow downstream calls.
  • โ–ธDynamoDB throttling with skewed partition metrics: hot partition โ€” fix key design or use on-demand.
  • โ–ธAPI Gateway 502: malformed Lambda proxy response. 504: backend took too long.
  • โ–ธSQS poison-pill messages: configure a DLQ with maxReceiveCount to isolate them.
Test yourself on this โ†’