2017-03-03 18:24:50 +00:00
# AMQP Consumer Input Plugin
2020-05-14 07:41:58 +00:00
This plugin provides a consumer for use with AMQP 0-9-1, a prominent implementation of this protocol being [RabbitMQ ](https://www.rabbitmq.com/ ).
2017-03-03 18:24:50 +00:00
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 ](https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md ).
For an introduction to AMQP see:
- https://www.rabbitmq.com/tutorials/amqp-concepts.html
- https://www.rabbitmq.com/getstarted.html
The following defaults are known to work with RabbitMQ:
```toml
[[inputs.amqp_consumer]]
2018-06-04 00:05:33 +00:00
## Broker to consume from.
## deprecated in 1.7; use the brokers option
# url = "amqp://localhost:5672/influxdb"
## Brokers to consume from. If multiple brokers are specified a random broker
## will be selected anytime a connection is established. This can be
## helpful for load balancing when not using a dedicated load balancer.
brokers = ["amqp://localhost:5672/influxdb"]
## Authentication credentials for the PLAIN auth_method.
# username = ""
# password = ""
2018-06-03 23:31:11 +00:00
2019-05-20 21:38:35 +00:00
## Name of the exchange to declare. If unset, no exchange will be declared.
2017-03-03 18:24:50 +00:00
exchange = "telegraf"
2018-06-03 23:31:11 +00:00
## Exchange type; common types are "direct", "fanout", "topic", "header", "x-consistent-hash".
# exchange_type = "topic"
## If true, exchange will be passively declared.
# exchange_passive = false
## Exchange durability can be either "transient" or "durable".
# exchange_durability = "durable"
## Additional exchange arguments.
2018-06-04 01:42:08 +00:00
# exchange_arguments = { }
2020-05-14 07:41:58 +00:00
# exchange_arguments = {"hash_property" = "timestamp"}
2018-06-03 23:31:11 +00:00
2017-03-03 18:24:50 +00:00
## AMQP queue name
queue = "telegraf"
2018-11-05 21:34:28 +00:00
2018-09-05 21:27:52 +00:00
## AMQP queue durability can be "transient" or "durable".
queue_durability = "durable"
2018-11-05 21:34:28 +00:00
2019-05-20 21:38:35 +00:00
## If true, queue will be passively declared.
# queue_passive = false
## A binding between the exchange and queue using this binding key is
## created. If unset, no binding is created.
2017-03-03 18:24:50 +00:00
binding_key = "#"
2018-06-03 23:31:11 +00:00
## Maximum number of messages server should give to the worker.
2018-06-04 01:12:48 +00:00
# prefetch_count = 50
2017-03-03 18:24:50 +00:00
2018-11-05 21:34:28 +00:00
## 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
2018-06-03 23:31:11 +00:00
## Auth method. PLAIN and EXTERNAL are supported
2017-03-03 18:24:50 +00:00
## Using EXTERNAL requires enabling the rabbitmq_auth_mechanism_ssl plugin as
## described here: https://www.rabbitmq.com/plugins.html
# auth_method = "PLAIN"
2018-06-03 23:31:11 +00:00
2018-05-04 23:33:23 +00:00
## Optional TLS Config
# tls_ca = "/etc/telegraf/ca.pem"
# tls_cert = "/etc/telegraf/cert.pem"
# tls_key = "/etc/telegraf/key.pem"
## Use TLS but skip chain & host verification
2017-03-03 18:24:50 +00:00
# insecure_skip_verify = false
2019-05-20 21:36:23 +00:00
## Content encoding for message payloads, can be set to "gzip" to or
## "identity" to apply no encoding.
# content_encoding = "identity"
2017-08-24 20:17:29 +00:00
## Data format to consume.
2017-04-27 21:59:18 +00:00
## Each data format has its own unique set of configuration options, read
2017-03-03 18:24:50 +00:00
## more about them here:
2017-08-24 20:17:29 +00:00
## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md
2017-03-03 18:24:50 +00:00
data_format = "influx"
```