NATS
The built-in NATS system type — detection prefixes for prometheus-nats-exporter and nats-surveyor, starter checks for slow consumers, client connections and memory, and tuning notes.
NATS is a lightweight, high-performance messaging system built around fire-and-forget publish-subscribe. That model gives it a failure mode all its own: when a subscriber can’t keep up, the server doesn’t queue forever — it marks the client a slow consumer and disconnects it, silently dropping it out of the flow. Watching for that, plus the basic liveness signals (connections, memory), is what this system type does.
Key: nats · applied automatically to services emitting metrics prefixed gnatsd_ or nats_.
Getting the telemetry
Section titled “Getting the telemetry”Run the official prometheus-nats-exporter against the server’s monitoring port (8222) and scrape it with the Collector’s prometheus receiver:
receivers: prometheus/nats: config: scrape_configs: - job_name: nats scrape_interval: 30s static_configs: - targets: ["nats-exporter:7777"]Start the exporter with at least the varz endpoint enabled (prometheus-nats-exporter -varz http://nats:8222), and wire the receiver into a metrics pipeline with a resource processor setting a service.name — the pattern from Monitoring with the OpenTelemetry Collector.
What Sluicio detects
Section titled “What Sluicio detects”Metrics prefixed gnatsd_ or nats_. The prometheus-nats-exporter emits gnatsd_varz_* names (a legacy of the server’s old name); nats-surveyor emits nats_core_* instead — both prefixes map to this type.
Starter checks
Section titled “Starter checks”| Check | Condition | Severity | Why it matters |
|---|---|---|---|
| Slow consumers | gnatsd_varz_slow_consumers increasing (delta > 0) | Warning | Each increment is a subscriber the server disconnected for falling behind — messages published while it reconnects are gone. |
| No client connections | gnatsd_varz_connections < 1 | Warning | A NATS server with zero clients means your services lost their connection — or the server just restarted and nothing came back. |
| High memory | gnatsd_varz_mem > 1 GiB | Warning | NATS core is normally frugal; sustained growth points at large pending buffers or, with JetStream, memory-backed streams filling up. |
Tuning notes
Section titled “Tuning notes”- Check names assume prometheus-nats-exporter. If you run nats-surveyor instead, the same signals exist under
nats_core_*names — detection still works (thenats_prefix), but edit each check’s metric name on the service to match. - Slow consumers is the check to trust. It’s cumulative, so the delta condition fires on new disconnects only. If it fires at all, look at the subscriber’s throughput — raising the server’s
write_deadlinemerely delays the drop. - No client connections is meaningless on servers that legitimately idle (dev clusters, DR standbys) — disable it there.
- Memory threshold should reflect your deployment: 1 GiB is generous for core NATS but easily legitimate under JetStream with memory storage. Set it from your server’s normal working set.