Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

custom SpanProcessors api definition issue #1028

Closed
legendecas opened this issue May 6, 2020 · 3 comments · Fixed by #1037
Closed

custom SpanProcessors api definition issue #1028

legendecas opened this issue May 6, 2020 · 3 comments · Fixed by #1037

Comments

@legendecas
Copy link
Member

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).

@dyladan
Copy link
Member

dyladan commented May 6, 2020

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

@dyladan
Copy link
Member

dyladan commented May 6, 2020

@mayurkale22 wdyt

@dyladan
Copy link
Member

dyladan commented May 6, 2020

At the very least, the onStart method should probably receive a ReadableSpan instead of a Span

pichlermarc pushed a commit to dynatrace-oss-contrib/opentelemetry-js that referenced this issue Dec 15, 2023
Co-authored-by: Rauno Viskus <Rauno56@users.noreply.github.com>
Co-authored-by: Amir Blum <amir@aspecto.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants