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: require csv for ruby-3.4 compatibility #1560

Merged
merged 2 commits into from
Jan 23, 2024

Conversation

romuloceccon
Copy link
Contributor

Loading opentelemetry-exporter-otlp on ruby-3.3 now prints a warning:

.../lib/opentelemetry/exporter/otlp/exporter.rb:10: warning: csv
was loaded from the standard library, but will no longer be part
of the default gems since Ruby 3.4.0. Add csv to your Gemfile or
gemspec. Also contact author of opentelemetry-exporter-otlp-0.26.1
to add csv into its gemspec.

This commit fixes that by adding an explicit dependency from opentelemetry-exporter-otlp to the csv gem at version '~> 3.1' (ruby-3.0 bundles csv at 3.1.9).

Copy link

linux-foundation-easycla bot commented Jan 8, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: romuloceccon / name: Rômulo Ceccon (35b28d1)
  • ✅ login: mwear / name: Matthew Wear (02c0c40)

@kaylareopelle
Copy link
Contributor

Hi @romuloceccon! Thanks for submitting this fix! Getting rid of the deprecation warning sounds great to me.

I was looking at the uses of CSV in this library, and I think it may not be used outside the require statement in exporter/ot|p/lib/opentelemetry/exporter/ot|p/ exporter.rb line 10.

Could you try removing the require statement and see if the tests pass and the deprecation warning goes away?

@arielvalentin
Copy link
Contributor

Hi @romuloceccon! Thanks for submitting this fix! Getting rid of the deprecation warning sounds great to me.

I was looking at the uses of CSV in this library, and I think it may not be used outside the require statement in exporter/ot|p/lib/opentelemetry/exporter/ot|p/ exporter.rb line 10.

Could you try removing the require statement and see if the tests pass and the deprecation warning goes away?

@kaylareopelle we use the CSV library to parse configuration values from environment variables in at least the zipkin exporter:

when String then CSV.parse(headers, col_sep: '=', row_sep: ',').to_h

I could have sworn it was used in the OTLP Exporters but looks like it now uses custom parsing?

@romuloceccon romuloceccon force-pushed the csv-dependency-ruby-3.4 branch 3 times, most recently from a0e8f10 to cf67c06 Compare January 10, 2024 09:47
@romuloceccon
Copy link
Contributor Author

Thanks for the heads-up, @kaylareopelle and @arielvalentin! I have adjusted the commit accordingly, and also fixed otlp/http exporter.

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.

Thank you, @romuloceccon! This looks good to me. I think the job failures are due to an unrelated problem on main causing TruffleRuby installs to fail, that will hopefully be fixed with #1559 🤞

Loading exporter/otlp, exporter/otlp/http or exporter/zipkin on
ruby-3.3 now prints a warning:

    .../lib/opentelemetry/exporter/otlp/exporter.rb:10: warning: csv
    was loaded from the standard library, but will no longer be part
    of the default gems since Ruby 3.4.0. Add csv to your Gemfile or
    gemspec. Also contact author of opentelemetry-exporter-otlp-0.26.1
    to add csv into its gemspec.

exporter/otlp and exporter/otlp/http do not actually depend on csv,
though. Therefore this was fixed by removing the require statement.

exporter/zipkin, on the other hand, does depend on csv. So an explicit
dependency was added to the csv gem at version '~> 3.1' (ruby-3.0
bundles csv at 3.1.9).
@romuloceccon romuloceccon force-pushed the csv-dependency-ruby-3.4 branch from cf67c06 to 35b28d1 Compare January 11, 2024 19:51
@mwear mwear merged commit eb89cd6 into open-telemetry:main Jan 23, 2024
55 checks passed
This was referenced Jan 23, 2024
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