Welcome on the forum @rajivharris
Well, it seems you run into a bug. The issue was that an old version of System.Diagnostics.DiagnosticSource
was loaded and because of that the agent was not able to capture the outgoing HTTP calls - therefore it did not connect the different web apps into the same trace. We change a couple of things on this recently which'll be released with the next release. I'll see if that'd prevent something like this later.
Nevertheless by setting some redirects you can make this work. I opened a PR against your sample that shows how to make it work. I know this is not that nice, again, hopefully we can get rid of the need for the redirect in the next release.
Also, one nit to what you say:
Each application trace is captured as a separate one. Expected root span to show child spans in transaction.
I'm not sure there is a misunderstanding here, but just to make sure we are on the same page: what'll happen here is that you'll still have 4 transactions (for the 4 web apps) - in WebApplication1
and WebApplication2
the transaction will have a child span which is the outgoing HTTP request and all 4 transactions will form together a trace. So the way these apps are connected is that they are part of the same trace. More on this here.