Intelligent New Relic Transaction Naming with Lift

Posted by Matt Farmer on April 13, 2013 · 1 min read

So, I was going to wait until the artifact showed up in Maven Central, but I’ve got other things to do today in this beautiful weather that are decidedly better than staying indoors and waiting on Sonatype to finish publishing my artifact.

Today I released an add-on for Lift projects that want to use NewRelic for monitoring: lift-newrelic. The purpose of this little add-on is really simple, you drop it in your Lift project and it automatically sets the name of the transaction in NewRelic based on the URL that the SiteMap Menu entry that matches the current request.

Why do we need this?

The default behavior in NewRelic is to use the name of the filter that’s used to serve the request. In Lift apps, there exists one filter, /LiftFilter, so the result is that you get all of your transactions filed under /LiftFilter in your NewRelic Web Transactions list – totally useless for helping to identify hotspots in your production code.

With this add-on, your SiteMapped entries are named intelligently. Normal Menu entries just contain their URL. So, the forgot password page for AnchorTab shows up as “/amnesia” on our NewRelic account. However, it’s also smart enough to handle parameterized types. So, an edit mage might look something like “/tabs/star/edit” in NewRelic.

RestHelper currently isn’t supported, but I’d be interested in accepting a patch from anyone who may have an idea around how to do that. ? So, now that you know about it, go check out the GitHub project and use it! It should be on Sonatype shortly, too. ?

Cheers!