-
Notifications
You must be signed in to change notification settings - Fork 47
Consider using SpanContext
for Link
#36
Comments
This is done to prevent the compiler from complaining that |
Current interface for LinkContext is picking only export type LinkContext = Pick<SpanContext, 'traceId' | 'spanId'>; However, protobuf interface expect to also fill message Link {
// A unique identifier of a trace that this linked span is part of. The ID is a
// 16-byte array.
bytes trace_id = 1;
// A unique identifier for the linked span. The ID is an 8-byte array.
bytes span_id = 2;
// The trace_state associated with the link.
string trace_state = 3;
// attributes is a collection of attribute key/value pairs on the link.
repeated opentelemetry.proto.common.v1.KeyValue attributes = 4;
// dropped_attributes_count is the number of dropped attributes. If the value is 0,
// then no attributes were dropped.
uint32 dropped_attributes_count = 5;
} The current implementation in exporter collector just ignore this property and set nothing to it in proto message. It feels like there is an alignment issue here between |
It is entirely possible to have properties in the proto and sdk which are not exported from the API. Span has many such properties. In this case though, we should have it exposed. From the spec:
Seems pretty clear to me that the link should expose the whole SpanContext including the trace state. |
Refs: open-telemetry/opentelemetry-js#818 My intention that time was to remove |
As an optimization only Trace/Span Ids are being used for
Link
, instead ofSpanContext
. However, this means users have to deal with another type (that also is not in the specification).Not a strong feeling though.
The text was updated successfully, but these errors were encountered: