2015-09-16 00:25:56 +00:00
|
|
|
# AMQP Output Plugin
|
|
|
|
|
2017-03-03 18:24:50 +00:00
|
|
|
This plugin writes to a AMQP 0-9-1 Exchange, a promenent implementation of this protocol being [RabbitMQ](https://www.rabbitmq.com/).
|
|
|
|
|
2018-06-03 22:52:00 +00:00
|
|
|
Metrics are written to a topic exchange using a routing key defined by:
|
|
|
|
1. The routing_key config defines a static value
|
|
|
|
2. The routing_tag config defines a metric tag with a dynamic value, overriding the static routing_key if found
|
|
|
|
3. If neither option is defined, or the tag is not found in a metric, then the empty routing key will be used
|
2015-09-16 00:25:56 +00:00
|
|
|
|
2018-06-03 22:52:00 +00:00
|
|
|
Metrics are grouped in batches by the final routing key.
|
2015-09-16 00:25:56 +00:00
|
|
|
|
2018-06-03 22:52:00 +00:00
|
|
|
This plugin doesn't bind exchange to a queue, so it should be done by consumer. The exchange is always defined as type: topic.
|
|
|
|
To use it for distributing metrics equally among workers (type: direct), set the routing_key to a static value on the exchange,
|
|
|
|
declare and bind a single queue with the same routing_key, and consume from the same queue in each worker.
|
|
|
|
To use it to send metrics to many consumers at once (type: fanout), set the routing_key to "#" on the exchange, then declare, bind,
|
|
|
|
and consume from individual queues in each worker.
|
2017-01-13 17:02:10 +00:00
|
|
|
|
2017-03-03 18:24:50 +00:00
|
|
|
For an introduction to AMQP see:
|
|
|
|
- https://www.rabbitmq.com/tutorials/amqp-concepts.html
|
|
|
|
- https://www.rabbitmq.com/getstarted.html
|
|
|
|
|
2017-01-13 17:02:10 +00:00
|
|
|
### Configuration:
|
|
|
|
|
2018-06-03 23:31:11 +00:00
|
|
|
```toml
|
2017-01-13 17:02:10 +00:00
|
|
|
# Configuration for the AMQP server to send metrics to
|
|
|
|
[[outputs.amqp]]
|
|
|
|
## AMQP url
|
|
|
|
url = "amqp://localhost:5672/influxdb"
|
2018-06-03 23:31:11 +00:00
|
|
|
|
|
|
|
## Exchange to declare and publish to.
|
2017-01-13 17:02:10 +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.
|
|
|
|
# exchange_args = { }
|
|
|
|
# exchange_args = {"hash_propery" = "timestamp"}
|
|
|
|
|
2017-01-13 17:02:10 +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
|
2017-01-13 17:02:10 +00:00
|
|
|
# auth_method = "PLAIN"
|
2018-06-03 22:52:00 +00:00
|
|
|
## Topic routing key
|
|
|
|
# routing_key = ""
|
2017-01-13 17:02:10 +00:00
|
|
|
## Telegraf tag to use as a routing key
|
2017-04-27 21:59:18 +00:00
|
|
|
## ie, if this tag exists, its value will be used as the routing key
|
2018-06-03 22:52:00 +00:00
|
|
|
## and override routing_key config even if defined
|
2017-01-13 17:02:10 +00:00
|
|
|
routing_tag = "host"
|
2017-12-01 02:40:12 +00:00
|
|
|
## Delivery Mode controls if a published message is persistent
|
|
|
|
## Valid options are "transient" and "persistent". default: "transient"
|
2018-06-03 23:31:11 +00:00
|
|
|
delivery_mode = "transient"
|
2017-01-13 17:02:10 +00:00
|
|
|
|
|
|
|
## InfluxDB retention policy
|
|
|
|
# retention_policy = "default"
|
|
|
|
## InfluxDB database
|
|
|
|
# database = "telegraf"
|
|
|
|
|
2017-04-27 18:10:30 +00:00
|
|
|
## Write timeout, formatted as a string. If not provided, will default
|
|
|
|
## to 5s. 0s means no timeout (not recommended).
|
|
|
|
# timeout = "5s"
|
|
|
|
|
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-01-13 17:02:10 +00:00
|
|
|
# insecure_skip_verify = false
|
|
|
|
|
|
|
|
## Data format to output.
|
2017-04-27 21:59:18 +00:00
|
|
|
## Each data format has its own unique set of configuration options, read
|
2017-01-13 17:02:10 +00:00
|
|
|
## more about them here:
|
|
|
|
## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_OUTPUT.md
|
|
|
|
data_format = "influx"
|
|
|
|
```
|