5 Answers
5

Oooh, great question and one I hadn't thought about yet myself. I think what you would have to do is write a custom module, since modules execute before all handlers, that detect that the SignalR AspNetHandler handler is the one being requested and, if so, call the NewRelic IgnoreXXX methods at that point.

UPDATE: 6/25/2013

As warned by @dfowler in the comments, SignalR has since changed its approach to hosting and instead now relies on Owin based hosting instead. This is great because it decouples SignalR directly from ASP.NET/IIS, but that means the above approach obviously won't work anymore. Instead what you would need to do is to make sure to configure the Owin pipeline with a module like the sample one below (available here in a gist as well) to disable tracing for the pipeline:

Finally, it should be noted that, right now this takes a very simplistic approach that assumes you're not going to have any other Owin requests in your application scope. If you're mixing SignalR into another web app that has other Owin requests this particular module implementation would cause those to be ignored as well, so a more advanced module that maybe checks that the incoming request is actually targeting a SignalR URL would be required. For now, I leave that up to the reader to figure out.

Yeah I was thinking about that this morning, I'll remove the IgnoreApdex call from the sample.
–
Drew MarshNov 22 '12 at 21:15

It worked perfectly. I just had some trouble getting the HttpModule to run on my development server via web.config, so I added a PreStart event using WebActivator to explicitly load it.
–
pateNov 22 '12 at 23:48

It is possible to ignore a transaction via custom instrumentation as well using the IgnoreTransactionTracerFactory. This is particularly useful when you don't want to add the API to your project or when you want to ignore transactions based on a Framework method that you cannot change.

If you can find a SignalR framework method that is always called on the request thread (you can only call IgnoreTransaction on the request thread, not on an async thread) you can fill out the assemblyName/className/methodName in the above and it would be the same as calling IgnoreTransaction API inside that method.