Skip to content
This repository has been archived by the owner on Oct 3, 2023. It is now read-only.

span.end closes all child spans #791

Open
cliedeman opened this issue Apr 7, 2020 · 1 comment
Open

span.end closes all child spans #791

cliedeman opened this issue Apr 7, 2020 · 1 comment

Comments

@cliedeman
Copy link

cliedeman commented Apr 7, 2020

Is your feature request related to a problem? Please describe.
I am attempting to integrate tracing with graphql but I have the issue parent spans end before the child spans. This was no an issue with opentracing but I am running into open-telemetry/opentelemetry-js#4. I feel like this would also make a future open-telemetry migration easier

Describe the solution you'd like
An extra config option on span.end that ignores if the parent span has started or ended.

Describe alternatives you've considered
Opencensus Links - https://opencensus.io/tracing/span/link/. But this does not seem to cater for this use case.

Additional context
Add any other context or screenshots about the feature request here.

@cliedeman
Copy link
Author

I have found a workable solution I think. Going to test it against jaeger and see

Instead of

    const span = this.tracer.startChildSpan({
       name,
       childOf: parentSpan,
     });

I am manually creating the link

    const span = this.tracer.startRootSpan({ name }, (span) => span);

    if (parentSpan) {
      span.addLink(
        parentSpan.traceId,
        parentSpan.id,
        LinkType.PARENT_LINKED_SPAN
      );
    }

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

No branches or pull requests

1 participant