Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS API Gateway - Monitor specific endpoints

I have created an API Gateway in AWS with two resources (endpoints). Let's say /foo and /bar. Each endpoint has a POST method.

enter image description here

I want to monitor how many times each endpoint got invoked - /foo and /bar in our example. And the metrics to show the 2xx, 4xx, and 5xx responses. I know API Gateway got a generic "API Calls" metric that shows the total invocations of the API. But how do I monitor how many times each endpoint got called?

like image 524
Nadar Avatar asked Oct 27 '25 01:10

Nadar


1 Answers

You can filter API Gateway metrics for the API method with the specified API name, stage, resource, and method.

API Gateway will not send these metrics unless you have explicitly enabled detailed CloudWatch metrics. You can do this in the console by selecting Enable Detailed CloudWatch Metrics under a stage Logs/Tracing tab. Alternatively, you can call the update-stage AWS CLI command to update the metricsEnabled property to true.

Enable Detailed CloudWatch Metrics on AWS Console: enter image description here

Documentation: https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-metrics-and-dimensions.html#api-gateway-metricdimensions

like image 64
OARP Avatar answered Oct 29 '25 22:10

OARP



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!