newrelic / newrelic-telemetry-sdk-java

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

Specify the type of batch that received an error and can't be sent. #238

Closed XiXiaPdx closed 3 years ago

XiXiaPdx commented 4 years ago

Expected:

TelemetryClient and BatchDataSender sends for all 4 Batch types and outputs logs providing visibility into the send process and if an error occurs.

The log messages would be clear as to which of the 4 batch types it is informing about.

Currently:

The log messages in both classes are hardcoded to metric batch type. This is at best ambiguous or potentially incorrect as to what type of batch is experiencing issues or was successfully sent. This makes troubleshooting more difficult.

https://github.com/newrelic/newrelic-telemetry-sdk-java/blob/ead77b298be355df60f98a085085387815aa7a30/telemetry/src/main/java/com/newrelic/telemetry/TelemetryClient.java#L193-L195

Fix: The error message should reflect the type of batch (metric, event, trace, log) that failed to send.