Closed fabianfett closed 1 year ago
Sounds good to me 👍 The rename to SpanProtocol
also sounds good and actually fits nicely with @ktoso's rename of Tracer
and Instrument
to *Protocol
: #69
Yeah, sounds like a good idea -- it does seem like we'll indeed adopt more ...Protocol
types, so this sounds good as well.
Done, I'll do one more rename though -- we'll keep protocol Span
Currently the
Tracer
protocol has thestartSpan
requirement. The return ofstartSpan
is aSpan
which is a protocol. In other words we return an existential here. Instead we might want to consider making the Span an associated type and returning the concrete type:I can see no reasons, why a Tracer would return Spans of different types. If that was a requirement adopters could work around this, by using internal enums.
Result
We preserve more type information if we work with a concrete Tracer.