Description
openedon Dec 4, 2019
I'm doing some Serilog integration currently in ASP.NET Core 3, where it would be really nice to be able to access the current operation_id and operation_ParentId, to ship that off along with the traces sent to Application Insights. Particularly in a situation where we use telemetryClient.StartOperation<RequestTelemetry>()
An earlier issue , suggested System.Diagnostics.Activity.Current?.RootId - but that's not accurate anymore. Looking through the codebase it seems like the
operation_Id is equivalent to Activity.TraceId
and the operation_ParentId is constructed via $"|{activity.TraceId}.{activity.Parent.SpanId}."
inside W3CUtilities.FormatTelemetryId
Is this:
a) Correct?
b) Guaranteed to be stable, if I end up creating this logic into my logging integration
c) Or it is perhaps possible to expose the functionality for getting these ID's, so we don't have to go through all of these hoops