Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

285
Views
What role does TraceIdentifer play with a W3C configured Activity (i.e Trace Context)

This question pertains to the Trace Context W3C recommendation that has been integrated into .NET, and the role that the HttpContext.TraceIdentifier property is destined to take in the future.

Is an Activity (using W3C) and HttpContext.TraceIdentifier mutually exclusive for logging and tracing purposes? Because they seem to overlap concerns fairly heavily.

By starting a new .NET API, are you best to just enable W3C and log the Trace / Span / Parent ids, rather than worrying about the trace identifier we've been using to date?

I understand that at:

  • there's a need for backwards compatibility and that the W3C spec is currently opt in.
  • not all APIs would need distributed tracing, making TraceIdentifier probably more appropriate. However in this case, the W3C approach would still serve your needs, and also have you ready to trace in a distributed fashion later on.

Here's a JSON formatted log entry that's logging both the TraceIdentifier (i.e RequestId) as well as the Activity properties SpanId, TraceId and ParentId for reference.

{
  "@t": "2021-08-13T17:00:10.7787030Z",
  "@mt": "HTTP {RequestMethod} {RequestPath} responded {StatusCode} in {Elapsed:0.0000} ms",
  "@r": [
    "0.6127"
  ],
  "UserId": "00000000-0000-0000-0000-000000000000",
  "RequestMethod": "GET",
  "RequestPath": "/",
  "StatusCode": 200,
  "Elapsed": 0.61267,
  "SourceContext": "Serilog.AspNetCore.RequestLoggingMiddleware",
  "SpanId": "332010586910af41",
  "TraceId": "c9d2356397fdd64998690c709acf9a51",
  "ParentId": "0000000000000000",
  "RequestId": "0HMAUFETQ32F5:00000005",
  "ConnectionId": "0HMAUFETQ32F5"
}
over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!