Skip to content

Conversation

@joker1007
Copy link
Contributor

The current latest version of rdkafka-ruby is v0.21.0, which is not available in the current instrumentation.
Therefore, update the version of gem requriement.

The changelog of rdkafka does not seem to show any breaking changes that affect tracing.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Mar 11, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

@xuan-cao-swi
Copy link
Contributor

I think it's ok to leave the each_batch function here or completely remove this function for new instrumentation-rdkafka version, rather than having the condition to check version each time.

rdkafka seems still keep the each_batch but with raise error. If user use > v0.20.0, and still use each_batch in their app, with or without instrumentation-rdkafka, they will get the error.

@joker1007 joker1007 force-pushed the update-rdkafka-requirement branch from 78310e3 to de95123 Compare March 28, 2025 06:15
@joker1007
Copy link
Contributor Author

@xuan-cao-swi
Thank you for your review comment!
I deleted the each_batch method completely.
Do you think this patch is OK?

@arielvalentin
Copy link
Contributor

Deleting each_batch for earlier versions of the gem means the instrumentation will change. If we no longer want to maintain backward compatibility this change should also define a new minimum version supported where the each_batch method was removed.

compatible do
gem_version = Gem::Version.new(::Rdkafka::VERSION)
Gem::Requirement.new('>= 0.10.0', '< 0.20.0').satisfied_by?(gem_version)
Gem::Requirement.new('>= 0.10.0', '< 0.22.0').satisfied_by?(gem_version)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think @arielvalentin means to change to Gem::Requirement.new('>= 0.20.0').satisfied_by?(gem_version) for new instrumentation-rdkafka version

@kaylareopelle
Copy link
Contributor

Hi @joker1007, could you take a look at @xuan-cao-swi's comment?

@joker1007
Copy link
Contributor Author

@xuan-cao-swi @kaylareopelle

I've been so busy for a couple of weeks that I haven't had time to check GitHub properly.
I am very sorry for the delay in responding to your comments.

@kaylareopelle kaylareopelle changed the title chore: update gem version requirement of rdkafka feat: update gem version requirement of rdkafka Apr 30, 2025
Copy link
Contributor

@kaylareopelle kaylareopelle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @joker1007! I'm sorry for our subsequent delay. I really appreciate your patience. I was getting ready to merge this and noticed a few other things.

I realized today that the supported version range of the rdkafka gem published on their repo is 0.18.0 - 0.22.0. We generally have instrumentation support for all the versions supported by the maintainers of the library. I think we need to increase the min version to 0.18.0.

Would you mind making the following updates?

  • updating this PR to wrap a condition around each_batch based on the versions that support it, 0.19.0 and below?
  • update the Appraisals file to run the tests on the newly supported version range.

@joker1007
Copy link
Contributor Author

joker1007 commented May 1, 2025

@kaylareopelle
Thanks for your reply! I don't mind.

OK, I'm going to do the following tasks.

  1. Revert each_batch method for v0.20.0 > V >= v0.18.0 (consider patch version)
  2. Add version 0.20.0, 0.21.0 to Appraisals (0.22.0 is not released yet)

I can do more tasks if you discard versions that are not maintained from our supported versions.

  1. Increase Gem::Requirement version up to 0.18.0
  2. Delete old versions earlier than 0.18.0 from Appraisals.

For now, I will implement 1 and 2.

@joker1007
Copy link
Contributor Author

@kaylareopelle

It appears that approval is needed again to run the workflow.

@kaylareopelle
Copy link
Contributor

Hi @joker1007, thanks for your understanding. Please take care of 3 and 4 if you can as well!

@joker1007
Copy link
Contributor Author

@kaylareopelle

I have done the tasks.

In summary, I have implemented the following

  1. support the each_batch method under 0.20.0
  2. add 0.20.0 and 0.21.0 to Appraisal and remove versions below 0.18.0
  3. set Gem::Requirement to 0.18.0 or higher
  4. remove if-statement considering codes under 0.13.0

@kaylareopelle
Copy link
Contributor

This looks great! Thank you for the changes, @joker1007.

@kaylareopelle kaylareopelle merged commit abde37a into open-telemetry:main May 1, 2025
61 of 62 checks passed
@joker1007 joker1007 deleted the update-rdkafka-requirement branch May 5, 2025 15:58
yiyuan-he pushed a commit to yiyuan-he/opentelemetry-ruby-contrib that referenced this pull request May 14, 2025
* chore: update gem version requirement of rdkafka

* fix: consider `each_batch` removed in rdkafka-0.20.0

* chore: delete redundant `::`

* fix: delete `each_batch` method from targets of instrumentation

* fix: fix version constraint of rdkafka

* Revert "fix: delete `each_batch` method from targets of instrumentation"

This reverts commit de95123.

* ci: update Appraisals of rdkafka to support recent versions

* fix: loosen version constraints to support old versions

* fix: Make the unmaintained versions of rdkafka-ruby unsupported

---------

Co-authored-by: Kayla Reopelle <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants