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

Azure ServiceBus instrumentation causing recursion errors.

Open sluebbert opened this issue 11 months ago • 0 comments

APM Agent version

1.26.0 and earlier versions.

Environment

Operating system and version: Windows 11 and Linux

.NET Framework/Core name and version (e.g. .NET 4.6.2, NET Core 3.1.100) : .net 8.0

Application Target Framework(s) (e.g. net462, netcoreapp3.1): net8.0

Describe the bug

The Azure ServiceBus instrumentation appears to be causing recursion issues in Kibana when displaying spans for a sent message.

The closest related issue I could find for this was https://github.com/elastic/kibana/issues/167505 which lead me to dig into the span parent IDs. We have many other instrumented services, most not sending Azure ServiceBus messages which do not encounter this issue. The few services that do send to the ServiceBus, do have this UI error in Kibana.

To Reproduce

Steps to reproduce the behavior:

  1. Add a reference to the Azure.Messaging.ServiceBus Nuget package. We are using 7.17.2.
  2. Create a ServiceBusClient and use that to create a ServiceBusSender for a topic.
  3. Within a transaction, use the ServiceBusSender to send a ServiceBusMessage with SendMessageAsync().
  4. See recursion errors in Kibana APM transaction view when viewing the transaction. image
  5. See spans referencing themselves as the parent in Discover view. image

Expected behavior

To be able to see the transaction in Kibana without recursion errors.

Actual behavior

Recursion errors.

sluebbert avatar Mar 21 '24 20:03 sluebbert