SpanContext and Link spec/proto are not clear #1667
Labels
area:span-relationships
Related to span relationships
spec:protocol
Related to the specification/protocol directory
spec:trace
Related to the specification/trace directory
From
SpanContext
spec https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#spancontext:SpanContext contains
traceId
,spanId
,TraceFlags
, andTraceState
.From
Link
specification https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#specifying-links:A
Link
contains aSpanContext
and zero or moreAttributes
.From proto definition of
Link
https://github.com/open-telemetry/opentelemetry-proto/blob/a17f202fdae65e828ac29fb663b5bc5b64b13290/opentelemetry/proto/trace/v1/trace.proto#L197:Link
containstrace_id
,span_id
, andtrace_state
, but does not containTraceFlags
.Thus, if a user wants to create a
Link
they must first create or get aSpanContext
which has a validTraceFlags
.TraceFlags
are not included in theLink
proto so it might be confusing to the user to have to specify flags for the link which have no effect.I would suggest that the
Link
spec is modified to specifically state that only the fields included in the proto are required for a link.This issue was originally brought to my attention by follow up from an issue @carlosalberto filed on the JS API suggesting we use
SpanContext
in ourLink
type instead of theLinkContext
type we had created specifically for this purpose.The text was updated successfully, but these errors were encountered: