Cannot find HTTP API by name in Cloudwatch metrics

1

I have an HTTP API (API Gateway v2) and I have enabled the metrics.

Now, when I go to Cloudwatch and create a dashboard widget, I can't find this HTTP API in metrics by NAME. I can only find it by ID, but that's not what I want. I would like to find it by name.

Any chance you could point me to what went wrong, please?

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.

AWS
Taka_M
답변함 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?

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인