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

Carry stack location in span #2666

Closed
mikearnaldi opened this issue Apr 30, 2024 · 0 comments · Fixed by #2673
Closed

Carry stack location in span #2666

mikearnaldi opened this issue Apr 30, 2024 · 0 comments · Fixed by #2673

Comments

@mikearnaldi
Copy link
Member

We could add an option to carry the location of a span by generating a new Error() and forward that to the attributes, we could do it optionally by adding a new positional parameter that enable/disable generation. This would allow enhancing the stack print of errors with source location for the spans.

Additionally we could also expose a functionWithSpan API that allows a user to define a function that is automatically traced, something like:

const myUtility = Effect.functionWithSpan({
  body: (...args) => ...,
  options: (...args) => spanOptions + name,
  traced: true / false
})

cc @tim-smart

@tim-smart tim-smart linked a pull request May 1, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant