No transactions from NServicebus6 hosts

Please paste the permalink to the page in question below:

https://rpm.newrelic.com/accounts/519899/applications/38011683?tw[end]=1480701328&tw[start]=1480442128

Please share your agent version and other relevant versions below:

New Relic agent 3.3.6.0

Please share your question/describe your issue below. Include any screenshots that may help us understand your question:

We have multiple IIS sites and Windows Services running on these servers. Instrumentation is running fine on the IIS sites, and it is obvious that it is also monitoring the Windows Services in question, but I’m not seeing individual transactions.

We’ve been using New Relic to instrument NServiceBus 5 hosts for some time, but these new services are running NServiceBus 6. We can see database queries from the hosts listed, and we can see other minor details like service maps. We just aren’t getting the Non-Web transactions listed like we had with our older hosts.

Hi @Jake_Stevenson,

This sounds like a classic case of custom instrumentation.

The agent does not have any built-in instrumentation for non-IIS application transactions, but it does have instrumentation for external and database calls. This is why you can see the external/database calls but are not seeing transactions.

This forum post should have all of the info you need to get some custom instrumentation set up for these new services and start seeing transactions in APM.

Of course, let me know if you have any questions. I’m happy to help.

Cheers!

Thank you, I will explore adding custom instrumentation, though I don’t think we had to do this for our NServicebus5 hosts.

So far I’m having no luck with this. I appear to be missing some critical piece.

I’ve gone as far as creating a simple console application using the “Example Application” code found on https://docs.newrelic.com/docs/agents/net-agent/instrumentation/net-custom-transactions. After running the application I see it listed in New Relic, but I don’t see the “StartTransaction” or “Dummy” transactions being instrumented.

I had named the project, root namespace, and assembly “TestNewRelic”. I compiled it and ran it. Here is my custom instrumentation file (TestCustom.xml in C:\ProgramData\New Relic.NET Agent\Extensions):

 <?xml version="1.0" encoding="utf-8"?>
<extension xmlns="urn:newrelic-extension">
    <instrumentation>
        <!-- Define the method which triggers the creation of a transaction. -->
        <tracerFactory name="NewRelic.Agent.Core.Tracer.Factories.BackgroundThreadTracerFactory" metricName="Background/CustomTransaction">
          <match assemblyName="TestNewRelic" className="TestNewRelic.CustomTransaction">
            <exactMethodMatcher methodName="StartTransaction" />
          </match>
        </tracerFactory>
        <!-- Instrument 0 or more methods called by the trigger method. These methods appear in the transaction breakdown table and in transaction traces. -->
        <tracerFactory>
          <match assemblyName="TestNewRelic" className="TestNewRelic.CustomTransaction">
            <exactMethodMatcher methodName="Dummy" />
          </match>
        </tracerFactory>
    </instrumentation>
</extension>

What could I be missing?

Found my issue with the sample – a bad xml file elsewhere in the extensions folder.

Now the real challenge is figuring out what methods to instrument and trace.

Hi @Jake_Stevenson,

Being unfamiliar with the structure of your application, I can’t tell you which methods to instrument specifically, but I can give you some guidelines on what may be helpful.

  1. Make sure that any method you choose to instrument returns a value, error, or otherwise completes. A transaction is defined as the code path from the time an instrumented method is called until it ends, so instrumenting “non-ending” methods like Main() or Run() will not produce transactions because they do not end while the application is “alive”.

  2. Considering #1 above, you may want to chose the highest level method you can (perhaps something that Main() calls directly) to instrument, and then add additional instrumentation to subsequent methods in the chain to add detail to the originating transaction.

This may be a trial-and-error type situation to get the exact results you want, but the instrumentation can usually be changed and tweaked to get visibility you need.

Let us know if you have any questions. We’re happy to help.

Thanks,

Don

This discussion can be closed, I’ve moved my findings to the discussion requesting a new plugin found Feature Idea: Add Support for NServiceBus Version 6

There is currently a plugin distributed with the .NET agent that is able to interpret the actual messages coming in from NServiceBus and give them special transaction names. NServiceBus6 has changed a lot and the existing plugin no longer works.

I’ve written my own plugin for now.

2 Likes

Awesome, @Jake.Stevenson! Thank you so much for following up with us. I am sure it took a lot of time and effort to create a plugin that meets your NServiceBus6 needs. Glad you have a workaround now!

I wanted you to know that I have added a voting mechanism to the related thread that you liked to above:

I also have passed on all the input you have shared between these two threads so that our product team is well aware of your needs. Please be sure to cast your vote for NServiceBus6 support in the official feature-idea thread. :arrow_up:

Thanks so very much! Please let us know if you need anything else!