opentelemetry-collector: `exporterhelper` should reject a queue size of `0`

Describe the bug

exporterhelper allows for a QueueSize of 0, which results in a permanently blocked exporter that drops all data (see https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/6718#issuecomment-994715344).

Steps to reproduce

Create a pipeline with an exporter that exposes the QueueSettings struct and set the queue size to 0.

What did you expect to see?

The Collector would fail to start and provide a descriptive error.

What did you see instead?

The Collector fails each time a payload gets to the exporter with a message similar to:

exporterhelper/queued_retry.go:99       Dropping data because sending_queue is full. Try increasing queue_size.   {"kind": "exporter", "name": "otlp", "dropped_items": 3}

What version did you use? Version: (e.g., v0.4.0, 1eb551b, etc)

Latest commit reproduces 81ab024486f067433d025fe0b25f8b532520ebe0

What config did you use? Config: (e.g. the yaml config file)

Example config with contrib distro
receivers:
  hostmetrics:
    scrapers:
      load:
    collection_interval: 2s

exporters:
  otlp:
    endpoint: 0.0.0.0:4317
    sending_queue:
      queue_size: 0

  
service:
  pipelines:
    metrics:
      receivers: [hostmetrics]
      exporters: [otlp]

Environment

not relevant

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 26 (25 by maintainers)

Commits related to this issue

Most upvoted comments

@FreakyNobleGas indeed, but go is duck typing, see https://medium.com/@matryer/golang-advent-calendar-day-one-duck-typing-a513aaed544d

TLDR: If a struct has a “Validate() error” func it means it implements that interface.