newrelic/rpm — pull request #193 by flyerhzm (2014-10-20 07:52:01+00:00)
Title: do not wrap middleware proxy if target is a Proc

Grape will add an endpoint with Proc object, but on newrelic we always see Proc#call as transaction name

https://github.com/xinminlabs/newrelic-grape/issues/17

After digging rpm source code, I found it's MiddlewareProxy which adds Proc#call transaction to newrelic, but which is unnecessary.

I overridden MiddlewareProxy.needs_wrapping? method, https://github.com/xinminlabs/newrelic-grape/blob/master/lib/newrelic-grape/instrument.rb#L62, return false if target is a Proc object, if you could merge this pull request, then I can remove the monkey patch from newrelic-grape