newrelic / newrelic-telemetry-sdk-java

Java library for sending telemetry data to New Relic
Apache License 2.0
41 stars 37 forks source link

update BatchDataSender to show the cause of IOException #294

Closed vinicius-roc closed 2 years ago

vinicius-roc commented 2 years ago

BatchDataSender was updated to show the cause of IOException.

In my scenario, when I try to send a metrics to new relic i received the below message.

WARN transport.BatchDataSender: IOException (message: Error posting metrics to New Relic) while trying to send data to New Relic. MetricBatch retry recommended

When i look for root cause of IOException, i found MicrometerHttpPoster that encapsule the original cause inside IOException

try {
  ...
} catch (Throwable th) {
  throw new IOException("Error posting metrics to New Relic", th);
}

So, to be able to see the root cause, I added to message

CLAassistant commented 2 years ago

CLA assistant check
All committers have signed the CLA.

CLAassistant commented 2 years ago

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.