Skip to content

Commit

Permalink
fix: require csv for ruby-3.4 compatibility (#1560)
Browse files Browse the repository at this point in the history
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).

Co-authored-by: Matthew Wear <[email protected]>
  • Loading branch information
romuloceccon and mwear authored Jan 23, 2024
1 parent cff311c commit eb89cd6
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
require 'opentelemetry/exporter/otlp/common'
require 'opentelemetry/sdk'
require 'net/http'
require 'csv'
require 'zlib'

require 'google/rpc/status_pb'
Expand Down
1 change: 0 additions & 1 deletion exporter/otlp/lib/opentelemetry/exporter/otlp/exporter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
require 'opentelemetry/common'
require 'opentelemetry/sdk'
require 'net/http'
require 'csv'
require 'zlib'

require 'google/rpc/status_pb'
Expand Down
1 change: 1 addition & 0 deletions exporter/zipkin/opentelemetry-exporter-zipkin.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Gem::Specification.new do |spec|
spec.require_paths = ['lib']
spec.required_ruby_version = '>= 3.0'

spec.add_dependency 'csv', '~> 3.1'
spec.add_dependency 'opentelemetry-api', '~> 1.1'
spec.add_dependency 'opentelemetry-common', '~> 0.20'
spec.add_dependency 'opentelemetry-sdk', '~> 1.2'
Expand Down

0 comments on commit eb89cd6

Please sign in to comment.