New NServiceBus NewRelic Roslyn Analyzer for monitoring message handlers

Hey Everyone,

I have just published a new roslyn analyzer that can help remove the pain of attempting to monitor your NServiceBus Endpoints related message handlers in newrelic.

This was created because the .NET NewRelic agent automatically instruments certain application frameworks ( as indicated ). NServiceBus was one of these. Unfortunately, when NServiceBus rewrote their whole message handling pipeline to ensure async/await was a first class citizen, this broken the automatic instrumentation that the newrelic engineers wrote. This means, when upgrading from NServiceBus to V6+ NewRelic will no longer create transactions for you and you will be flying blind.

This Analyzer provides a “reasonable” workaround by automatically giving you a compiler error ( and appropriate codefix ) when you are missing a newrelic [Transaction] attribute around any nservicebus related message handler ( sagas and timeouts included ). Until the newrelic fixes/implements this feature ( NewRelic Feature Request: ) this is the best alternative available.

If anyone is currently using newrelic to monitor their nservicebus endpoints i would love to hear some feedback on this new analyzer along with how others have been dealing with this issue.


1 Like