(apigateway): get metrics from a resource
See original GitHub issueWith API GW CDK it is possible today to easily get metrics at the RestAPI level like this:
RestApi restApi = new RestApi(...);
...
restApi.metricLatency();
restApi.metricServerError();
restApi.metricCount();
This is super useful. These metrics are provided by default with API GW. It is possible to get metrics at the resource level if you enable advanced Cloudwatch Metrics on the API. It would be great if we could have similar methods at the Resource level.
Use Case
If an organization uses one API Gateway RestApi with many resources in it each linked to a unique integrations then the API level metrics are not very useful. When the metrics present a problem then it is unclear which specific resource/integration is the cause of it. Being able to easily get these metrics at the resource level would resolve this.
Proposed Solution
IResource resource = new Resource(..);
...
resource.metricLatency();
resource.metricServerError();
resource.metricCount();
Other
- 👋 I may be able to implement this feature request
- ⚠️ This feature might incur a breaking change
This is a 🚀 Feature Request
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Amazon API Gateway dimensions and metrics
API Gateway metrics ; Count. The total number API requests in a given period. The SampleCount statistic represents this metric. Unit: Count ;...
Read more >Top 4 must-monitor API Gateway metrics - Blue Matador
API Gateway counts the number of requests made to your API and displays the metric in CloudWatch. This metric is the count of...
Read more >View API Gateway metrics in the CloudWatch console
In the All metrics tab, choose API Gateway. To view metrics by stage, choose the By Stage panel. And then select desired APIs...
Read more >Amazon API Gateway Monitoring Integration - Site24x7
API Gateway automatically exposes metrics to CloudWatch on the API and stage-level. To monitor API calls, latency, integration latency, 400 and 500 errors...
Read more >Amazon API Gateway monitoring integration
The time in milliseconds between when API Gateway receives a request from a client and when it returns a response to the client....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is something I’ve also been looking for. Just adding to @nija-at’s comment, the dimensions for this sort of metric also include
Method
so in total they are ApiName, Method, Resource, Stage which might mean the method needs to be passed in as well.Ok. I’m adding this to our backlog.
I’m marking this as p2 which means we are unable to get to this right away. Happy to accept pull requests if you would like this feature in earlier.