cloudfoundry / java-buildpack-metric-writer

Apache License 2.0
2 stars 4 forks source link

Failed to send Spring Boot metrics to Metrics Forwarder service due to unprocessable payload #4

Closed ukabu closed 6 years ago

ukabu commented 6 years ago

We are gettings this exception for an app binded to the PCF Metrics Forwarder (PCF 2.0.21)

It is at application startup. We've enabled debug level logging and it looks like a large amount of metrics is being sent. Can that be the cause?

Anybody seen this?

14-09-2018 17:55:08.441 [pool-2-thread-1,,,] ERROR o.c.m.RestOperationsMetricPublisher - Failed to send Spring Boot metrics to Metrics Forwarder service due to unprocessable payload. Discarding metrics.
org.springframework.web.client.HttpClientErrorException: 422 Unprocessable Entity
at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:85) ~[spring-web-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
at org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:708) ~[spring-web-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:661) ~[spring-web-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:621) ~[spring-web-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
at org.springframework.web.client.RestTemplate.postForEntity(RestTemplate.java:415) ~[spring-web-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
at org.cloudfoundry.metrics.RestOperationsMetricPublisher.publish(RestOperationsMetricPublisher.java:62) ~[metric_writer-2.4.0_RELEASE.jar!/:na]
at org.cloudfoundry.metrics.boot1.SpringBootMetricWriter.publish(SpringBootMetricWriter.java:75) [metric_writer-2.4.0_RELEASE.jar!/:na]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[na:1.8.0_181]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) ~[na:1.8.0_181]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) ~[na:1.8.0_181]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) ~[na:1.8.0_181]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_181]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_181]
at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_181]
nebhale commented 6 years ago

In practice, no we don't see this. You might take a look at the Metrics Fowarder logs in order to determine what it thinks is wrong with the payload, but given that we haven't made a change to the payload format in at least six months, I don't think the problem is on the Metric Writer side of things.