otel4s
otel4s copied to clipboard
Rename `SpanRef`
Sorry to be late 😅 but I do think we should bikeshed this name. As far as I understand there is nothing Ref-like here, i.e. you can't set anything. But you may read effectually, which does make it similar to RefSource.
Sorry, I don't have better naming ideas 😕
Originally posted by @armanbilge in https://github.com/typelevel/otel4s/pull/374#discussion_r1405175452
i.e. you can't set anything
SpanRef has a Span.Backend inheritance constraint:
https://github.com/typelevel/otel4s/blob/827f5f0910caf9051cb19289dea6bae29dcab2bf/sdk/trace/src/main/scala/org/typelevel/otel4s/sdk/trace/SpanRef.scala#L37
You can access all mutating operations: updateName, setStatus, etc.
You can access all mutating operations:
updateName,setStatus, etc.
Aha, I missed that.
P.S. Java SDK calls the interface
ReadableSpanrather thanSpanRef
So then I'm confused. Is our SpanRef like ReadableSpan or ReadWriteSpan? Because ReadableSpan doesn't appear to have mutation operations.
If we do keep SpanRef for the read-write version, then something like SpanRefSource could be okay for the read-only version, since we already have the Ref/RefSource correspondence in CE.
ReadableSpan defines methods that we currently have in SpanRef: name, toSpanData, etc.
ReadWriteSpan extends ReadableSpan and Span.