Telemetry
Telemetry (resilix/otel)
Built in, not a plugin. Under 1% of opossum users instrument their breakers, which means almost nobody has data at the moment they need it.
ts
import { metrics } from "@opentelemetry/api";
import { otel } from "resilix/otel";
const instrument = otel({ meter: metrics.getMeter("checkout") });
const api = pipeline({ policies: [...], observers: [instrument] });
instrument.observeGauges(api); // pull-based gauges| Instrument | Type | Attributes |
|---|---|---|
resilix.executions | counter | key, verdict |
resilix.execution.duration | histogram (ms) | key, verdict |
resilix.rejections | counter | key, reason, policy |
resilix.state.transitions | counter | key, from, to, reason |
resilix.breaker.{state,failureRate,slowRate,windowSize} | gauge | key |
resilix.bulkhead.{inFlight,limit,utilisation} | gauge | key |
@opentelemetry/api is an optional peer dependency — core stays at zero deps. Without a meter, otel() is a no-op, so tests need no OTel install. Observers are dispatched through a swallowing wrapper: a failing exporter can neither influence nor break an admission decision.