Skip to content

Id format changes in W3C mode #1174

@lmolkova

Description

@lmolkova

In W3C mode we report parentId and Id in the format of |traceId.parentSpanId. and |traceId.spanId. respectively.

This is not needed anymore even for backward compatibility reasons. Compatibility with old versions of Application Insights SDK is handled by ingestion.

Describe the solution you would like

When SDK receives a valid incoming request with

  1. traceparent = 00-traceId-parentId-00, it should track request telemetry
  • request.Context.Operation.Id = traceId // no changes
  • request.Context.Operation.ParentId = parentId // new, was |traceId.parentId.
  • request.Id = new span Id // new, was |traceId.spanId.
  1. no header, it should track request telemetry
  • request.Context.Operation.Id = new traceId // no changes
  • request.Context.Operation.ParentId = null // no changes
  • request.Id = new span Id// new, was |traceId.spanId.
  1. legacy Request-Id header, it should track request telemetry
  • request.Context.Operation.Id = if request-id root part is compatible with trace-id, reuse it, otherwise generate a new one
  • request.Context.Operation.ParentId = headers[Request-Id] // no changes
  • request.Id = new span Id // new, was |traceId.spanId.
  • properties["ai_LegacyRootId"] = if request-id root part is NOT compatible with trace-id, put it here, otherwise keep empty // no changes

Similarly for dependencies

  • dependency.Context.Operation.Id = traceId,
  • dependency.Context.Operation.ParentId = parent span id, // new, was |trace.parent.
  • dependency.Id = new span id, // new, was |trace.span.

When sending Request-Id in outgoing requests it still MUST be formatted in the |TraceId.SpanId. format!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions