๐ฉบ
CloudWatch & X-Ray
Troubleshooting and OptimizationObservability: 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.