Sha256: bf60cd73268d350dadd5b050835dd118b228de5cf66fe5380142fd328b978165

Contents?: true

Size: 848 Bytes

Versions: 19

Compression:

Stored size: 848 Bytes

Contents

DependencyDetection.defer do
  @name = :merb_error

  depends_on do
    defined?(Merb) && defined?(Merb::Dispatcher) && defined?(Merb::Dispatcher::DefaultException)
  end

  depends_on do
    Merb::Dispatcher::DefaultException.respond_to?(:before)
  end
  
  executes do
    ::NewRelic::Agent.logger.info 'Installing Merb Errors instrumentation'
  end
  
  executes do

    # Hook in the notification to merb
    error_notifier = Proc.new {
      if request.exceptions #check that there's actually an exception
        # Note, this assumes we have already captured the other information such as uri and params in the MetricFrame.
        NewRelic::Agent::Instrumentation::MetricFrame.notice_error(request.exceptions.first)
      end
    }
    Merb::Dispatcher::DefaultException.before error_notifier
    Exceptions.before error_notifier

  end
end

Version data entries

19 entries across 19 versions & 3 rubygems

Version Path
wd_newrelic_rpm-3.5.8 lib/new_relic/agent/instrumentation/merb/errors.rb
sundawg_newrelic_rpm-3.5.8.2 lib/new_relic/agent/instrumentation/merb/errors.rb
sundawg_newrelic_rpm-3.5.8.1 lib/new_relic/agent/instrumentation/merb/errors.rb
newrelic_rpm-3.5.8.72 lib/new_relic/agent/instrumentation/merb/errors.rb
newrelic_rpm-3.5.8.70 lib/new_relic/agent/instrumentation/merb/errors.rb
newrelic_rpm-3.5.8.64.beta lib/new_relic/agent/instrumentation/merb/errors.rb
newrelic_rpm-3.5.7.59 lib/new_relic/agent/instrumentation/merb/errors.rb
newrelic_rpm-3.5.7.59.beta lib/new_relic/agent/instrumentation/merb/errors.rb
newrelic_rpm-3.5.7.58.beta lib/new_relic/agent/instrumentation/merb/errors.rb
wd_newrelic_rpm-3.5.6 lib/new_relic/agent/instrumentation/merb/errors.rb
newrelic_rpm-3.5.7.57.beta lib/new_relic/agent/instrumentation/merb/errors.rb
newrelic_rpm-3.5.6.55 lib/new_relic/agent/instrumentation/merb/errors.rb
newrelic_rpm-3.5.6.48.beta lib/new_relic/agent/instrumentation/merb/errors.rb
newrelic_rpm-3.5.6.46.beta lib/new_relic/agent/instrumentation/merb/errors.rb
newrelic_rpm-3.5.6.42.beta lib/new_relic/agent/instrumentation/merb/errors.rb
newrelic_rpm-3.5.5.39.beta lib/new_relic/agent/instrumentation/merb/errors.rb
wd_newrelic_rpm-3.5.5 lib/new_relic/agent/instrumentation/merb/errors.rb
newrelic_rpm-3.5.5.38 lib/new_relic/agent/instrumentation/merb/errors.rb
newrelic_rpm-3.5.5.540.dev lib/new_relic/agent/instrumentation/merb/errors.rb