-
-
Notifications
You must be signed in to change notification settings - Fork 440
Open
Labels
enhancementNew feature or requestNew feature or request
Description
What is the problem this feature would solve?
Effect.fn has been a tremendous improvement for dx. It removes boilerplate required to add span names to traces. Howvever it does not add span names to logs. Span names in logs can be useful information for developers and LLMs.
Before Effect.fn:
const MyService = {
myFn: (arg: string) =>
Effect.succeed(arg).pipe(
Effect.withSpan("MyService.myFn"),
Effect.withLogSpan("MyService.myFn")
)
}With Effect.fn today:
Effect.fn("MyService.myFn")(
function* (arg) { return arg; },
Effect.withLogSpan("MyService.myFn") // ← not added automatically
)What is the feature you are proposing to solve the problem?
Effect.fn should automatically add .withLogSpan the same way it adds .withSpan.
Proposed:
Effect.fn("MyService.myFn")(
function* (arg) { return arg; },
) // annotates traces and logs with the name of the fnWhat alternatives have you considered?
Wrapping Effect.fn to perform this automatically, using the wrapped version instead of Effect.fn in the codebase
Relying on tracing only (inevitably we still have logs, somewhat impractical for contexts like tests or scripts)
janglad and danielo515
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request