Skip to content

[Metrics] Deadline Proximity histogram (time-to-deadline of queued items) #345

Description

@shimib

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions