There are still problems around implementing custom SpanProcessors like:
import * as api from '@opentelemetry/api'
import * as tracing from '@opentelemetry/tracing'
export class CustomSpanProcessor implements api.SpanProcessor {
// api.SpanProcessor says it's an api.Span,
// but in SimpleSpanProcessor it assumes Span to be tracing.Span, which is one possible implementation of api.Span.
onStart(span: tracing.Span) {
/** api.Span doesn't provide any necessary APIs to access span fields :( */
}
}
This can be identified as a bug of the definition of api.SpanProcessor and api.Span (maybe move tracing.ReadableSpan to api.ReadableSpan).
ah I think I see the issue now. I think actually the SpanProcessor should be removed from the api package entirely as it is not a user-facing API
@mayurkale22 wdyt
At the very least, the onStart method should probably receive a ReadableSpan instead of a Span
Most helpful comment
At the very least, the
onStartmethod should probably receive aReadableSpaninstead of aSpan