Skip to content
This repository was archived by the owner on Jan 19, 2022. It is now read-only.

Default batch size incompatible with CloudWatchExportAutoConfiguration #349

Closed
jmccance opened this issue Jun 20, 2018 · 0 comments
Closed
Labels
component: cloudwatch CloudWatch integration related issue help wanted type: bug A general bug
Milestone

Comments

@jmccance
Copy link

The CloudWatch metrics use the default batch size from StepRegistryProperties, which is 10000. The maximum batch size for CloudWatch metrics is 20.

This leads to this exception when the app tries to publish metrics:

com.amazonaws.services.cloudwatch.model.InvalidParameterValueException: The collection MetricData must not have a size greater than 20. (Service: AmazonCloudWatch; Status Code: 400; Error Code: InvalidParameterValue; Request ID: c3d34eb9-74c3-11e8-94a3-655359213eb6)
        at com.amazonaws.http.AmazonHttpClient$RequestExecutor.handleErrorResponse(AmazonHttpClient.java:1632)
        at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeOneRequest(AmazonHttpClient.java:1304)
        at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeHelper(AmazonHttpClient.java:1058)
        at com.amazonaws.http.AmazonHttpClient$RequestExecutor.doExecute(AmazonHttpClient.java:743)
        at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeWithTimer(AmazonHttpClient.java:717)
        at com.amazonaws.http.AmazonHttpClient$RequestExecutor.execute(AmazonHttpClient.java:699)
        at com.amazonaws.http.AmazonHttpClient$RequestExecutor.access$500(AmazonHttpClient.java:667)
        at com.amazonaws.http.AmazonHttpClient$RequestExecutionBuilderImpl.execute(AmazonHttpClient.java:649)
        at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:513)
        at com.amazonaws.services.cloudwatch.AmazonCloudWatchClient.doInvoke(AmazonCloudWatchClient.java:1401)
        at com.amazonaws.services.cloudwatch.AmazonCloudWatchClient.invoke(AmazonCloudWatchClient.java:1377)
        at com.amazonaws.services.cloudwatch.AmazonCloudWatchClient.executePutMetricData(AmazonCloudWatchClient.java:1284)
        at com.amazonaws.services.cloudwatch.AmazonCloudWatchAsyncClient$15.call(AmazonCloudWatchAsyncClient.java:807)
        at com.amazonaws.services.cloudwatch.AmazonCloudWatchAsyncClient$15.call(AmazonCloudWatchAsyncClient.java:801)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

I was able to resolve this by manually setting management.metrics.export.cloudwatch.batchSize: 20 in application.yaml.

It would be nice if CloudWatchExportAutoConfiguration or CloudWatchProperties used a valid default.

Dependency Version
spring-cloud Finchley.RELEASE
spring-cloud-aws-autoconfigure 2.0.0.RELEASE
micrometer-registry-cloudwatch 1.0.5
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Oct 1, 2018
@spencergibb spencergibb added type: bug A general bug help wanted and removed status: waiting-for-triage An issue we've not yet triaged labels Jan 29, 2019
@maciejwalkowiak maciejwalkowiak added the component: cloudwatch CloudWatch integration related issue label May 29, 2020
@maciejwalkowiak maciejwalkowiak added this to the 2.2.3 milestone May 31, 2020
maciejwalkowiak pushed a commit to maciejwalkowiak/spring-cloud-aws that referenced this issue Oct 15, 2020
maciejwalkowiak pushed a commit to maciejwalkowiak/spring-cloud-aws that referenced this issue Oct 15, 2020
maciejwalkowiak pushed a commit to maciejwalkowiak/spring-cloud-aws that referenced this issue Oct 15, 2020
maciejwalkowiak pushed a commit to maciejwalkowiak/spring-cloud-aws that referenced this issue Oct 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
component: cloudwatch CloudWatch integration related issue help wanted type: bug A general bug
Development

Successfully merging a pull request may close this issue.

4 participants