← Effect fixes your TypeScript

Effect fixes your TypeScript · Part 11

Free tracing, no glue code

· by Tony Tang

Manual OpenTelemetry costs about 18 lines of setup per function, so nobody writes it. In Effect, naming an Effect.fn gives you a span with timing, parent and errors. Plug in the OpenTelemetry layer once at the edge.

Comment below: What do you use for tracing today?

Effect fixes your TypeScript: a series on the bugs you already ship, and how Effect makes them impossible. All code is real Effect v4 and was compiled before it went on screen. https://effect.website

Transcript

Free tracing, no glue code. Manual OpenTelemetry. Get a tracer, start an active span, try, catch, record the exception, set the status, finally, end the span. 18 lines of ceremony per function. So, nobody writes them. And when production is slow, you're guessing. In Effect, give Effect.fn a name. That's a span. Every call with its timing, its parent, and its errors attached. Need a span around any other block? Effect.withSpan. Plug in the OpenTelemetry layer once at the edge, and your whole call tree shows up in your tracing tool. Best practice, observability should be the default, not a chore you skip. 11 parts in. Next, the last one, when you should not use Effect. Part 12, what do you use for tracing today?

Full lesson in the Learn Effect course ↗ Spans, where the time went

More from this series