Instruments Effect programs with OpenTelemetry-friendly spans and attributes using Effect.fn, Effect.withSpan, and span annotations. Use when adding cross-service calls, latency-sensitive paths, or hard-to-debug execution flows.
Use this skill to design high-signal tracing in Effect programs. Model traces as execution narratives: one root operation, meaningful child spans, and consistent attributes.
Do not install exporters, SDKs, or collectors in this skill.
If telemetry plumbing is missing, invoke setup-otel first, then return here for instrumentation.
Service.method, Repository.query, Client.request.operation, provider, status).Effect.fn(...) and/or Effect.withSpan(...).order_id, provider, retry_count).Repository.load, Client.request).import { Effect } from "effect";
const processOrder = Effect.fn("OrderService.processOrder")(function* (orderId: string) {
yield* Effect.annotateCurrentSpan({
order_id: orderId,
operation: "order_process",
});
const order = yield* Effect.withSpan("OrderRepository.load")(
loadOrder(orderId),
);
const result = yield* Effect.withSpan("PaymentService.capture")(
capturePayment(order),
);
yield* Effect.annotateCurrentSpan({
payment_status: result.status,
status: "ok",
});
return result;
});
const processOrderSafe = (orderId: string) =>
processOrder(orderId).pipe(
Effect.tapErrorTag("PaymentDeclinedError", (error) =>
Effect.annotateCurrentSpan({
status: "error",
error_tag: error._tag,
}),
),
);
observability-wide-events.order_id, operation, status).Task.fetchA, Task.fetchB).setup-otel skill in .agents/skills/setup-otel/SKILL.mdobservability-wide-events skill in .agents/skills/observability-wide-events/SKILL.md