newrelic-dotnet-agent icon indicating copy to clipboard operation
newrelic-dotnet-agent copied to clipboard

NServiceBus v6 + v7 Endpoint First sender/publishing endpoint missing from distributed trace

Open TraGicCode opened this issue 3 years ago • 5 comments

Hello,

Thank you so much for adding NServiceBus v6/v7 support to the newrelic .net agent finally!

One thing that appears to be missing is the very first endpoint to send/publish a message to start a whole distributed trace is not being included. IS there a way for this to be fixed?

CC: @jaffinito @JcolemanNR

TraGicCode avatar Jan 28 '22 02:01 TraGicCode

@TraGicCode Thanks for bringing this to our attention. We will try to take a look in the next few days.

nr-ahemsath avatar Jan 28 '22 16:01 nr-ahemsath

@TraGicCode I did a quick test, using the "Full Duplex" NServiceBus sample/demo from here: https://docs.particular.net/samples/fullduplex/ (I downloaded the .NET 6 version).

I realized that in order for this sample demo to be properly instrumented by the agent, I would need to modify it slightly to add [Transaction] attribute-based custom instrumentation in order to make sure that the sending and receiving of messages would happen inside of our instrumentation transactions. (I suspect that this might be what is causing you to not see the data you're expecting. Specifically, our instrumentation of message send/publish will not create a transaction if one doesn't already exist.) Attached please find my modified sample solution: NSBSample.zip

I set the environment variables necessary to profile the Client and Server processes with the agent (a local dev build, but should be functionally equivalent to release 9.4.0), sent perhaps about a dozen messages from the client to the server, and looked for the traces to show up in APM, and it looks like the client is being included in the traces as we expect: Screenshot 2022-01-28 094208

Can I ask you to try instrumenting my modified sample/demo solution in your environment and see if you get the traces you expect?

nr-ahemsath avatar Jan 28 '22 17:01 nr-ahemsath

Hey @nr-ahemsath ,

My main ask here is that is it possible to automatically create a transaction if one doesn’t exist on send or publish to capture the sender in the distributed trace?

TraGicCode avatar Jan 29 '22 02:01 TraGicCode

@TraGicCode Thanks for clarifying. That would be a feature request and so I will bring this to our PM's attention.

nr-ahemsath avatar Jan 31 '22 19:01 nr-ahemsath

https://issues.newrelic.com/browse/NEWRELIC-3645

This issue won't be actioned.