Sha256: 7b4bf8d51519ee37db01b7bdf00d25c3bf73445f66c50b8df9153097cf1f7db7

Contents?: true

Size: 983 Bytes

Versions: 20

Compression:

Stored size: 983 Bytes

Contents

ActionController::Base.class_eval do
  
  # Make a note of an exception associated with the currently executing
  # controller action.  Note that this used to be available on Object
  # but we replaced that global method with NewRelic::Agent#notice_error.
  # Use that one outside of controller actions.
  def newrelic_notice_error(exception, custom_params = {})
    NewRelic::Agent::Instrumentation::MetricFrame.notice_error exception, :custom_params => custom_params, :request => request
  end
  
  def rescue_action_with_newrelic_trace(exception)
    rescue_action_without_newrelic_trace exception
    NewRelic::Agent::Instrumentation::MetricFrame.notice_error exception, :request => request 
  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

Version data entries

20 entries across 20 versions & 2 rubygems

Version Path
onyx_newrelic_rpm-2.12.5 lib/new_relic/agent/instrumentation/rails/errors.rb
newrelic_rpm-2.13.0.beta5 lib/new_relic/agent/instrumentation/rails/errors.rb
newrelic_rpm-2.13.0.beta4 lib/new_relic/agent/instrumentation/rails/errors.rb
newrelic_rpm-2.13.0.beta3 lib/new_relic/agent/instrumentation/rails/errors.rb
newrelic_rpm-2.12.3 lib/new_relic/agent/instrumentation/rails/errors.rb
newrelic_rpm-2.12.2 lib/new_relic/agent/instrumentation/rails/errors.rb
newrelic_rpm-2.12.2.beta2 lib/new_relic/agent/instrumentation/rails/errors.rb
newrelic_rpm-2.12.2.beta lib/new_relic/agent/instrumentation/rails/errors.rb
newrelic_rpm-2.12.1 lib/new_relic/agent/instrumentation/rails/errors.rb
newrelic_rpm-2.12.1.alpha lib/new_relic/agent/instrumentation/rails/errors.rb
newrelic_rpm-2.12.0 lib/new_relic/agent/instrumentation/rails/errors.rb
newrelic_rpm-2.11.3 lib/new_relic/agent/instrumentation/rails/errors.rb
newrelic_rpm-2.11.2 lib/new_relic/agent/instrumentation/rails/errors.rb
newrelic_rpm-2.11.2.beta2 lib/new_relic/agent/instrumentation/rails/errors.rb
newrelic_rpm-2.11.2.beta lib/new_relic/agent/instrumentation/rails/errors.rb
newrelic_rpm-2.11.1 lib/new_relic/agent/instrumentation/rails/errors.rb
newrelic_rpm-2.11.0.beta2 lib/new_relic/agent/instrumentation/rails/errors.rb
newrelic_rpm-2.11.0.beta lib/new_relic/agent/instrumentation/rails/errors.rb
newrelic_rpm-2.10.8 lib/new_relic/agent/instrumentation/rails/errors.rb
newrelic_rpm-2.10.6 lib/new_relic/agent/instrumentation/rails/errors.rb