open-telemetry / opentelemetry-collector-contrib

Contrib repository for the OpenTelemetry Collector
https://opentelemetry.io
Apache License 2.0
3.09k stars 2.38k forks source link

Kafka exporter does not support zstd compression #26365

Closed ikstewa closed 1 year ago

ikstewa commented 1 year ago

Component(s)

exporter/kafka

What happened?

Description

Documentation stats zstd is supported however an older version of sarama is being used which does not support zstd.

Steps to Reproduce

Set zstd compression on a kafka exporter:

  kafka:
    brokers:
      - kafka:9092
    topic: "apo_metrics_otlp_json"
    encoding: otlp_json
    producer:
      compression: zstd

Expected Result

zstd compression is supported

Actual Result

Collector fails to start up with the following error:

2023-08-31 16:10:18 Error: failed to build pipelines: failed to create "kafka" exporter for data type "metrics": kafka: invalid configuration (zstd compression requires Version >= V2_1_0_0)
2023-08-31 16:10:18 2023/08/31 23:10:18 collector server run finished with error: failed to build pipelines: failed to create "kafka" exporter for data type "metrics": kafka: invalid configuration (zstd compression requires Version >= V2_1_0_0)

Collector version

otel/opentelemetry-collector-contrib:0.83.0

Environment information

Environment

docker

OpenTelemetry Collector configuration

No response

Log output

2023-08-31 16:10:18 Error: failed to build pipelines: failed to create "kafka" exporter for data type "metrics": kafka: invalid configuration (zstd compression requires Version >= V2_1_0_0)
2023-08-31 16:10:18 2023/08/31 23:10:18 collector server run finished with error: failed to build pipelines: failed to create "kafka" exporter for data type "metrics": kafka: invalid configuration (zstd compression requires Version >= V2_1_0_0)

Additional context

No response

github-actions[bot] commented 1 year ago

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

ikstewa commented 1 year ago

Confirmed the issue was due to missing protocol_version field. Setting to a value > 2.1.0 fixed the issue.