Skip to content

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
InstrumentTypeAttributes
resilix.executionscounterkey, verdict
resilix.execution.durationhistogram (ms)key, verdict
resilix.rejectionscounterkey, reason, policy
resilix.state.transitionscounterkey, from, to, reason
resilix.breaker.{state,failureRate,slowRate,windowSize}gaugekey
resilix.bulkhead.{inFlight,limit,utilisation}gaugekey

@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.

MIT licensed. Zero runtime dependencies.