Split out of #217 (comprehensive metrics), which is now closed with the core suite delivered. This is a post-v0.9.0 fast-follow.
What
A histogram of deadline - now() across items currently in the queue, to spot when a large batch of work is about to expire simultaneously (SLO early warning).
- Metric:
async_deadline_proximity_millis (histogram), labeled by pool/queue.
Approach
Piggyback the existing per-queue backlog poller (the ZCard loop + ticker that powers async_broker_backlog): add a bucketed ZRANGEBYSCORE/ZCOUNT read of the SortedSet scores (deadlines) and observe deadline - now() per sampled item.
Caveats
- redis-sortedset only — Pub/Sub can't peek at un-consumed messages, so this metric is not feasible for the redis-pubsub broker (document the limitation).
- Sampled on the poller interval (a snapshot per tick), not continuous.
Split out of #217 (comprehensive metrics), which is now closed with the core suite delivered. This is a post-v0.9.0 fast-follow.
What
A histogram of
deadline - now()across items currently in the queue, to spot when a large batch of work is about to expire simultaneously (SLO early warning).async_deadline_proximity_millis(histogram), labeled by pool/queue.Approach
Piggyback the existing per-queue backlog poller (the
ZCardloop + ticker that powersasync_broker_backlog): add a bucketedZRANGEBYSCORE/ZCOUNTread of the SortedSet scores (deadlines) and observedeadline - now()per sampled item.Caveats