1

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 for particular API key.

2 Answers 2

1

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.

Sign up to request clarification or add additional context in comments.

7 Comments

Yes. I'm assuming he's referring to the API Key used in the X-Api-Key header.
That isn't included in requestParameters in the log entries?
@napalm Actually I will create different API key for different third party developers. And they will call our Amazon API Gateway APIs using given API key and I want to show them their total API calls and failed calls (e.g. 4xx, 5xx) via dashboard. So using your given details, if I want to show dashboard at real-time, I have to fetch log every time and parse it and it would be very time consuming process. That's why I asked is there any easy API or method available for filtering data by API key?
@napalm I also checked in log file generated by CloudTrail in S3 bucket, but no API key or parameters are there.
|
0

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).

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.