3

I want to gain some insights into the performance of my application that connects to several services in AWS e.g. IAM and S3. One metric interesting to me is requests-per-minute, I have checked around for possible approaches, AWS Metrics is limited to enterprise customers as stated in this AWS document. Another approach is generating Java SDK metrics, via CloudWatch. I have enabled this by adding the command below to the system property

-Dcom.amazonaws.sdk.enableDefaultMetrics=credentialFile=/path/aws.properties

I see some metrics in the CloudWatch dashboard, however, there is no request-per-second. I'd like to find out if someone has experience with this or maybe I am missing something.

SyCode
  • 1,077
  • 4
  • 22
  • 33
  • 2
    Interesting question. I wonder if X-ray could be somehow used for that? – Marcin Mar 10 '20 at 23:47
  • @Marcin I had a look at AWS X-RAY, however there is a limitation: it requires the application to be hosted on AWS Infrastructure. – SyCode Apr 02 '20 at 18:11

2 Answers2

3

I have come across this problem. But the problem I came across is that I wanted to control the number of requests so that the number of API calls will not exceed the relevant quotas.

I solved it by using the RateLimiter class from Guava library, which is an open-source common libraries for java by Google, which can control the rate of process happening.

I was able to limit the number of API calls to 3 times per second and then I got the issue solved. The import is → com.google.common.util.concurrent.RateLimiter;

Try it out https://www.baeldung.com/guava-rate-limiter

I hope it helps

Althaf1467
  • 281
  • 1
  • 14
1

To get the metrics for a bucket you have to enable them

https://docs.amazonaws.cn/en_us/AmazonS3/latest/user-guide/configure-metrics.html

Once it has been running for a period of time, find the metric you want in Cloudwatch, there is a list of the names here

https://docs.aws.amazon.com/AmazonS3/latest/dev/cloudwatch-monitoring.html

Vorsprung
  • 32,923
  • 5
  • 39
  • 63
  • This is quite useful and I'll enable this feature now ! However since the requests to the buckets form a fraction of the entire requests, I need to unravel how to do similar to the remaining assets e.g. users, policies, ... – SyCode Mar 13 '20 at 17:21