{"action":"opened","issue":{"url":"https://api.github.com/repos/spring-cloud/spring-cloud-aws/issues/349","repository_url":"https://api.github.com/repos/spring-cloud/spring-cloud-aws","labels_url":"https://api.github.com/repos/spring-cloud/spring-cloud-aws/issues/349/labels{/name}","comments_url":"https://api.github.com/repos/spring-cloud/spring-cloud-aws/issues/349/comments","events_url":"https://api.github.com/repos/spring-cloud/spring-cloud-aws/issues/349/events","html_url":"https://github.com/spring-cloud/spring-cloud-aws/issues/349","id":334239746,"node_id":"MDU6SXNzdWUzMzQyMzk3NDY=","number":349,"title":"Default batch size incompatible with CloudWatchExportAutoConfiguration ","user":{"login":"jmccance","id":764591,"node_id":"MDQ6VXNlcjc2NDU5MQ==","avatar_url":"https://avatars1.githubusercontent.com/u/764591?v=4","gravatar_id":"","url":"https://api.github.com/users/jmccance","html_url":"https://github.com/jmccance","followers_url":"https://api.github.com/users/jmccance/followers","following_url":"https://api.github.com/users/jmccance/following{/other_user}","gists_url":"https://api.github.com/users/jmccance/gists{/gist_id}","starred_url":"https://api.github.com/users/jmccance/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmccance/subscriptions","organizations_url":"https://api.github.com/users/jmccance/orgs","repos_url":"https://api.github.com/users/jmccance/repos","events_url":"https://api.github.com/users/jmccance/events{/privacy}","received_events_url":"https://api.github.com/users/jmccance/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-20T20:36:16Z","updated_at":"2018-06-20T20:36:16Z","closed_at":null,"author_association":"NONE","body":"The CloudWatch metrics use the default batch size from StepRegistryProperties, which is 10000. [The maximum batch size for CloudWatch metrics is 20.](https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_PutMetricData.html)\r\n\r\nThis leads to this exception when the app tries to publish metrics:\r\n\r\n```\r\ncom.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)\r\n        at com.amazonaws.http.AmazonHttpClient$RequestExecutor.handleErrorResponse(AmazonHttpClient.java:1632)\r\n        at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeOneRequest(AmazonHttpClient.java:1304)\r\n        at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeHelper(AmazonHttpClient.java:1058)\r\n        at com.amazonaws.http.AmazonHttpClient$RequestExecutor.doExecute(AmazonHttpClient.java:743)\r\n        at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeWithTimer(AmazonHttpClient.java:717)\r\n        at com.amazonaws.http.AmazonHttpClient$RequestExecutor.execute(AmazonHttpClient.java:699)\r\n        at com.amazonaws.http.AmazonHttpClient$RequestExecutor.access$500(AmazonHttpClient.java:667)\r\n        at com.amazonaws.http.AmazonHttpClient$RequestExecutionBuilderImpl.execute(AmazonHttpClient.java:649)\r\n        at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:513)\r\n        at com.amazonaws.services.cloudwatch.AmazonCloudWatchClient.doInvoke(AmazonCloudWatchClient.java:1401)\r\n        at com.amazonaws.services.cloudwatch.AmazonCloudWatchClient.invoke(AmazonCloudWatchClient.java:1377)\r\n        at com.amazonaws.services.cloudwatch.AmazonCloudWatchClient.executePutMetricData(AmazonCloudWatchClient.java:1284)\r\n        at com.amazonaws.services.cloudwatch.AmazonCloudWatchAsyncClient$15.call(AmazonCloudWatchAsyncClient.java:807)\r\n        at com.amazonaws.services.cloudwatch.AmazonCloudWatchAsyncClient$15.call(AmazonCloudWatchAsyncClient.java:801)\r\n        at java.util.concurrent.FutureTask.run(FutureTask.java:266)\r\n        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\r\n        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\r\n        at java.lang.Thread.run(Thread.java:748)\r\n```\r\n\r\nI was able to resolve this by manually setting `management.metrics.export.cloudwatch.batchSize: 20` in `application.yaml`.\r\n\r\nIt would be nice if CloudWatchExportAutoConfiguration or CloudWatchProperties used a valid default.\r\n\r\n| Dependency | Version\r\n|:- |:-\r\n| spring-cloud | Finchley.RELEASE\r\n| spring-cloud-aws-autoconfigure | 2.0.0.RELEASE\r\n| micrometer-registry-cloudwatch | 1.0.5\r\n\r\n<!--\r\nThanks for raising a Spring Cloud issue. What sort of issue are you raising?\r\n\r\nQuestion\r\n\r\nPlease ask questions about how to use something, or to understand why something isn't\r\nworking as you expect it to, on Stack Overflow using the spring-cloud tag.\r\n\r\nBug report\r\n\r\nPlease provide details of the problem, including the version of Spring Cloud that you\r\nare using. If possible, please provide a test case or sample application that reproduces\r\nthe problem. This makes it much easier for us to diagnose the problem and to verify that\r\nwe have fixed it.\r\n\r\nEnhancement\r\n\r\nPlease start by describing the problem that you are trying to solve. There may already\r\nbe a solution, or there may be a way to solve it that you hadn't considered.\r\n-->\r\n"}}
{"actor":{"display_login":"jmccance"}}