From bb699be8a482726ecd95701745b696c63c173f36 Mon Sep 17 00:00:00 2001 From: Katherine Oelsner <49968061+octokatherine@users.noreply.github.com> Date: Sun, 29 Oct 2023 17:37:17 +0000 Subject: [PATCH] check for synchronize method instead of Rails version --- .../instrumentation/active_support/span_subscriber.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instrumentation/active_support/lib/opentelemetry/instrumentation/active_support/span_subscriber.rb b/instrumentation/active_support/lib/opentelemetry/instrumentation/active_support/span_subscriber.rb index c2a376ba3..5fd8c5cc2 100644 --- a/instrumentation/active_support/lib/opentelemetry/instrumentation/active_support/span_subscriber.rb +++ b/instrumentation/active_support/lib/opentelemetry/instrumentation/active_support/span_subscriber.rb @@ -30,7 +30,7 @@ def self.subscribe( subscriber_object = ::ActiveSupport::Notifications.subscribe(pattern, subscriber) - if Gem::Version.new(::Rails.version) < Gem::Version.new('7.2') + if ::ActiveSupport::Notifications.notifier.respond_to?(:synchronize) ::ActiveSupport::Notifications.notifier.synchronize do subscribers = ::ActiveSupport::Notifications.notifier.instance_variable_get(:@string_subscribers)[pattern]