Sha256: c4960dbab0401357b2060a80e7f511148e5015ab383b2ae4a1ec3fab937f7ae4

Contents?: true

Size: 847 Bytes

Versions: 61

Compression:

Stored size: 847 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.debug '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

61 entries across 61 versions & 4 rubygems

Version Path
newrelic_rpm-3.5.4.35.beta lib/new_relic/agent/instrumentation/merb/errors.rb
newrelic_rpm-3.5.4.34 lib/new_relic/agent/instrumentation/merb/errors.rb
newrelic_rpm-3.5.4.33 lib/new_relic/agent/instrumentation/merb/errors.rb
newrelic_rpm-3.5.4.31.beta lib/new_relic/agent/instrumentation/merb/errors.rb
newrelic_rpm-3.5.4.29.beta lib/new_relic/agent/instrumentation/merb/errors.rb
ghazel-newrelic_rpm-3.5.4 lib/new_relic/agent/instrumentation/merb/errors.rb
newrelic_rpm-3.5.3.25 lib/new_relic/agent/instrumentation/merb/errors.rb
newrelic_rpm-3.5.3.24 lib/new_relic/agent/instrumentation/merb/errors.rb
newrelic_rpm-3.5.2.17 lib/new_relic/agent/instrumentation/merb/errors.rb
newrelic_rpm-3.5.1.14 lib/new_relic/agent/instrumentation/merb/errors.rb
newrelic_rpm-3.5.1.14.beta lib/new_relic/agent/instrumentation/merb/errors.rb
newrelic_rpm-3.5.1.beta1 lib/new_relic/agent/instrumentation/merb/errors.rb
newrelic_rpm-3.5.0.1 lib/new_relic/agent/instrumentation/merb/errors.rb
newrelic_rpm-3.5.1.alpha lib/new_relic/agent/instrumentation/merb/errors.rb
newrelic_rpm-3.5.0 lib/new_relic/agent/instrumentation/merb/errors.rb
newrelic_rpm-3.4.2.1 lib/new_relic/agent/instrumentation/merb/errors.rb
newrelic_rpm-3.4.2 lib/new_relic/agent/instrumentation/merb/errors.rb
newrelic_rpm-3.4.2.beta1 lib/new_relic/agent/instrumentation/merb/errors.rb
newrelic_rpm-3.4.1 lib/new_relic/agent/instrumentation/merb/errors.rb
newrelic_rpm-3.4.1.beta1 lib/new_relic/agent/instrumentation/merb/errors.rb