SpanKind immutable to SpanProcessors
The SpanKind (span.kind) is inherently considered immutable and only to be set on Span creation.
However a SpanProcessor should be able to essentially perform any kind of change to Spans (especially on the on_start and on_finishing methods).
Currently there is no way to adjust the kind within a Span processor without resulting to unsafe Ruby core functionality (e.g. span.instance_variable_set(:@kind, ::OpenTelemetry::Trace::SpanKind::CONSUMER)). It would be better if there were a dedicated way for a SpanProcessor to adjust the kind.
This would be an API change that would IMHO need to be described in the specification first.
I found this in the spec:
A Span’s start time SHOULD be set to the current time on span creation. After the Span is created, it SHOULD be possible to change its name, set its Attributes, add Events, and set the Status. These MUST NOT be changed after the Span’s end time has been set. From: https://opentelemetry.io/docs/specs/otel/trace/api/#span
It doesn't seem to state anything about SpanKind after initialization. One could take this to mean that it is immutable (because it isn't explicitly stated to be changeable). One could also take this to mean that it just plainly isn't specified. I couldn't find another section of the Spec that mentions it. Do you by chance have a reference link?
It's not described in Span Operations: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#span-operations
@0robustus1, can you share more about the situation(s) you're seeing in which the span.kind is not known at span start?
👋 This issue has been marked as stale because it has been open with no activity. You can: comment on the issue or remove the stale label to hold stale off for a while, add the keep label to hold stale off permanently, or do nothing. If you do nothing this issue will be closed eventually by the stale bot.