Azure / durabletask

Durable Task Framework allows users to write long running persistent workflows in C# using the async/await capabilities.
Apache License 2.0
1.51k stars 290 forks source link

Distributed tracing and ServiceBus queues correlation #624

Open cyrilcathala opened 2 years ago

cyrilcathala commented 2 years ago

Context

I have a microservice A calling a microservice B which is durable function / orchestrator. At the end of the orchestration, microservice B enqueues a message to a ServiceBus topic. Microservice A is subscribed to this topic and waits for a callback through this topic.

Put simply: Microservice A ---[http]---> Microservice B (Orchestrator) ----[topic]---> Microservice A

Telemetry

I configured telemetry to use Application Insights and distributed tracing for the orchestration. The request telemetry starts with microservice A, it follows with microservice B and distributed tracing works well within microservice B (great work on this part 🤗).

Unfortunately, the trace finishes when enqueuing the topic message. After that, it creates a new request that is not correlated with previous orchestration.

Question

Is it a known behavior? Am I missing something? Is there any plan on this part?

cgillum commented 2 years ago

@cyrilcathala can you elaborate a bit more on this part?

Unfortunately, the trace finishes when enqueuing the topic message. After that, it creates a new request that is not correlated with previous orchestration

What do you mean when you say it "finishes"? Where are you seeing the new request that isn't correlated with the previous orchestration? I'm trying to understand if the problem is somewhere in DTFx or if it's in the Service Bus client SDK that publishes the message to the topic.