Introduction

In this workshop, you will explore two main tools: X-Ray and Custom Metrics. The steps include monitoring, optimization, automation, and alerting systems.

Advantages of using AWS X-Ray & Custom Metrics:

  • 🎯 Monitor the entire end-to-end request flow across services
  • πŸ” Quickly detect bottlenecks and abnormal latencies
  • πŸ“Š Record custom metrics such as ProcessingTime, ErrorType, UserAction
  • πŸ“ˆ Easily create real-time monitoring dashboards using CloudWatch
  • 🚨 Integrate alerts (alarms) when performance thresholds are breached
  • πŸ€– Support automatic optimization: increase memory, enable caching, send alerts
  • πŸ’‘ Minimal source code changes needed β€” tracing can be enabled quickly
  • πŸ’° Optimize operational costs through resource usage analysis

Operation Workflow:

🧭 Scenarioβš™οΈ Main Action
πŸ”” Receive CloudWatch AlarmCheck the Alarm β†’ Review unusual Logs β†’ Use X-Ray to trace slow requests
πŸ” Perform routine performance checkGo to Dashboard β†’ Compare request processing time charts
πŸ› οΈ Sudden latency spikeRedeploy Lambda β†’ Check memory/timeout β†’ Apply load reduction if needed
πŸ§ͺ Debug specific errorUse X-Ray β†’ Find trace by ID/time β†’ Analyze breakdown
πŸ“ˆ Long-term optimizationAdd more metrics to EMF β†’ Set up advanced alarms
🧹 Periodic cleanupRemove old alarms/topics β†’ Review Logs/X-Ray cost for optimization