diff --git a/instrumentation/active_job/lib/opentelemetry/instrumentation/active_job/subscriber.rb b/instrumentation/active_job/lib/opentelemetry/instrumentation/active_job/subscriber.rb index beb5f62ea..979a564e0 100644 --- a/instrumentation/active_job/lib/opentelemetry/instrumentation/active_job/subscriber.rb +++ b/instrumentation/active_job/lib/opentelemetry/instrumentation/active_job/subscriber.rb @@ -171,8 +171,9 @@ def self.install tracer = Instrumentation.instance.tracer mapper = AttributeMapper.new default_handler = DefaultHandler.new(tracer, mapper) - @subscriptions ||= [] - @subscriptions << ActiveSupport::Notifications.subscribe('discard.active_job', default_handler) + @subscriptions = %w[discard.active_job].map do |key| + ActiveSupport::Notifications.subscribe(key, default_handler) + end end def self.uninstall