open-telemetry / opentelemetry-collector

OpenTelemetry Collector
https://opentelemetry.io
Apache License 2.0
4.46k stars 1.47k forks source link

[exporterhelper] Queue sender consumeFunc shoudln't say dropping data for persistent queue #10367

Open splunkericl opened 5 months ago

splunkericl commented 5 months ago

Important (read before submitting)

Is your feature request related to a problem? Please describe. As a user of otel collector, I find queue sender error message confusing. Right now when an error is returned, especially during shutdown, queue sender would log Exporting failed. Dropping data.. https://github.com/open-telemetry/opentelemetry-collector/blob/main/exporter/exporterhelper/queue_sender.go#L101

Users might find data loss concerning while persistent queue won't drop the data. Message should be improved.

Describe the solution you'd like consumeFunc error message is supplied by the exporter queue type. If it is persistent queue, simply say Exporting Failed. If it is memory queue, log dropping data additionally.

Describe alternatives you've considered N/A

Additional context

carsonip commented 5 months ago

persistent queue won't drop the data

My understanding is that even with persistent queue, when nextSender.send returns, the item will be deleted from the queue (see code) with the exception of shutdownErr. Therefore, the log message is wrong for persistent queue only on shutdown.