---
title: "NSQ integration | Grafana Cloud documentation"
description: "Learn about NSQ Grafana Cloud integration."
---

> For a curated documentation index, see [llms.txt](/llms.txt). For the complete documentation index, see [llms-full.txt](/llms-full.txt).

# NSQ integration for Grafana Cloud

[NSQ](https://nsq.io/) is a realtime distributed messaging platform designed to operate at scale, handling billions of messages per day.

This integration uses [NSQ statsd integration](https://nsq.io/components/nsqd.html#statsd--graphite-integration) to gather metrics.

This integration includes 2 useful alerts and 2 pre-built dashboards to help monitor and visualize NSQ metrics.

## Before you begin

In order for the integration to work, point `nsqd` to Grafana Alloy statsd exporter with `-statsd-address`, using [nsqd command line flags](https://nsq.io/components/nsqd.html#command-line-options), like this:

![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```none
nsqd -statsd-address=agent.default.svc.cluster.local:9125
```

To enable e2e metrics with extra flags:

![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```none
nsqd -e2e-processing-latency-percentile=1.0,0.99,0.95 -e2e-processing-latency-window-time=1m0s
```

To learn more, see end-to-end [processing latency in nsq](https://nsq.io/components/nsqd.html#end-to-end-processing-latency).

## Install NSQ integration for Grafana Cloud

1. In your Grafana Cloud stack, click **Connections** in the left-hand menu.
2. Find **NSQ** and click its tile to open the integration.
3. Review the prerequisites in the **Configuration Details** tab and set up Grafana Alloy to send NSQ metrics to your Grafana Cloud instance.
4. Click **Install** to add this integration’s pre-built dashboards and alerts to your Grafana Cloud instance, and you can start monitoring your NSQ setup.

## Configuration snippets for Grafana Alloy

### Advanced mode

The following snippets provide examples to guide you through the configuration process.

To instruct Grafana Alloy to scrape your NSQ instances, **manually** copy and append the snippets to your alloy configuration file, then follow subsequent instructions.

### Advanced integrations snippets

Alloy ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```alloy
prometheus.exporter.statsd "integrations_statsd_exporter" {
  mapping_config_path = "statsd_mapping.yaml"
}

discovery.relabel "integrations_statsd_exporter" {
	targets = prometheus.exporter.statsd.integrations_statsd_exporter.targets

	rule {
		target_label = "job"
		replacement  = "integrations/statsd_exporter"
	}
}

prometheus.scrape "integrations_statsd_exporter" {
	targets    = discovery.relabel.integrations_statsd_exporter.output
	forward_to = [prometheus.relabel.integrations_statsd_exporter.receiver]
	job_name   = "integrations/statsd_exporter"
}

prometheus.relabel "integrations_statsd_exporter" {
	forward_to = [prometheus.remote_write.metrics_service.receiver]

	rule {
		source_labels = ["exported_job"]
		target_label  = "job"
		replacement   = "integrations/$1"
	}

	rule {
		source_labels = ["exported_instance"]
		target_label  = "instance"
	}

	rule {
		regex  = "(exported_instance|exported_job)"
		action = "labeldrop"
	}
}
```

This integrations uses the [prometheus.exporter.statsd](/docs/alloy/latest/reference/components/prometheus.exporter.statsd/) component to generate metrics from a NSQ instance.

The statsd exporter component requires an external mapping configuration file. You can download the correct mapping file for this integration [here](https://storage.googleapis.com/grafanalabs-integration-assets/nsq/files/statsd_mapping.yaml).

For the full array of configuration options, refer to the [prometheus.exporter.statsd](/docs/alloy/latest/reference/components/prometheus.exporter.statsd/) component reference documentation.

This exporter must be linked with a [discovery.relabel](/docs/alloy/latest/reference/components/discovery.relabel/) component to apply the necessary relabelings.

For each NSQ instance to be monitored you must create a pair of these components.

Configure the following properties within each `discovery.relabel` component:

- `instance` label: `constants.hostname` sets the `instance` label to your Grafana Alloy server hostname. If that is not suitable, change it to a value uniquely identifies this NSQ instance.

You can then scrape them by including each `discovery.relabel` under `targets` within the [prometheus.scrape](/docs/alloy/latest/reference/components/prometheus.scrape/) component.

## Dashboards

The NSQ integration installs the following dashboards in your Grafana Cloud instance to help monitor your system.

- NSQ Instances
- NSQ Topics

**NSQ topics dashboard**

**NSQ instances dashboard**

## Alerts

The NSQ integration includes the following useful alerts:

Expand table

| Alert                     | Description                                  |
|---------------------------|----------------------------------------------|
| NsqTopicDepthIncreasing   | Critical: Topic depth is increasing.         |
| NsqChannelDepthIncreasing | Critical: Topic channel depth is increasing. |

## Metrics

The most important metrics provided by the NSQ integration, which are used on the pre-built dashboards and Prometheus alerts, are as follows:

- nsq\_mem\_gc\_pause\_usec\_100
- nsq\_mem\_gc\_pause\_usec\_95
- nsq\_mem\_gc\_pause\_usec\_99
- nsq\_mem\_heap\_idle\_bytes
- nsq\_mem\_heap\_in\_use\_bytes
- nsq\_mem\_heap\_objects
- nsq\_mem\_heap\_released\_bytes
- nsq\_mem\_next\_gc\_bytes
- nsq\_topic\_backend\_depth
- nsq\_topic\_channel\_backend\_depth
- nsq\_topic\_channel\_clients
- nsq\_topic\_channel\_deferred\_count
- nsq\_topic\_channel\_depth
- nsq\_topic\_channel\_e2e\_processing\_latency\_99
- nsq\_topic\_channel\_in\_flight\_count
- nsq\_topic\_channel\_message\_count
- nsq\_topic\_channel\_requeue\_count
- nsq\_topic\_channel\_timeout\_count
- nsq\_topic\_depth
- nsq\_topic\_e2e\_processing\_latency\_99
- nsq\_topic\_message\_bytes
- nsq\_topic\_message\_count
- up

## Changelog

md ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```md
# 1.0.0 - December 2025

* Chore: Fix incorrect semver to 1.0.0. No further changes

# 0.0.2 - September 2023

* New Filter Metrics option for configuring the Grafana Agent, which saves on metrics cost by dropping any metric not used by this integration. Beware that anything custom built using metrics that are not on the snippet will stop working.

# 0.0.1 - January 2022

* Initial release
```

## Cost

By connecting your NSQ instance to Grafana Cloud, you might incur charges. To view information on the number of active series that your Grafana Cloud account uses for metrics included in each Cloud tier, see [Active series and dpm usage](/docs/grafana-cloud/fundamentals/active-series-and-dpm/) and [Cloud tier pricing](/products/cloud/pricing/).
