Skip to content

confluent-kafka-python produce headers could be dict or a list #1364

@owenhaynes

Description

@owenhaynes

Environment

Python 3.10
confluent-kafka[avro]==1.9.2
opentelemetry-instrumentation-confluent-kafka==0.34b0

Steps to reproduce
Pass a dict of headers to the producer

What is the expected behavior?
To not crash and handle using a list or a dict for the headers

What is the actual behavior?
crashes because of calling append on a dict of headers in KafkaContextSetter

Additional context
The docs say produce can take a dict or a list https://docs.confluent.io/platform/current/clients/confluent-kafka-python/html/index.html#confluent_kafka.Producer.produce

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions