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
feat(core): Allow to pass scope
to startSpan
APIs
#10076
Conversation
|
||
it('forks the scope', () => { | ||
const initialScope = getCurrentScope(); | ||
it('creates & finishes span', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just moved these out of the it.each()
as they aren't actually using any of it.
|
||
/** | ||
* Get the context related to a scope. | ||
* TODO v8: Use this for the `trace` functions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These functions still live in opentelemetry
which needs to be aligned for v8. It's not worth it to do that now IMHO, just wanted to show that it is possible to implement this in the new model, which it is!
size-limit report 📦
|
Also allow to pass this to `withScope()`, which actually aligns with OTEL as well, where you can also do that. If you pass a scope there, it will use this instead of forking a new one.
8329231
to
26d0440
Compare
Also allow to pass this to
withScope()
, which actually aligns with OTEL as well, where you can also do that. If you pass a scope there, it will use this instead of forking a new one.This should be the last thing needed to refactor some
span.startChild()
occurrences - you can now store the scope you want to fork off, and pass this intostartSpan
as needed.