NSQ
Exporter Metrics
NSQ is a real-time distributed messaging platform designed for high-throughput, fault-tolerant message delivery. Detailed metrics are collected using a Prometheus exporter that queries NSQ’s built-in stats API.
Exporter Metrics
Section titled “Exporter Metrics”Detailed NSQ metrics are collected using the third-party nsq_exporter.
Prerequisites
Section titled “Prerequisites”- 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
Installing the Exporter
Section titled “Installing the Exporter”Download the latest release from the nsq_exporter releases page, or install with Go:
go install github.com/lovoo/nsq_exporter@latestStart the exporter:
nsq_exporter --nsqd.addr="http://localhost:4151"The exporter listens on port 9117 by default. Verify it is working:
curl http://localhost:9117/metricsFor production use, create a systemd service unit to manage the exporter process.
Glouton Configuration
Section titled “Glouton Configuration”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"EOFCreate or edit C:\ProgramData\glouton\conf.d\99-nsq.conf:
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"Glouton automatically detects configuration changes.
| Metric | Description |
|---|---|
nsq_topic_message_count | Total number of messages published to a topic |
nsq_topic_depth | Number of messages currently queued in a topic |
nsq_channel_message_count | Total number of messages delivered to a channel |
nsq_channel_depth | Number of messages currently queued in a channel |
nsq_channel_in_flight_count | Number of messages currently in flight for a channel |
nsq_channel_timeout_count | Total number of timed-out messages for a channel |