amqp_consumer

package
v0.0.0-...-3667945 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2019 License: MIT Imports: 10 Imported by: 0

README

AMQP Consumer Input Plugin

This plugin provides a consumer for use with AMQP 0-9-1, a promenent implementation of this protocol being RabbitMQ.

Metrics are read from a topic exchange using the configured queue and binding_key.

Message payload should be formatted in one of the Telegraf Data Formats.

For an introduction to AMQP see:

The following defaults are known to work with RabbitMQ:

# AMQP consumer plugin
[[inputs.amqp_consumer]]
  ## AMQP url
  url = "amqp://localhost:5672/influxdb"
  ## AMQP exchange
  exchange = "telegraf"
  ## AMQP queue name
  queue = "telegraf"
  ## Binding Key
  binding_key = "#"

  ## Controls how many messages the server will try to keep on the network
  ## for consumers before receiving delivery acks.
  #prefetch_count = 50

  ## Auth method. PLAIN and EXTERNAL are supported.
  ## Using EXTERNAL requires enabling the rabbitmq_auth_mechanism_ssl plugin as
  ## described here: https://www.rabbitmq.com/plugins.html
  # auth_method = "PLAIN"
  ## Optional SSL Config
  # ssl_ca = "/etc/telegraf/ca.pem"
  # ssl_cert = "/etc/telegraf/cert.pem"
  # ssl_key = "/etc/telegraf/key.pem"
  ## Use SSL but skip chain & host verification
  # insecure_skip_verify = false

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

View Source
const (
	DefaultAuthMethod    = "PLAIN"
	DefaultPrefetchCount = 50
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AMQPConsumer

type AMQPConsumer struct {
	URL string
	// AMQP exchange
	Exchange string
	// Queue Name
	Queue string
	// Binding Key
	BindingKey string `toml:"binding_key"`

	// Controls how many messages the server will try to keep on the network
	// for consumers before receiving delivery acks.
	PrefetchCount int

	// AMQP Auth method
	AuthMethod string
	// Path to CA file
	SSLCA string `toml:"ssl_ca"`
	// Path to host cert file
	SSLCert string `toml:"ssl_cert"`
	// Path to cert key file
	SSLKey string `toml:"ssl_key"`
	// Use SSL but skip chain & host verification
	InsecureSkipVerify bool
	// contains filtered or unexported fields
}

AMQPConsumer is the top level struct for this plugin

func (*AMQPConsumer) Description

func (a *AMQPConsumer) Description() string

func (*AMQPConsumer) Gather

func (a *AMQPConsumer) Gather(_ telegraf.Accumulator) error

All gathering is done in the Start function

func (*AMQPConsumer) SampleConfig

func (a *AMQPConsumer) SampleConfig() string

func (*AMQPConsumer) SetParser

func (a *AMQPConsumer) SetParser(parser parsers.Parser)

func (*AMQPConsumer) Start

func (a *AMQPConsumer) Start(acc telegraf.Accumulator) error

Start satisfies the telegraf.ServiceInput interface

func (*AMQPConsumer) Stop

func (a *AMQPConsumer) Stop()

Jump to

Keyboard shortcuts

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