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

Option to capture Azure ServiceBus message payload

Open lenaschoenburg opened this issue 3 years ago • 1 comments

Is your feature request related to a problem? Please describe. The Azure ServiceBus transactions could be more helpful by capturing additional information such as message payload.

Describe the solution you'd like The Azure ServiceBus integration should have a configuration option to automatically capture the message payload, similar to how the HTTP integration can capture the request body.

Describe alternatives you've considered Don't support this and rely on custom transaction context. This would rely on https://github.com/elastic/apm-agent-dotnet/issues/1321 being fixed.

lenaschoenburg avatar Jun 02 '21 12:06 lenaschoenburg

Thanks for opening @oleschoenburg.

I agree that transactions would be more useful by capturing additional information.

The ServiceBus integration is achieved through a diagnostic listener. The diagnostic events written by Azure.Messaging.ServiceBus don't expose any details about a message, only the following properties

  • message_bus.destination – queue/topic/subscription path
  • peer.address – fully qualified namespace
  • kind – either producer, consumer, or client. Producer is used when sending messages, consumer when receiving, and client when settling.
  • component – servicebus
  • Entity - Name of the entity (queue, topic, and so on.)
  • Endpoint - Service Bus endpoint URL

It might be possible to expose additional information in diagnostic events through a ServiceBus plugin's BeforeMessageSendAsync() and AfterMessageReceiveAsync() methods, though this would require additional configuration on a user's part and require Elastic.Apm.Azure.ServiceBus to take a dependency on Azure.Messaging.ServiceBus.

russcam avatar Jun 03 '21 04:06 russcam