1 個回答
- 最新
- 最多得票
- 最多評論
1
According to the API Gateway documentation, the HTTP APIs CloudWatch metrics use their ApiId dimension as API ID. This is different from v1 REST API which uses ApiName for ApiName dimension.
A workaround I can think of within CloudWatch is to set a custom name for each graph in the dashboard to specify an API name. Another way would be using a REST API instead of HTTP API.
已回答 2 年前
相關內容
- AWS 官方已更新 1 年前
- AWS 官方已更新 2 年前
- AWS 官方已更新 2 年前
- AWS 官方已更新 2 年前
Thank you for answer. Is there any chance you can provide more info about this part "set a custom name for each graph in the dashboard to specify an API name."? Also, is this doable using CloudFormation? Thank you again
You can name your graph or rename existing ones. Please see this documentation. For CloudFormation, when creating a AWS::CloudWatch::Dashboard resource, you specify the DashboardBody for the dashboard structure. You can leverage the title field for each widget to define the graph name.
Taka_M, the real issue is that I am deploying using serverless and sometimes I have to delete the CloudFormation stack which means the API Gateway gets deployed with a different ID. The real question is how do I keep the dashboard in sync with this Api ID that can change sometimes?