Skip to content

Support restarting the trace with a different trace ID #1188

@yurishkuro

Description

@yurishkuro

What are you trying to achieve?

When SaaS products from cloud providers participate in the tracing, the providers are often reluctant to respect customer-supplied trace ID because it can be abused by the caller (e.g. sending the same trace ID for all requests). W3C trace context explicitly allows nodes in the call graph to restart a trace with a new trace ID, and return it to the caller via the response header (currently in the design phase). However, the current OTEL SDK spec states that the tracer must always respect & reuse the inbound trace ID.

OTEL SDK may support a configurable mechanism to restart a trace. The inbound SpanContext in this case can still be recorded as a Link to external trace.

Additional context.

Previous discussion here: #998 (comment)

Alternatives.

The behavior may also be implemented purely on the instrumentation side, e.g.

spanCtx := extract(request)
var span Span
if trusted(request) {
    span = tracer.StartSpan(parent=spanCtx)
} else {
    span = tracer.StartSpan(links=[spanCtx])
}

If OTEL Spec Committee decides not to support this directly in the SDKs, then the use case should be documented in some FAQ.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:sdkRelated to the SDKrelease:after-gaNot required before GA release, and not going to work on before GAspec:traceRelated to the specification/trace directory

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions