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.

preguntada hace 2 años866 visualizaciones
1 Respuesta
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
respondido hace 2 años

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas