effect
effect copied to clipboard
Carry stack location in span
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