Skip to content

[exporter/kafka] Kafka exporter blocks collector pipeline with continuous retries when a configuration error occurs #38604

Closed
@an-mmx

Description

@an-mmx

Component(s)

exporter/kafka

What happened?

Description

The Kafka exporter should not perform retries on Sarama configuration errors. There is no point in retries, as each retry will result in the same configuration error and ultimately block the collector's pipeline.

From the message producer's perspective, as of version [email protected], configuration errors occur in the following cases:

  • When message headers are specified, but the protocol version does not support them.
  • When the message size exceeds Producer.MaxMessageBytes.

Steps to Reproduce

Configure pipeline with Batch processor having batch_size: 25000 and timeout: 1m
Configure Kafka exporter havingretry_on_failure.enabled: true and producer.max_message_bytes: 100000
Have a constant telemetry flow

Expected Result

The telemetry batch should be dropped, and a corresponding error message should be logged when this issue occurs. The Kafka exporter should still be able to perform retries for other errors, such as network timeouts, etc.

Actual Result

The Kafka exporter performs numerous retries while adhering to the retry_on_failure options. The reason for retry is a configuration error: "Attempt to produce message larger than configured Producer.MaxMessageBytes"

Collector version

v0.121.0

Environment information

No response

OpenTelemetry Collector configuration

receivers:
  otlp:

processors:
  batch:
    send_batch_size: 10000
    timeout: 1m

exporters:
  kafka/metrics:
    brokers:
      - kafka.broker.local
    encoding: otlp_proto
    producer:
      max_message_bytes: 100000
    retry_on_failure:
      enabled: true
      initial_interval: 5s
      max_elapsed_time: 10m
      max_interval: 30s
    sending_queue:
      enabled: true
    timeout: 5s
    topic: test.topic

service:
  pipelines:
    metrics:
      exporters:
        - kafka/metrics
      processors:
        - batch
      receivers:
        - otlp

Log output

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions