Skip to main content
Effect procedures are wrapped in Effect spans automatically. By default, the span name comes from the procedure path in the router.
automatic-spans.ts
export const router = {
  users: {
    // span name: "users.get"
    get: effectProcedure.effect(function* () {
      return yield* UsersRepo.findById("1");
    }),
  },
};

Override the span name

Use .traced(...) when a stable custom span name is better than the router path.
custom-span.ts
const getUser = effectProcedure
  .input(z.object({ id: z.string() }))
  .traced("users.get_by_id")
  .effect(function* ({ input }) {
    return yield* UsersRepo.findById(input.id);
  });

Error stack traces

When an Effect procedure fails, effect-orpc captures stack information near the procedure definition site so spans point to useful application code.
example-stack.txt
UserNotFoundError: User not found
    at <anonymous> (/app/src/router.ts:42:28)
    at users.get (/app/src/router.ts:40:35)
This page covers the tracing capability. To wire spans to an OpenTelemetry exporter, see OpenTelemetry guide.

Next step

Add HTTP/OpenAPI metadata with OpenAPI metadata.
Last modified on June 15, 2026