From 21eee2cc0a6a7ac4931fad605fef238707df3198 Mon Sep 17 00:00:00 2001 From: Ariel Valentin Date: Wed, 8 Jan 2025 15:47:24 -0600 Subject: [PATCH 1/2] fix: Add Concurrent Ruby dependency to Rails Rails relies on concurrent ruby for features like async queries. This results in inconsistent traces since context is not properly propagated between threads. This change adds Concurrent Ruby as a transitive dependency to mitigate confusion when uses the rails instrumentation independent of the all gem. --- instrumentation/rails/lib/opentelemetry/instrumentation/rails.rb | 1 + .../rails/opentelemetry-instrumentation-rails.gemspec | 1 + 2 files changed, 2 insertions(+) diff --git a/instrumentation/rails/lib/opentelemetry/instrumentation/rails.rb b/instrumentation/rails/lib/opentelemetry/instrumentation/rails.rb index 267cae1dd..2893aba0c 100644 --- a/instrumentation/rails/lib/opentelemetry/instrumentation/rails.rb +++ b/instrumentation/rails/lib/opentelemetry/instrumentation/rails.rb @@ -21,5 +21,6 @@ module Rails require 'opentelemetry-instrumentation-action_mailer' require 'opentelemetry-instrumentation-active_record' require 'opentelemetry-instrumentation-active_job' +require 'opentelemetry-instrumentation-concurrent_ruby' require_relative 'rails/instrumentation' require_relative 'rails/version' diff --git a/instrumentation/rails/opentelemetry-instrumentation-rails.gemspec b/instrumentation/rails/opentelemetry-instrumentation-rails.gemspec index 874f474e9..f7ec58542 100644 --- a/instrumentation/rails/opentelemetry-instrumentation-rails.gemspec +++ b/instrumentation/rails/opentelemetry-instrumentation-rails.gemspec @@ -33,6 +33,7 @@ Gem::Specification.new do |spec| spec.add_dependency 'opentelemetry-instrumentation-active_record', '~> 0.8.0' spec.add_dependency 'opentelemetry-instrumentation-active_support', '~> 0.7.0' spec.add_dependency 'opentelemetry-instrumentation-base', '~> 0.22.1' + spec.add_dependency 'opentelemetry-instrumentation-concurrent_ruby', '~> 0.24.4' spec.add_development_dependency 'appraisal', '~> 2.5' spec.add_development_dependency 'bundler', '~> 2.4' From 0846593f1b537b3a59b86e057b3fcf8863bdf53d Mon Sep 17 00:00:00 2001 From: Ariel Valentin Date: Wed, 8 Jan 2025 15:51:11 -0600 Subject: [PATCH 2/2] squash: typo --- .../rails/opentelemetry-instrumentation-rails.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instrumentation/rails/opentelemetry-instrumentation-rails.gemspec b/instrumentation/rails/opentelemetry-instrumentation-rails.gemspec index f7ec58542..796704333 100644 --- a/instrumentation/rails/opentelemetry-instrumentation-rails.gemspec +++ b/instrumentation/rails/opentelemetry-instrumentation-rails.gemspec @@ -33,7 +33,7 @@ Gem::Specification.new do |spec| spec.add_dependency 'opentelemetry-instrumentation-active_record', '~> 0.8.0' spec.add_dependency 'opentelemetry-instrumentation-active_support', '~> 0.7.0' spec.add_dependency 'opentelemetry-instrumentation-base', '~> 0.22.1' - spec.add_dependency 'opentelemetry-instrumentation-concurrent_ruby', '~> 0.24.4' + spec.add_dependency 'opentelemetry-instrumentation-concurrent_ruby', '~> 0.21.4' spec.add_development_dependency 'appraisal', '~> 2.5' spec.add_development_dependency 'bundler', '~> 2.4'