Monitor API Gateway APIs based on API key

后端 未结 2 1147
陌清茗
陌清茗 2021-01-24 14:35

How can I monitor my Amazon API Gateway APIs API key wise?

Currently it is showing data for all API keys, but I want to display API calls, 5xx errors, 4xx errors etc fo

相关标签:
2条回答
  • 2021-01-24 15:19

    API Gateway doesn't (yet) offer first-class support for API Key metrics. As @kixorz mentioned, you could implement this in the application layer for the time being (for example using Lambda and CloudWatch).

    0 讨论(0)
  • 2021-01-24 15:31

    If you're looking at monitoring the API on X-Api-Key header level, it looks like this is currently not possible. I'm guessing you'd have to do it yourself on the application layer, which should be relatively easy if you're using Lambda. Your question brings up another question: Does it really make sense to monitor individual API keys when errors are associated with particular API deployment/version?

    If you'd like to monitor per-user use, you need to make use of IAM credentials with your API and CloudTrail to monitor requests made with specific credentials. You can find more info on the API Gateway CloudTrail integration page.

    0 讨论(0)
提交回复
热议问题