Sha256: ca7e47a978f00a70f06f0ae5ea3b12153e52b86aefc41c238bd78c15ba116d2e

Contents?: true

Size: 1.22 KB

Versions: 8

Compression:

Stored size: 1.22 KB

Contents

# encoding: utf-8
# This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.

module NewRelic
  module Agent
    module Instrumentation
      module Rails4
        module Errors
          def newrelic_notice_error(exception, custom_params = {})
            filtered_params = (respond_to? :filter_parameters) ? filter_parameters(params) : params
            filtered_params.merge!(custom_params)
            NewRelic::Agent::Instrumentation::MetricFrame.notice_error( \
                exception, \
                :request => request, \
                :metric => newrelic_metric_path, \
                :custom_params => filtered_params)
          end
        end
      end
    end
  end
end

DependencyDetection.defer do
  @name = :rails4_error
  
  depends_on do
    defined?(::Rails) && ::Rails.respond_to?(:version) && ::Rails.version.to_i == 4
  end

  depends_on do
    defined?(ActionController) && defined?(ActionController::Base)
  end

  executes do
    ::NewRelic::Agent.logger.info 'Installing Rails4 Error instrumentation'
  end

  executes do
    class ActionController::Base
      include NewRelic::Agent::Instrumentation::Rails4::Errors
    end
  end
end

Version data entries

8 entries across 8 versions & 3 rubygems

Version Path
newrelic_rpm-3.6.0.83 lib/new_relic/agent/instrumentation/rails4/errors.rb
newrelic_rpm-3.6.0.78 lib/new_relic/agent/instrumentation/rails4/errors.rb
wd_newrelic_rpm-3.5.8 lib/new_relic/agent/instrumentation/rails4/errors.rb
sundawg_newrelic_rpm-3.5.8.2 lib/new_relic/agent/instrumentation/rails4/errors.rb
sundawg_newrelic_rpm-3.5.8.1 lib/new_relic/agent/instrumentation/rails4/errors.rb
newrelic_rpm-3.6.0.74.beta lib/new_relic/agent/instrumentation/rails4/errors.rb
newrelic_rpm-3.5.8.72 lib/new_relic/agent/instrumentation/rails4/errors.rb
newrelic_rpm-3.5.8.70 lib/new_relic/agent/instrumentation/rails4/errors.rb