Aspnetcore: Consider tracing span id and trace id separately in the log

Created on 18 Apr 2019  路  4Comments  路  Source: dotnet/aspnetcore

accepted area-hosting enhancement feature

Most helpful comment

Verified in 3.0.0-preview7.19326.6

All 4 comments

We should use W3C trace context notions (OpenCensus names are the same) probably in CamelCase as other scopes.

To make it useful we need to log parent-id as well otherwise we lose causation in the logs. When an incoming request is received, it gets TraceId and ParentId in the headers. New SpanId is generated.
So I propose to log all three.

Also, assuming we keep Activity default behavior (which is Request-Id if there is no incoming w3c header), we have to map legacy format to these names.

  • TraceId is Activity.RootId
  • ParentId is Activity.ParentId
  • SpanId is Activity.Id // This seems to be very confusing.

Verifying this is blocked on #11404

image

Verified in 3.0.0-preview7.19326.6

Was this page helpful?
0 / 5 - 0 ratings