.NET Client & OpenTelemetry Tracing

113 views
Skip to first unread message

Marquise Daniel

unread,
Sep 15, 2022, 9:05:28 AM9/15/22
to rabbitmq-users
Hello,

I am trying to use OpenTelemetry for tracing by creating an instrumentation library for RabbitMQ. I am running into an issue though. What we are trying to do is create an event listener, that listens to events from RabbitMQ, once it sees the publish event from the RabbitMQ dotnet client, it should create the activity for tracing.

The issue seems to be that there is no event source being fired when a message is published or consumed. I can see that the RabbitMQ client uses EventSources:

https://github.com/rabbitmq/rabbitmq-dotnet-client/blob/6b1a06bd429f395891a3230cad92e674dcbbb0d2/projects/RabbitMQ.Client/client/logging/RabbitMqClientEventSource.cs

But it looks like this event source is only fired when the client has to log. 

Is there any event source we can listen to from the RabbitMQ client that will trigger when a message is published?

If there is no event for us to listen to, what would be the best way to trigger an action while a message is being published, Where we would have access to the message body and headers? It seems like we should be able to add event handlers to achieve this, but I am not sure if this is the best way.

Thanks
Reply all
Reply to author
Forward
0 new messages