Skip to content
BleemeoBleemeo

NSQ

Auto-Detection
Built-in Metrics
Exporter Metrics

NSQ is a real-time distributed messaging platform designed for high-throughput, fault-tolerant message delivery.

Glouton can monitor NSQ in two ways:

  • Auto-detection — recommended, minimal configuration. Glouton detects NSQ and collects a curated set of built-in metrics directly from nsqd’s stats API.
  • Exporter metrics — collect a more detailed set of metrics through a third-party Prometheus exporter.

Glouton detects NSQ by its nsqd process and listening port (default HTTP stats API: 4151). Metrics are read directly from the stats API — no exporter or authentication is required.

If the auto-detected parameters are incorrect, override them manually:

Terminal window
sudo tee /etc/glouton/conf.d/99-nsq.conf > /dev/null << 'EOF'
service:
- type: "nsq"
address: "127.0.0.1"
port: 4151
EOF

Glouton automatically detects configuration changes.

MetricDescription
service_statusStatus of NSQ
nsq_server_serversNumber of nsqd servers reporting
nsq_server_topicsNumber of topics on the nsqd server
nsq_topic_depthNumber of messages currently queued in a topic
nsq_topic_messagesTotal number of messages received by a topic
nsq_channel_depthNumber of messages currently queued in a channel
nsq_channel_messagesTotal number of messages received by a channel
nsq_channel_clientsNumber of clients currently connected to a channel
nsq_channel_inflightsNumber of messages currently in flight for a channel
nsq_channel_requeuesTotal number of messages requeued on a channel
nsq_channel_timeoutsTotal number of messages that timed out on a channel

Detailed NSQ metrics are collected using the third-party nsq_exporter.

  • NSQ (nsqd) installed and running with the HTTP interface enabled (port 4151 by default)
  • Glouton agent installed on the same host
  • Go toolchain (if building from source) or access to GitHub releases

Download the latest release from the nsq_exporter releases page, or install with Go:

Terminal window
go install github.com/lovoo/nsq_exporter@latest

Start the exporter:

Terminal window
nsq_exporter --nsqd.addr="http://localhost:4151"

The exporter listens on port 9117 by default. Verify it is working:

Terminal window
curl http://localhost:9117/metrics

For production use, create a systemd service unit to manage the exporter process.

Terminal window
sudo tee /etc/glouton/conf.d/99-nsq.conf > /dev/null << 'EOF'
metric:
prometheus:
targets:
- url: "http://localhost:9117/metrics"
name: "nsq"
allow_metrics:
- "nsq_topic_message_count"
- "nsq_topic_depth"
- "nsq_channel_message_count"
- "nsq_channel_depth"
- "nsq_channel_in_flight_count"
- "nsq_channel_timeout_count"
EOF

Glouton automatically detects configuration changes.

MetricDescription
nsq_topic_message_countTotal number of messages published to a topic
nsq_topic_depthNumber of messages currently queued in a topic
nsq_channel_message_countTotal number of messages delivered to a channel
nsq_channel_depthNumber of messages currently queued in a channel
nsq_channel_in_flight_countNumber of messages currently in flight for a channel
nsq_channel_timeout_countTotal number of timed-out messages for a channel