class Airbrake::Rails::Railties::ActionControllerTie
Ties Airbrake
APM (routes) and HTTP
clients with Rails
.
@api private @since v13.0.1
Public Class Methods
new()
click to toggle source
# File lib/airbrake/rails/railties/action_controller_tie.rb, line 16 def initialize @route_subscriber = Airbrake::Rails::ActionControllerRouteSubscriber.new @notify_subscriber = Airbrake::Rails::ActionControllerNotifySubscriber.new @performance_breakdown_subscriber = Airbrake::Rails::ActionControllerPerformanceBreakdownSubscriber.new end
Public Instance Methods
call()
click to toggle source
# File lib/airbrake/rails/railties/action_controller_tie.rb, line 23 def call ActiveSupport.on_load(:action_controller, run_once: true, yield: self) do # Patches ActionController with methods that allow us to retrieve # interesting request data. Appends that information to notices. ::ActionController::Base.include(Airbrake::Rails::ActionController) tie_routes_apm tie_http_integrations end end
Private Instance Methods
tie_curl()
click to toggle source
# File lib/airbrake/rails/railties/action_controller_tie.rb, line 64 def tie_curl require 'airbrake/rails/curb' if defined?(Curl) && defined?(Curl::CURB_VERSION) end
tie_excon()
click to toggle source
# File lib/airbrake/rails/railties/action_controller_tie.rb, line 80 def tie_excon return unless defined?(Excon) require 'airbrake/rails/excon_subscriber' ActiveSupport::Notifications.subscribe(/excon/, Airbrake::Rails::Excon.new) ::Excon.defaults[:instrumentor] = ActiveSupport::Notifications end
tie_http()
click to toggle source
# File lib/airbrake/rails/railties/action_controller_tie.rb, line 68 def tie_http require 'airbrake/rails/http' if defined?(HTTP) && defined?(HTTP::Client) end
tie_http_client()
click to toggle source
# File lib/airbrake/rails/railties/action_controller_tie.rb, line 72 def tie_http_client require 'airbrake/rails/http_client' if defined?(HTTPClient) end
tie_http_integrations()
click to toggle source
# File lib/airbrake/rails/railties/action_controller_tie.rb, line 51 def tie_http_integrations tie_net_http tie_curl tie_http tie_http_client tie_typhoeus tie_excon end
tie_net_http()
click to toggle source
# File lib/airbrake/rails/railties/action_controller_tie.rb, line 60 def tie_net_http require 'airbrake/rails/net_http' if defined?(Net) && defined?(Net::HTTP) end
tie_routes_apm()
click to toggle source
# File lib/airbrake/rails/railties/action_controller_tie.rb, line 36 def tie_routes_apm [ # Cache route information for the duration of the request. ['start_processing.action_controller', @route_subscriber], # Send route stats. ['process_action.action_controller', @notify_subscriber], # Send performance breakdown: where a request spends its time. ['process_action.action_controller', @performance_breakdown_subscriber], ].each do |(event, callback)| ActiveSupport::Notifications.subscribe(event, callback) end end
tie_typhoeus()
click to toggle source
# File lib/airbrake/rails/railties/action_controller_tie.rb, line 76 def tie_typhoeus require 'airbrake/rails/typhoeus' if defined?(Typhoeus) end