bunqueue v2.3.0
blog · release
bunqueue v2.3.0
Ships 2 performance improvements. Latency Histograms, per-Queue Metric Labels, throughput Tracker, LOG_LEVEL Runtime Filtering and more.
To install bunqueue v2.3.0
Section titled “To install bunqueue v2.3.0”bun add bunqueue@2.3.0npm install bunqueue@2.3.0To upgrade bunqueue
Section titled “To upgrade bunqueue”bun add bunqueue@latestLatency Histograms
Section titled “Latency Histograms”Prometheus-compatible histograms for push, pull, and ack operations
- Fixed bucket boundaries: 0.1ms to 10,000ms (15 buckets)
- Full exposition format:
_bucket{le="..."},_sum,_count - Percentile calculation (p50, p95, p99) for SLO tracking
- New files:
src/shared/histogram.ts,src/application/latencyTracker.ts
Per-Queue Metric Labels
Section titled “Per-Queue Metric Labels”Prometheus labels for per-queue drill-down
bunqueue_queue_jobs_waiting{queue="..."}(waiting, delayed, active, dlq)- Enables Grafana filtering and alerting per queue name
Throughput Tracker
Section titled “Throughput Tracker”Real-time EMA-based rate tracking
pushPerSec,pullPerSec,completePerSec,failPerSec- O(1) per observation, zero GC pressure
- Replaces placeholder zeros in
/statsendpoint - New file:
src/application/throughputTracker.ts
LOG_LEVEL Runtime Filtering
Section titled “LOG_LEVEL Runtime Filtering”LOG_LEVEL env var now works at runtime
- Levels:
debug,info(default),warn,error - Priority-based filtering with early return
39 new telemetry tests
Section titled “39 new telemetry tests”Across 5 test files:
test/histogram.test.ts(9 tests)test/latencyTracker.test.ts(7 tests)test/perQueueMetrics.test.ts(7 tests)test/throughputTracker.test.ts(7 tests)test/telemetry-e2e.test.ts(9 E2E integration tests)
Performance
Section titled “Performance”- Telemetry overhead: ~0.003% (~25ns per operation via
Bun.nanoseconds()) - Benchmark results unchanged: 197K push/s (embedded), 39K push/s (TCP)
Changes
Section titled “Changes”/statsendpoint now returns real throughput and latency values- Monitoring docs updated with per-queue metrics, histogram examples, and logging section
- HTTP API docs updated with new Prometheus output format
Thanks to 1 contributor!
Section titled “Thanks to 1 contributor!”← bunqueue v2.1.8 · Release on GitHub · Commits since v2.1.8 · Full changelog · All posts