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年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ