Skip to content

Commit

Permalink
Swap notification queue class in before_initialize hook
Browse files Browse the repository at this point in the history
The initializer approach was running into difficulties in anything other
than a very plain-vanilla rails app. This seems a little better.
  • Loading branch information
ahayworth committed Jul 13, 2021
1 parent 2c24e1c commit 967bbdc
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@ module Rails
# instrumentation, while this Railtie is used to conventionally instrument
# the Rails application through its initialization hooks.
class Railtie < ::Rails::Railtie
initializer 'opentelemetry.configure_notifications_queue', after: :load_active_support do
config.before_initialize do |app|
::ActiveSupport::Notifications.notifier = Fanout.new
end

config.before_initialize do |app|
OpenTelemetry::Instrumentation::ActiveRecord::Instrumentation.instance.install({})
OpenTelemetry::Instrumentation::Rack::Instrumentation.instance.install({})

Expand Down

0 comments on commit 967bbdc

Please sign in to comment.