Sha256: fabe6b1378d0cd51e1ac8b9f67f053ef32ced481d83921dd4cf01f6affaadb80

Contents?: true

Size: 806 Bytes

Versions: 7

Compression:

Stored size: 806 Bytes

Contents

ActionController::Base.class_eval do
  
  def newrelic_notice_error(exception)
    filtered_params = (respond_to? :filter_parameters) ? filter_parameters(params) : params
    
    NewRelic::Agent.agent.error_collector.notice_error(exception, request, newrelic_metric_path, filtered_params)
  end
  
  def rescue_action_with_newrelic_trace(exception)
    newrelic_notice_error exception
    
    rescue_action_without_newrelic_trace exception
  end
  
  # Compare with #alias_method_chain, which is not available in 
  # Rails 1.1:
  alias_method :rescue_action_without_newrelic_trace, :rescue_action
  alias_method :rescue_action, :rescue_action_with_newrelic_trace
  protected :rescue_action

end if defined? ActionController

Object.send :include, NewRelic::Agent::Instrumentation::ErrorInstrumentation

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
newrelic_rpm-2.9.9 lib/new_relic/agent/instrumentation/rails/errors.rb
newrelic_rpm-2.9.8 lib/new_relic/agent/instrumentation/rails/errors.rb
newrelic_rpm-2.9.6 lib/new_relic/agent/instrumentation/rails/errors.rb
newrelic_rpm-2.9.5 lib/new_relic/agent/instrumentation/rails/errors.rb
newrelic_rpm-2.9.2 lib/new_relic/agent/instrumentation/rails/errors.rb
newrelic_rpm-2.9.3 lib/new_relic/agent/instrumentation/rails/errors.rb
newrelic_rpm-2.9.4 lib/new_relic/agent/instrumentation/rails/errors.rb