The core package exposes snapshots. Exporters convert snapshots to external systems.
This avoids forcing dependencies on users.
Current queue occupancy.
Useful to detect saturation but not enough alone.
Basic throughput counters.
Critical for lossy queues.
Increment when:
DropNewestrejects incoming work.DropOldestevicts old work.
Increment when a Send call found a full queue and had to wait under Block.
Increment when a Recv call found an empty queue and had to wait.
Total accumulated waiting time.
Average wait can be derived as:
avg_send_wait = SendWaitTotal / SendBlockedTotal
avg_recv_wait = RecvWaitTotal / RecvBlockedTotal
Total time items spent inside the queue before being received.
Average queue age can be derived as:
avg_item_wait = ItemWaitTotal / ReceivedTotal
Age of the oldest item currently in the queue.
This is one of the most useful incident metrics.
Histograms require either:
- a dependency on a metrics backend,
- a custom approximate histogram implementation,
- or more API surface.
For v1, snapshots are enough. Prometheus/OpenTelemetry adapters can add histograms later.