Skip to content

Fix KafkaProducer.send() arguments in opentelemetry-instrumentation-kafka-python#2125

Closed
holmuk wants to merge 2 commits intoopen-telemetry:mainfrom
holmuk:kafka-python-tracer-send
Closed

Fix KafkaProducer.send() arguments in opentelemetry-instrumentation-kafka-python#2125
holmuk wants to merge 2 commits intoopen-telemetry:mainfrom
holmuk:kafka-python-tracer-send

Conversation

@holmuk
Copy link
Copy Markdown

@holmuk holmuk commented Jan 16, 2024

Description

It appears there is a bug with instrumentation when we call KafkaProducer.send with some headers argument in args:

producer = KafkaProducer()
producer.send('test-topic', b'message', None, None, None, None)

We get TypeError: KafkaProducer.send() got multiple values for argument 'headers' when running the code with enabled instrumentation.

This PR fixes the issue.

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • This PR includes a unit-test.
  • Run the code provided above.

Does This PR Require a Core Repo Change?

  • No.

Checklist:

See contributing.md for styleguide, changelog guidelines, and more.

  • Followed the style guidelines of this project
  • Unit tests have been added

@linux-foundation-easycla
Copy link
Copy Markdown

CLA Not Signed

michaelsafyan added a commit to michaelsafyan/open-telemetry.opentelemetry-python-contrib that referenced this pull request Apr 17, 2025
aabmass pushed a commit that referenced this pull request Apr 23, 2025
…or the Google GenAI SDK instrumentation (#3374)

* Create a utility to simplify recording request attributes.

* Update recording mechanism to record more request options.

* Improve the recording of span request attributes.

* Reformat with ruff.

* Update TODOs to reflect change made here.

* Update changelog now that PR has been created and can be referenced.

* Fix lint issues.

* Reformat with ruff.

* Add more documentation comments requested in the pull request.

* Add tests and comments that provide some additional clarity regarding the flattening logic in response to PR comments.

* Add tests and comments that provide some additional clarity regarding the flattening logic in response to PR comments.

* Handle corner case where flatten function returns compound output.

* Update prefix to match currently proposed SemConv.

* Update to specify attributes from SemConv constants per PR feedback.

* Use an allowlist for dynamic keys per PR feedback.

* Reformat with ruff.

* Fix lint issues.

* Reformat with ruff.

* Handle flattening errors more gracefully.

* Add support for more wildcards in the allowlist.

* Add a clearer type for the flatten functions.

* Simplify 'exclude_keys' initialization per PR feedback.

* Simplify AllowList constructor type annotation per PR feedback.

* Reformat with ruff.

* Resolve lint error concerning too many returns.

* Reformat with ruff.

* Update name to reflect requested changes in Semantic Conventions pull request #2125.

* Add test to verify correct handling of Unicode.

* Reformat with ruff.

* Remove deuplicated test.
@github-actions
Copy link
Copy Markdown

This PR has been automatically marked as stale because it has not had any activity for 14 days. It will be closed if no further activity occurs within 14 days of this comment.
If you're still working on this, please add a comment or push new commits.

@github-actions github-actions Bot added the Stale label Mar 11, 2026
@github-actions
Copy link
Copy Markdown

This PR has been closed due to inactivity. Please reopen if you would like to continue working on it.

@github-actions github-actions Bot closed this Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant