0

I want to monitoring "How many api call on AWS API GATEWAY".

I can monitoring API call using "Usage Plans" on AWS console. Usage Plans => Select Plans => API Keys => Select API Key => Click Usage.

How implement it using node.js?

2 Answers 2

1

From Amazon API Gateway Dimensions and Metrics - Amazon API Gateway:

Count: The total number API requests in a given period.

So, you can obtain this information directly out of Amazon CloudWatch.

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

Comments

0

Solved. This is the code for get API call count.

var AWS = require('aws-sdk');
var apigateway = new AWS.APIGateway({
  apigateway: '2015-07-09',
  accessKeyId: '',
  secretAccessKey: '',
  region: '',
});

var params = {
  endDate: '', /* required */
  startDate: '', /* required */
  usagePlanId: '', /* required */
  keyId: '',
};
apigateway.getUsage(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Source : AWSJavaScriptSDK

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.