Suggestion for `Effect.Service` to include a `withSpans` option for automatic span attachment

It might be cool if Effect.Service had a withSpans option that automatically added spans to the returned fns using the key provided to the service(in this case Test) and the returned fn names (in this case a) to add the span Test.a). Something like:

export class Test extends Effect.Service<Test>()("Test", {
  withSpans: true,
  effect: Effect.succeed({ // same as .pipe(Effect.withSpan("Test.a"))
    a: Effect.sync(() => doThing())
  })
}) {}


where the span Test.a is attached to Test.a.
Was this page helpful?