Do you have a code example that uses the Java SDK to publish statistic sets to Cloudwatch?

0

We use Cloudwatch at Datazoom, the company I work at. It's a great service. However, our bills are significant with respect to Cloudwatch. We primarily use Cloudwatch as a metrics store and monitoring dashboard to hold our custom metrics. We spend a significant amount on CW.PutMetricData (a.k.a. PMD) calls today.

To reduce our Cloudwatch PMD traffic, I would like to use https://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/cloudwatch/model/StatisticSet.html or https://sdk.amazonaws.com/java/api/2.0.0/software/amazon/awssdk/services/cloudwatch/model/StatisticSet.html

However, I don't see a good example of how to use this. Please help.

已提問 2 年前檢視次數 866 次
1 個回答
1

Hi,

I think https://github.com/apache/jclouds/blob/master/apis/cloudwatch/src/test/java/org/jclouds/cloudwatch/features/AlarmApiLiveTest.java#L57 has a good example => the MetricDatum builder exposes a StatisticValues routine which can be either a builder or a StatisticSet.

However please note that if you publish statistic sets, you will lose the ability to use some advanced statistics such as percentiles or trimmed means on your metrics.

How many MetricDatum objects do you publish on average with every PutMetricData call? You can send up to 20 MetricDatum objects per call, so if cost is the concern, it might be good to double check if you are using the API as efficiently as possible?

profile pictureAWS
Jsc
已回答 2 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南