API Gateway Monitoring, Logging And Tracing

  • CloudWatch Logs
    • Can enable CloudWatch Logs at the Stage level
    • Can override settings per API methods, level
      • ERROR, DEBUG, INFO
    • Has information about request/response body
  • X-Ray:
    • Enable tracing to get extra information about API Gateway
    • X-Ray both API Gateway + AWS Lambda gives you the full picture
  • CloudWatch Metrics
    • Metrics are by stage, can enable detailed metrics
    • CacheHitCount & CacheMissCount: efficiency of the cache
    • Count: total number api requests in a given period
    • IntegrationLatency : how long the backend is taking to reply to API Gateway
    • Latency: how long the client receive the message in total (including IntegrationLatency)
      • Maximum amount of time API Gateway is 29 seconds. If your latency is above this, you will receive a Timeout error