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.

demandé il y a 2 ans866 vues
1 réponse
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
répondu il y a 2 ans

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions