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

Auto instrumentation of Services #125

Open
patroza opened this issue Nov 26, 2024 · 4 comments
Open

Auto instrumentation of Services #125

patroza opened this issue Nov 26, 2024 · 4 comments

Comments

@patroza
Copy link
Member

patroza commented Nov 26, 2024

tracing: true would wrap all service members with

Effect.withSpan(`${identifier}.${member}`)

(or the new upcoming Effect.fn)

complications:

  • non effect returning functions

Can look into andThen implementation for some ideas.
Can look at only allowing the tracing: true option when shape is compatible.
Either use proxy or just a Record.map

Alternatives:

  • tsc/loader plugin to wrap functions automatically with Effect.fn?
@jfet97
Copy link
Collaborator

jfet97 commented Nov 26, 2024

Reference: Effect-TS/effect#3938

@jfet97
Copy link
Collaborator

jfet97 commented Nov 26, 2024

Effect.fn should support normal functions too, right?

@mikearnaldi
Copy link

Effect.fn should support normal functions too, right?

Effect.fn supports generators and Effect-returning functions

@jfet97
Copy link
Collaborator

jfet97 commented Nov 26, 2024

Effect.fn should support normal functions too, right?

Effect.fn supports generators and Effect-returning functions

I misunderstood a comment in the source code then, thanks! Even tho it could accept non Effect-returning function and wrap the result with Effect.succed/Effect.fail. I suppose.

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

No branches or pull requests

3 participants