nsq_consumer

package
v1.17.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 16, 2021 License: MIT Imports: 6 Imported by: 0

README

NSQ Consumer Input Plugin

The NSQ consumer plugin reads from NSQD and creates metrics using one of the supported input data formats.

Configuration:
# Read metrics from NSQD topic(s)
[[inputs.nsq_consumer]]
  ## Server option still works but is deprecated, we just prepend it to the nsqd array.
  # server = "localhost:4150"

  ## 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

  ## Maximum messages to read from the broker that have not been written by an
  ## output.  For best throughput set based on the number of metrics within
  ## each message and the size of the output's metric_batch_size.
  ##
  ## For example, if each message from the queue contains 10 metrics and the
  ## output metric_batch_size is 1000, setting this to 100 will ensure that a
  ## full batch is collected and the write is triggered immediately without
  ## waiting until the next flush_interval.
  # 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"

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NSQConsumer

type NSQConsumer struct {
	Server      string   `toml:"server"`
	Nsqd        []string `toml:"nsqd"`
	Nsqlookupd  []string `toml:"nsqlookupd"`
	Topic       string   `toml:"topic"`
	Channel     string   `toml:"channel"`
	MaxInFlight int      `toml:"max_in_flight"`

	MaxUndeliveredMessages int `toml:"max_undelivered_messages"`

	Log telegraf.Logger
	// contains filtered or unexported fields
}

NSQConsumer represents the configuration of the plugin

func (*NSQConsumer) Description

func (n *NSQConsumer) Description() string

Description prints description string

func (*NSQConsumer) Gather

func (n *NSQConsumer) Gather(acc telegraf.Accumulator) error

Gather is a noop

func (*NSQConsumer) SampleConfig

func (n *NSQConsumer) SampleConfig() string

SampleConfig returns config values for generating a sample configuration file

func (*NSQConsumer) SetParser

func (n *NSQConsumer) SetParser(parser parsers.Parser)

SetParser takes the data_format from the config and finds the right parser for that format

func (*NSQConsumer) Start

func (n *NSQConsumer) Start(ac telegraf.Accumulator) error

Start pulls data from nsq

func (*NSQConsumer) Stop

func (n *NSQConsumer) Stop()

Stop processing messages

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL