---
title: Telegraf Documentation
description: Telegraf plugin for collecting metrics from NSQ Consumer
url: https://docs.influxdata.com/telegraf/v1/input-plugins/nsq_consumer/
estimated_tokens: 1504
product: Telegraf
version: v1
---

-   Telegraf v0.10.1+

# NSQ Consumer Input Plugin

This service plugin consumes messages from [NSQ](https://nsq.io/) realtime distributed messaging platform brokers in one of the supported [data formats](/telegraf/v1/data_formats/input).

**Introduced in:** Telegraf v0.10.1 **Tags:** messaging **OS support:** all

## Service Input

This plugin is a service input. Normal plugins gather metrics determined by the interval setting. Service plugins start a service to listen and wait for metrics or events to occur. Service plugins have two key differences from normal plugins:

1. The global or plugin specific `interval` setting may not apply
2. The CLI options of `--test`, `--test-wait`, and `--once` may not produce output for this plugin

## Tracking metric support

This plugin supports [tracking metrics](../../../docs/METRICS.md#tracking-metrics), which allows the plugin to be notified when metrics have been delivered to all outputs, enabling proper acknowledgment back to the source.

## Global configuration options

Plugins support additional global and plugin configuration settings for tasks such as modifying metrics, tags, and fields, creating aliases, and configuring plugin ordering. See [CONFIGURATION.md](/telegraf/v1/configuration/#plugins) for more details.

## Configuration

```toml
# Read metrics from NSQD topic(s)
[[inputs.nsq_consumer]]
  ## An array representing the NSQD TCP HTTP Endpoints
  nsqd = ["localhost:4150"]

  ## An array representing the NSQLookupd HTTP Endpoints
  nsqlookupd = ["localhost:4161"]
  topic = "telegraf"
  channel = "consumer"
  max_in_flight = 100

  ## Max undelivered messages
  ## This plugin uses tracking metrics, which ensure messages are read to
  ## outputs before acknowledging them to the original broker to ensure data
  ## is not lost. This option sets the maximum messages to read from the
  ## broker that have not been written by an output.
  ##
  ## This value needs to be picked with awareness of the agent's
  ## metric_batch_size value as well. Setting max undelivered messages too high
  ## can result in a constant stream of data batches to the output. While
  ## setting it too low may never flush the broker's messages.
  # max_undelivered_messages = 1000

  ## Data format to consume.
  ## Each data format has its own unique set of configuration options, read
  ## more about them here:
  ## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md
  data_format = "influx"
```

## Metrics

The plugin accepts arbitrary input and parses it according to the `data_format` setting. There is no predefined metric format.

## Example Output

There is no predefined metric format, so output depends on plugin input.

#### Related

-   [Configure plugins](/telegraf/v1/configure_plugins/)
-   [NSQ Consumer Plugin Source](https://github.com/influxdata/telegraf/tree/v1.38.4/plugins/inputs/nsq_consumer/README.md)
