Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

282
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda