Skip to content
System types · Built-in All levels

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.

SLSluicio team 4 min read Updated Jul 2026

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_.

Run the official prometheus-nats-exporter against the server’s monitoring port (8222) and scrape it with the Collector’s prometheus receiver:

otel-collector-config.yaml (receivers)
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.

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.

CheckConditionSeverityWhy it matters
Slow consumersgnatsd_varz_slow_consumers increasing (delta > 0)WarningEach increment is a subscriber the server disconnected for falling behind — messages published while it reconnects are gone.
No client connectionsgnatsd_varz_connections < 1WarningA NATS server with zero clients means your services lost their connection — or the server just restarted and nothing came back.
High memorygnatsd_varz_mem > 1 GiBWarningNATS core is normally frugal; sustained growth points at large pending buffers or, with JetStream, memory-backed streams filling up.
  • Check names assume prometheus-nats-exporter. If you run nats-surveyor instead, the same signals exist under nats_core_* names — detection still works (the nats_ 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_deadline merely 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.