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

Allow parent span to be null #565

Closed
dyladan opened this issue Nov 23, 2019 · 2 comments
Closed

Allow parent span to be null #565

dyladan opened this issue Nov 23, 2019 · 2 comments
Assignees
Milestone

Comments

@dyladan
Copy link
Member

dyladan commented Nov 23, 2019

Is your feature request related to a problem? Please describe.
The following pattern is used in almost every plugin:

const span = tracer.startSpan(spanName, {
    parent: tracer.getCurrentSpan() || undefined,
    // ...
});

This is because getCurrentSpan currently returns Span | null but parent is an optional Span (parent?: Span).

Describe the solution you'd like

Propose changing the signature of parent to parent?: Span | null.

Describe alternatives you've considered
Continuing to use the parent: tracer.getCurrentSpan() || undefined, pattern

Additional context
#525 (comment)

@dyladan dyladan mentioned this issue Nov 23, 2019
8 tasks
@vmarchaud vmarchaud added the up-for-grabs Good for taking. Extra help will be provided by maintainers label Nov 23, 2019
@dyladan
Copy link
Member Author

dyladan commented Nov 25, 2019

pls assign me

@mayurkale22 mayurkale22 removed the up-for-grabs Good for taking. Extra help will be provided by maintainers label Nov 25, 2019
@mayurkale22 mayurkale22 added this to the Alpha v0.3 milestone Nov 26, 2019
@mayurkale22
Copy link
Member

Closing via #569

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants