rebus-org / Rebus.AzureServiceBus

:bus: Azure Service Bus transport for Rebus
https://mookid.dk/category/rebus
Other
33 stars 20 forks source link

AppInsights - diagnostic-id missing #96

Closed Qball1337 closed 1 year ago

Qball1337 commented 1 year ago

AppInsights supports distributed logging out of the box. It uses a hook when a message is send to place a diagnostic-id header. At the receiving side it will auto fill in the current activity context based on this guid.

We switched from a custom service bus implementation to Rebus and noticed that our distributed logging is gone. Everything is still logged but not grouped by operatingId/parentId. The diagnostic-id is gone from our messages.

Does Rebus support this feature? Or do we have to manually set a tracking header?

Qball1337 commented 1 year ago

Header is now correctly set on the outgoing messages. Problem we see now: Activity.current is null when processing a message. All logs/exceptions that happen have no operation_id / parent_id

mookid8000 commented 1 year ago

You might want to read the wiki page about extending both the incoming and outgoing message pipelines to see how one can fairly easily extend Rebus to automatically flow activity information like you want it to.

Please let me know if you need any more guidance. 🙂