Description
Is your feature request related to a problem? Please describe.
It is currently not possible to override (or suppress) creation of a new System.Diagnostics.Activity
since it happens as a part of hosting.
Describe the solution you'd like
We should move Activity creation from hosting into a new middleware
Additional context
Customer quote:
Our service is in the middle of a bunch of other services which all use a Http header,
x-ms-correlation-id
with the value being a Guid formatted with dashes, to pass correlation for aligning traces and logs. I want to just reuse their Id without my developers having to even care, but if I let ASP.NET do its magic, there is no incoming traceparent header so a new activity is created from scratch (not calling SetParentId beforehand). This means and I have to do a bunch of gymnastics to grabx-ms-correlation-id
and attach it as baggage and ensure I log it as well with everything (so now I have 2 “traceids”). I just want to be able to reuse an incoming traceid/guid and let Activity do all the hard work propagating and adding to logs.