open-telemetry / opentelemetry-collector

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

Uniform defaults for `exporterhelper` #4455

Open mx-psi opened 2 years ago

mx-psi commented 2 years ago

The exporterhelper package provides certain reusable helpers for common needs like queueing, retrying with backoff or timeouts. As of e23c9d0a01834a64162acb1677b7d69aa5be46f5 the timeout setting is enabled by default but the rest are not: https://github.com/open-telemetry/opentelemetry-collector/blob/e23c9d0a01834a64162acb1677b7d69aa5be46f5/exporter/exporterhelper/common.go#L102-L108

This issue is to address the TODOs in the code. The current status is a bit confusing, since the documentation does not state which settings are enabled by default and which are not.

The individual items are to

I think timeout and queueing are safe to enable by default, while retries are a bit more doubtful: some of the exporters in contrib do several network requests per ConsumeTraces/Metrics/Logs call, so in situations of partial success (e.g. 1st request passes and the 2nd fails), it may not be safe or desirable to re-do previous requests. It may be fine to enable retries with a caveat on partial success situations.

dmitryax commented 9 months ago

This should wait for https://github.com/open-telemetry/opentelemetry-collector/issues/6767 and https://github.com/open-telemetry/opentelemetry-collector/issues/8122 to be resolved first