Reflexio

Smarter retry policies for real systems

View the Project on GitHub aponysus/reflexio

Observability contract

Hook signatures

Hook failures are swallowed so they never break the workload; log adapter errors separately if needed.

Events

Attempts are 1-based. sleep_s is the scheduled delay for retries, otherwise 0.0.

Tags

Avoid payloads or sensitive fields in tags; stick to identifiers.

Prometheus pattern

from reflexio.metrics import prometheus_metric_hook

policy.call(
    lambda: do_work(),
    on_metric=prometheus_metric_hook(counter),
    operation="sync_user",
)

Counter should expose .labels(event=..., **tags).inc().

OTEL pattern (pseudo-code)

from reflexio.metrics import otel_metric_hook

policy.call(
    lambda: do_work(),
    on_metric=otel_metric_hook(meter, name="reflexio_attempts"),
    operation="sync_user",
)

Meter counter should support .add(1, attributes=attributes).

Alerting ideas