2016-02-09 22:03:46 +00:00
|
|
|
# NATS Consumer Input Plugin
|
2016-02-10 23:28:52 +00:00
|
|
|
|
2018-11-05 21:34:28 +00:00
|
|
|
The [NATS][nats] consumer plugin reads from the specified NATS subjects and
|
|
|
|
creates metrics using one of the supported [input data formats][].
|
2016-02-10 23:28:52 +00:00
|
|
|
|
2018-11-05 21:34:28 +00:00
|
|
|
A [Queue Group][queue group] is used when subscribing to subjects so multiple
|
|
|
|
instances of telegraf can read from a NATS cluster in parallel.
|
|
|
|
|
|
|
|
### Configuration:
|
2016-02-09 22:03:46 +00:00
|
|
|
|
|
|
|
```toml
|
2016-02-10 23:28:52 +00:00
|
|
|
[[inputs.nats_consumer]]
|
2016-02-18 21:26:51 +00:00
|
|
|
## urls of NATS servers
|
2016-02-10 23:28:52 +00:00
|
|
|
servers = ["nats://localhost:4222"]
|
2016-02-18 21:26:51 +00:00
|
|
|
## subject(s) to consume
|
2016-02-10 23:28:52 +00:00
|
|
|
subjects = ["telegraf"]
|
2016-02-18 21:26:51 +00:00
|
|
|
## name a queue group
|
2016-02-10 23:28:52 +00:00
|
|
|
queue_group = "telegraf_consumers"
|
2016-02-09 22:03:46 +00:00
|
|
|
|
2019-08-02 20:10:14 +00:00
|
|
|
## Optional credentials
|
|
|
|
# username = ""
|
|
|
|
# password = ""
|
|
|
|
|
2019-08-02 21:59:28 +00:00
|
|
|
## Use Transport Layer Security
|
|
|
|
# secure = false
|
|
|
|
|
2019-08-02 20:10:14 +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
|
|
|
|
# insecure_skip_verify = false
|
|
|
|
|
2018-11-05 21:34:28 +00:00
|
|
|
## Sets the limits for pending msgs and bytes for each subscription
|
|
|
|
## These shouldn't need to be adjusted except in very high throughput scenarios
|
|
|
|
# pending_message_limit = 65536
|
|
|
|
# pending_bytes_limit = 67108864
|
|
|
|
|
|
|
|
## 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
|
2016-04-05 20:42:20 +00:00
|
|
|
|
2018-11-05 21:34:28 +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
|
2016-02-18 21:26:51 +00:00
|
|
|
## more about them here:
|
|
|
|
## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md
|
2016-02-10 23:28:52 +00:00
|
|
|
data_format = "influx"
|
|
|
|
```
|
2018-11-05 21:34:28 +00:00
|
|
|
|
|
|
|
[nats]: https://www.nats.io/about/
|
|
|
|
[input data formats]: /docs/DATA_FORMATS_INPUT.md
|
|
|
|
[queue group]: https://www.nats.io/documentation/concepts/nats-queueing/
|