2017-03-04 02:24:50 +08:00
|
|
|
# AMQP Consumer Input Plugin
|
|
|
|
|
|
2022-06-08 05:10:18 +08: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-04 02:24:50 +08:00
|
|
|
|
2022-06-08 05:10:18 +08:00
|
|
|
Metrics are read from a topic exchange using the configured queue and
|
|
|
|
|
binding_key.
|
2017-03-04 02:24:50 +08:00
|
|
|
|
2022-06-08 05:10:18 +08:00
|
|
|
Message payload should be formatted in one of the [Telegraf Data
|
|
|
|
|
Formats](../../../docs/DATA_FORMATS_INPUT.md).
|
2017-03-04 02:24:50 +08:00
|
|
|
|
|
|
|
|
For an introduction to AMQP see:
|
2021-11-25 02:55:55 +08:00
|
|
|
|
|
|
|
|
- [amqp - concepts](https://www.rabbitmq.com/tutorials/amqp-concepts.html)
|
|
|
|
|
- [rabbitmq: getting started](https://www.rabbitmq.com/getstarted.html)
|
2017-03-04 02:24:50 +08:00
|
|
|
|
2023-03-27 20:12:35 +08:00
|
|
|
## Service Input <!-- @/docs/includes/service_input.md -->
|
|
|
|
|
|
|
|
|
|
This plugin is a service input. Normal plugins gather metrics determined by the
|
|
|
|
|
interval setting. Service plugins start a service to listens and waits 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
|
|
|
|
|
|
2022-10-27 03:58:36 +08:00
|
|
|
## Global configuration options <!-- @/docs/includes/plugin_config.md -->
|
|
|
|
|
|
|
|
|
|
In addition to the plugin-specific configuration settings, plugins support
|
|
|
|
|
additional global and plugin configuration settings. These settings are used to
|
|
|
|
|
modify metrics, tags, and field or create aliases and configure ordering, etc.
|
|
|
|
|
See the [CONFIGURATION.md][CONFIGURATION.md] for more details.
|
|
|
|
|
|
2023-01-12 23:55:21 +08:00
|
|
|
[CONFIGURATION.md]: ../../../docs/CONFIGURATION.md#plugins
|
2022-10-27 03:58:36 +08:00
|
|
|
|
2022-04-08 06:01:21 +08:00
|
|
|
## Configuration
|
|
|
|
|
|
2022-05-24 21:49:47 +08:00
|
|
|
```toml @sample.conf
|
2022-04-08 06:01:21 +08:00
|
|
|
# AMQP consumer plugin
|
2017-03-04 02:24:50 +08:00
|
|
|
[[inputs.amqp_consumer]]
|
2018-06-04 08:05:33 +08:00
|
|
|
## 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-04 07:31:11 +08:00
|
|
|
|
2019-05-21 05:38:35 +08:00
|
|
|
## Name of the exchange to declare. If unset, no exchange will be declared.
|
2017-03-04 02:24:50 +08:00
|
|
|
exchange = "telegraf"
|
2018-06-04 07:31:11 +08: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 09:42:08 +08:00
|
|
|
# exchange_arguments = { }
|
2020-05-14 15:41:58 +08:00
|
|
|
# exchange_arguments = {"hash_property" = "timestamp"}
|
2018-06-04 07:31:11 +08:00
|
|
|
|
2021-04-27 04:57:05 +08:00
|
|
|
## AMQP queue name.
|
2017-03-04 02:24:50 +08:00
|
|
|
queue = "telegraf"
|
2018-11-06 05:34:28 +08:00
|
|
|
|
2018-09-06 05:27:52 +08:00
|
|
|
## AMQP queue durability can be "transient" or "durable".
|
|
|
|
|
queue_durability = "durable"
|
2018-11-06 05:34:28 +08:00
|
|
|
|
2019-05-21 05:38:35 +08: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-04 02:24:50 +08:00
|
|
|
binding_key = "#"
|
|
|
|
|
|
2018-06-04 07:31:11 +08:00
|
|
|
## Maximum number of messages server should give to the worker.
|
2018-06-04 09:12:48 +08:00
|
|
|
# prefetch_count = 50
|
2017-03-04 02:24:50 +08:00
|
|
|
|
2023-02-13 23:05:15 +08:00
|
|
|
## 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.
|
2018-11-06 05:34:28 +08:00
|
|
|
##
|
2023-02-13 23:05:15 +08:00
|
|
|
## 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.
|
2018-11-06 05:34:28 +08:00
|
|
|
# max_undelivered_messages = 1000
|
|
|
|
|
|
2018-06-04 07:31:11 +08:00
|
|
|
## Auth method. PLAIN and EXTERNAL are supported
|
2017-03-04 02:24:50 +08: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-04 07:31:11 +08:00
|
|
|
|
2018-05-05 07:33:23 +08: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-04 02:24:50 +08:00
|
|
|
# insecure_skip_verify = false
|
|
|
|
|
|
2022-09-27 03:28:32 +08:00
|
|
|
## Content encoding for message payloads, can be set to
|
|
|
|
|
## "gzip", "identity" or "auto"
|
|
|
|
|
## - Use "gzip" to decode gzip
|
|
|
|
|
## - Use "identity" to apply no encoding
|
|
|
|
|
## - Use "auto" determine the encoding using the ContentEncoding header
|
2019-05-21 05:36:23 +08:00
|
|
|
# content_encoding = "identity"
|
|
|
|
|
|
2017-08-25 04:17:29 +08:00
|
|
|
## Data format to consume.
|
2017-04-28 05:59:18 +08:00
|
|
|
## Each data format has its own unique set of configuration options, read
|
2017-03-04 02:24:50 +08:00
|
|
|
## more about them here:
|
2017-08-25 04:17:29 +08:00
|
|
|
## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md
|
2017-03-04 02:24:50 +08:00
|
|
|
data_format = "influx"
|
|
|
|
|
```
|
2022-09-27 03:28:32 +08:00
|
|
|
|
|
|
|
|
## Metrics
|
|
|
|
|
|
|
|
|
|
TODO
|
|
|
|
|
|
|
|
|
|
## Example Output
|
|
|
|
|
|
|
|
|
|
TODO
|