Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

280
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda