amazon-api-gateway-developer-guide
amazon-api-gateway-developer-guide copied to clipboard
Correct descriptions of WebSocket API CloudWatch metrics
Hi, thanks for the developer guide, it's helped me out a lot! 😄
The metric descriptions on the Monitoring WebSocket API execution with CloudWatch metrics page seem a bit inaccurate or insufficient. It'd be great to clarify the ClientError, IntegrationError and ExecutionError metric descriptions.
ClientError is supposedly triggered before the integration is invoked:

But I can trigger it after the integration is invoked. For example, if I connect my WebSocket API to a lambda proxy integration, and make that handler return { statusCode: 400 }, then the ClientError metric increases:

The current description seems misleading, suggesting that ClientError only happens before the integration is invoked - i.e. due to authoriser errors or request validation.
Also, it'd be great if a doc explained how the WebSocket API, API Gateway service, stage, integration, and lambda actually interact. For example, it's not clear why:
- the lambda integration always return 200, even if my lambda handler returns other
statusCode - if I misconfigure the integration's permissions, the integration request fails, and
ExecutionErrormetric increases but notIntegrationError:
In summary, I'd really appreciate your clarification on what the ClientError, IntegrationError and ExecutionError metrics really represent for WebSocket and REST APIs. Thanks 🙂