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.

posta 2 anni fa866 visualizzazioni
1 Risposta
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
con risposta 2 anni fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande