Update mqtt output docs and changelog

This commit is contained in:
Daniel Nelson 2018-05-18 19:03:00 -07:00
parent cbb4dacbc3
commit 3f89f35f3f
4 changed files with 97 additions and 27 deletions

View File

@ -44,6 +44,7 @@
- [#3455](https://github.com/influxdata/telegraf/pull/3455): Add tag/integer pair for result to net_response. - [#3455](https://github.com/influxdata/telegraf/pull/3455): Add tag/integer pair for result to net_response.
- [#4010](https://github.com/influxdata/telegraf/pull/3455): Add application_insights output plugin. - [#4010](https://github.com/influxdata/telegraf/pull/3455): Add application_insights output plugin.
- [#4167](https://github.com/influxdata/telegraf/pull/4167): Added several important elasticsearch cluster health metrics. - [#4167](https://github.com/influxdata/telegraf/pull/4167): Added several important elasticsearch cluster health metrics.
- [#4094](https://github.com/influxdata/telegraf/pull/4094): Add batch mode to mqtt output.
### Bugfixes ### Bugfixes

View File

@ -198,6 +198,26 @@
# data_format = "influx" # data_format = "influx"
# # Send metrics to Azure Application Insights
# [[outputs.application_insights]]
# ## Instrumentation key of the Application Insights resource.
# instrumentation_key = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx"
#
# ## Timeout for closing (default: 5s).
# # timeout = "5s"
#
# ## Enable additional diagnostic logging.
# # enable_diagnosic_logging = false
#
# ## Context Tag Sources add Application Insights context tags to a tag value.
# ##
# ## For list of allowed context tag keys see:
# ## https://github.com/Microsoft/ApplicationInsights-Go/blob/master/appinsights/contracts/contexttagkeys.go
# # [outputs.application_insights.context_tag_sources]
# # "ai.cloud.role" = "kubernetes_container_name"
# # "ai.cloud.roleInstance" = "kubernetes_pod_name"
# # Configuration for AWS CloudWatch output. # # Configuration for AWS CloudWatch output.
# [[outputs.cloudwatch]] # [[outputs.cloudwatch]]
# ## Amazon REGION # ## Amazon REGION
@ -341,6 +361,40 @@
# servers = ["127.0.0.1:12201", "192.168.1.1:12201"] # servers = ["127.0.0.1:12201", "192.168.1.1:12201"]
# # A plugin that can transmit metrics over HTTP
# [[outputs.http]]
# ## URL is the address to send metrics to
# url = "http://127.0.0.1:8080/metric"
#
# ## Timeout for HTTP message
# # timeout = "5s"
#
# ## HTTP method, one of: "POST" or "PUT"
# # method = "POST"
#
# ## HTTP Basic Auth credentials
# # username = "username"
# # password = "pa$$word"
#
# ## Additional HTTP headers
# # [outputs.http.headers]
# # # Should be set to "application/json" for json data_format
# # Content-Type = "text/plain; charset=utf-8"
#
# ## 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
#
# ## Data format to output.
# ## Each data format has it's own unique set of configuration options, read
# ## more about them here:
# ## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_OUTPUT.md
# # data_format = "influx"
# # Configuration for sending metrics to an Instrumental project # # Configuration for sending metrics to an Instrumental project
# [[outputs.instrumental]] # [[outputs.instrumental]]
# ## Project API Token (required) # ## Project API Token (required)
@ -527,16 +581,22 @@
# ## ex: prefix/web01.example.com/mem # ## ex: prefix/web01.example.com/mem
# topic_prefix = "telegraf" # topic_prefix = "telegraf"
# #
# ## QoS policy for messages
# ## 0 = at most once
# ## 1 = at least once
# ## 2 = exactly once
# # qos = 2
#
# ## username and password to connect MQTT server. # ## username and password to connect MQTT server.
# # username = "telegraf" # # username = "telegraf"
# # password = "metricsmetricsmetricsmetrics" # # password = "metricsmetricsmetricsmetrics"
# #
# ## Timeout for write operations. default: 5s
# # timeout = "5s"
#
# ## client ID, if not set a random ID is generated # ## client ID, if not set a random ID is generated
# # client_id = "" # # client_id = ""
# #
# ## Timeout for write operations. default: 5s
# # timeout = "5s"
#
# ## Optional TLS Config # ## Optional TLS Config
# # tls_ca = "/etc/telegraf/ca.pem" # # tls_ca = "/etc/telegraf/ca.pem"
# # tls_cert = "/etc/telegraf/cert.pem" # # tls_cert = "/etc/telegraf/cert.pem"
@ -544,6 +604,10 @@
# ## Use TLS but skip chain & host verification # ## Use TLS but skip chain & host verification
# # insecure_skip_verify = false # # insecure_skip_verify = false
# #
# ## When true, metrics will be sent in one MQTT message per flush. Otherwise,
# ## metrics are written one metric per MQTT message.
# # batch = false
#
# ## Data format to output. # ## Data format to output.
# ## Each data format has its own unique set of configuration options, read # ## Each data format has its own unique set of configuration options, read
# ## more about them here: # ## more about them here:
@ -1169,6 +1233,11 @@
# # tls_key = "/etc/telegraf/key.pem" # # tls_key = "/etc/telegraf/key.pem"
# ## Use TLS but skip chain & host verification # ## Use TLS but skip chain & host verification
# # insecure_skip_verify = true # # insecure_skip_verify = true
#
# ## Consul checks' tag splitting
# # When tags are formatted like "key:value" with ":" as a delimiter then
# # they will be splitted and reported as proper key:value in Telegraf
# # tag_delimiter = ":"
# # Read metrics from one or many couchbase clusters # # Read metrics from one or many couchbase clusters
@ -1791,19 +1860,19 @@
# ## List of metrics collected on above servers # ## List of metrics collected on above servers
# ## Each metric consists in a name, a jmx path and either # ## Each metric consists in a name, a jmx path and either
# ## a pass or drop slice attribute. # ## a pass or drop slice attribute.
# ## This collect all heap memory usage metrics. # ## This collect all heap memory usage metrics.
# [[inputs.jolokia.metrics]] # [[inputs.jolokia.metrics]]
# name = "heap_memory_usage" # name = "heap_memory_usage"
# mbean = "java.lang:type=Memory" # mbean = "java.lang:type=Memory"
# attribute = "HeapMemoryUsage" # attribute = "HeapMemoryUsage"
# #
# ## This collect thread counts metrics. # ## This collect thread counts metrics.
# [[inputs.jolokia.metrics]] # [[inputs.jolokia.metrics]]
# name = "thread_count" # name = "thread_count"
# mbean = "java.lang:type=Threading" # mbean = "java.lang:type=Threading"
# attribute = "TotalStartedThreadCount,ThreadCount,DaemonThreadCount,PeakThreadCount" # attribute = "TotalStartedThreadCount,ThreadCount,DaemonThreadCount,PeakThreadCount"
# #
# ## This collect number of class loaded/unloaded counts metrics. # ## This collect number of class loaded/unloaded counts metrics.
# [[inputs.jolokia.metrics]] # [[inputs.jolokia.metrics]]
# name = "class_count" # name = "class_count"
# mbean = "java.lang:type=ClassLoading" # mbean = "java.lang:type=ClassLoading"
@ -3561,3 +3630,4 @@
# [[inputs.zipkin]] # [[inputs.zipkin]]
# # path = "/api/v1/spans" # URL path for span data # # path = "/api/v1/spans" # URL path for span data
# # port = 9411 # Port on which Telegraf listens # # port = 9411 # Port on which Telegraf listens

View File

@ -11,6 +11,9 @@ This plugin writes to a [MQTT Broker](http://http://mqtt.org/) acting as a mqtt
topic_prefix = "telegraf" topic_prefix = "telegraf"
## QoS policy for messages ## QoS policy for messages
## 0 = at most once
## 1 = at least once
## 2 = exactly once
qos = 2 qos = 2
## username and password to connect MQTT server. ## username and password to connect MQTT server.
@ -30,17 +33,12 @@ This plugin writes to a [MQTT Broker](http://http://mqtt.org/) acting as a mqtt
## Use TLS but skip chain & host verification ## Use TLS but skip chain & host verification
# insecure_skip_verify = false # insecure_skip_verify = false
## Batch messages in a topic ## When true, metrics will be sent in one MQTT message per flush. Otherwise,
## batch = false ## metrics are written one metric per MQTT message.
## Flag to determine if messages sent in a topic in a flush interval,
## need to be batched into one message.
## batch = true, batches the messages in a topic to one messages
## batch = false, default behaviour
# batch = false # batch = false
## Data format to output. ## Data format to output.
data_format = "influx" # data_format = "influx"
``` ```
### Required parameters: ### Required parameters:

View File

@ -23,16 +23,22 @@ var sampleConfig = `
## ex: prefix/web01.example.com/mem ## ex: prefix/web01.example.com/mem
topic_prefix = "telegraf" topic_prefix = "telegraf"
## QoS policy for messages
## 0 = at most once
## 1 = at least once
## 2 = exactly once
# qos = 2
## username and password to connect MQTT server. ## username and password to connect MQTT server.
# username = "telegraf" # username = "telegraf"
# password = "metricsmetricsmetricsmetrics" # password = "metricsmetricsmetricsmetrics"
## Timeout for write operations. default: 5s
# timeout = "5s"
## client ID, if not set a random ID is generated ## client ID, if not set a random ID is generated
# client_id = "" # client_id = ""
## Timeout for write operations. default: 5s
# timeout = "5s"
## Optional TLS Config ## Optional TLS Config
# tls_ca = "/etc/telegraf/ca.pem" # tls_ca = "/etc/telegraf/ca.pem"
# tls_cert = "/etc/telegraf/cert.pem" # tls_cert = "/etc/telegraf/cert.pem"
@ -40,20 +46,15 @@ var sampleConfig = `
## Use TLS but skip chain & host verification ## Use TLS but skip chain & host verification
# insecure_skip_verify = false # insecure_skip_verify = false
## When true, metrics will be sent in one MQTT message per flush. Otherwise,
## metrics are written one metric per MQTT message.
# batch = false
## Data format to output. ## Data format to output.
## Each data format has its own unique set of configuration options, read ## Each data format has its own unique set of configuration options, read
## more about them here: ## more about them here:
## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_OUTPUT.md ## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_OUTPUT.md
data_format = "influx" data_format = "influx"
## Batch messages in a topic
## batch = false
## Flag to determine if messages sent in a topic in a flush interval,
## need to be batched into one message.
## batch = true, batches the messages in a topic to one messages
## batch = false, default behaviour
# batch = false
` `
type MQTT struct { type MQTT struct {