arXiv:2609.35310cs.NISep 2026

Manuscript Offprint

arXiv:2609.35310

Configuration-Induced Delivery Failures in NATS JetStream: Detection and Remediation

Biplab Kumar Das

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

NATS JetStream’s at-least-once delivery guarantee is conditional: five common configuration mistakes silently violate it, causing duplicate message processing, data loss, or redelivery storms with no error logged anywhere. The standard Prometheus NATS exporter exposes only server-level throughput metrics and cannot detect any of these failures. We present nats-lens, a standalone monitor that reads from the JetStream management API and detects all five violation classes without requiring changes to monitored applications or client code. We formally characterize each violation class, prove that standard Prometheus NATS metrics are structurally incapable of detecting any of them, and prove a detection latency guarantee of k×Tpollk \times T_{\text{poll}} where k∈{1,2}k \in \{1, 2\} depending on class. In 100-round controlled evaluations on both single-node and 3-node JetStream clusters, nats-lens achieves 100% detection coverage across all five classes (95 % Wilson CI ≥\geq 96.3%), versus 0% for the Prometheus baseline. Zero false positives over 24 hours of healthy operation. We show that naive single-snapshot threshold detection produces false positives on boundary conditions where nats-lens produces none. We further validate the detection latency guarantee empirically across poll intervals from 1 s to 30 s, confirm language-agnostic detection with Rust, Go, and Python consumers, and demonstrate recovery from a fixed violation within 2 poll cycles. At 1,000 active consumers, nats-lens consumes <13 MB RSS. The tool is open source with four output channels: web dashboard, Prometheus metrics, REST API, and NATS health events.

Keywords

NATS JetStream, message delivery, distributed systems monitoring, at-least-once semantics, delivery correctness