Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: access rdkafka message headers with strings instead of symbols #650

Closed

Conversation

Ruto8
Copy link

@Ruto8 Ruto8 commented Sep 5, 2023

For context, we're using both rdkafka-ruby and opentelemetry-ruby-contrib and we get a lot of warnings like this in the logs:

rdkafka deprecation warning: header access with Symbol key :traceparent treated as a String. Please change your code to use String keys to avoid this warning. Symbol keys will break in version 1.

I tracked it down to this line from rdkafka-ruby, where it seems they have deprecated accessing headers with Symbols.

In this PR, I removed the specific getter set to symbol_key_getter for the rdkafka consumer patch. This is also similar to what is done with ruby-kafka.

I believe the getter will default to text_map_getter, so we don't have to explicitly set it here.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Sep 5, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: Ruto8 / name: Paweł Rutkowski (6dc0a55)
  • ✅ login: arielvalentin / name: Ariel Valentin (c942dc9, b1452ba, 229c7ac, 112f119)
  • ✅ login: fbogsany / name: Francis Bogsanyi (8dba370)
  • ✅ login: kaylareopelle / name: Kayla Reopelle (she/her) (27384c2)

@Ruto8 Ruto8 force-pushed the fix-rdkafka-deprecation-warning branch from c36b910 to f8d2036 Compare September 5, 2023 14:54
@arielvalentin
Copy link
Collaborator

@Ruto8 Ruto8 force-pushed the fix-rdkafka-deprecation-warning branch from f8d2036 to 6dc0a55 Compare September 6, 2023 07:04
@Ruto8
Copy link
Author

Ruto8 commented Sep 6, 2023

@Ruto8 Would you kindly take a look at this failing test?

@arielvalentin thank you for pointing this out. Unfortunately, the tests pass locally for me. I'm able to access the span, as expected. Can there be some differences between CI and local setup here? Is it possible it's a flaky test?

@arielvalentin
Copy link
Collaborator

Did you try running the test with the seed option that's failing?

Run options: --seed 35683

Or running the test in a loop to see if it's non-deterministic? Something like

for i in {1..20}; do
  bundle exec rake test
done

@github-actions
Copy link
Contributor

👋 This pull request has been marked as stale because it has been open with no activity. You can: comment on the issue or remove the stale label to hold stale off for a while, add the keep label to hold stale off permanently, or do nothing. If you do nothing this pull request will be closed eventually by the stale bot

@github-actions github-actions bot added the stale Marks an issue/PR stale label Oct 20, 2023
@arielvalentin arielvalentin requested a review from a team October 28, 2023 17:23
@github-actions github-actions bot removed the stale Marks an issue/PR stale label Oct 29, 2023
Copy link
Contributor

github-actions bot commented Dec 8, 2023

👋 This pull request has been marked as stale because it has been open with no activity. You can: comment on the issue or remove the stale label to hold stale off for a while, add the keep label to hold stale off permanently, or do nothing. If you do nothing this pull request will be closed eventually by the stale bot

@github-actions github-actions bot added the stale Marks an issue/PR stale label Dec 8, 2023
@github-actions github-actions bot closed this Dec 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Marks an issue/PR stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants