From ca75636da31b93a4bd3e90f439ff0238bb72d350 Mon Sep 17 00:00:00 2001 From: Martin Seener Date: Mon, 30 May 2016 14:45:21 +0200 Subject: [PATCH] Also added reasonable default for influxdb input plugin to simplifying configuration for most users --- CHANGELOG.md | 2 +- etc/telegraf.conf | 1 + plugins/inputs/influxdb/README.md | 1 + plugins/inputs/influxdb/influxdb.go | 4 ++++ 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index faa36cf38..097ee206e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,7 +26,7 @@ time before a new metric is included by the plugin. - [#1265](https://github.com/influxdata/telegraf/pull/1265): Make dns lookups for chrony configurable. Thanks @zbindenren! - [#1275](https://github.com/influxdata/telegraf/pull/1275): Allow wildcard filtering of varnish stats. - [#1142](https://github.com/influxdata/telegraf/pull/1142): Support for glob patterns in exec plugin commands configuration. -- [#1278](https://github.com/influxdata/telegraf/pull/1278): RabbitMQ input: made url parameter optional by using DefaultURL (http://localhost:15672) if not specified +- [#1278](https://github.com/influxdata/telegraf/pull/1278) & [#1288](https://github.com/influxdata/telegraf/pull/1288) & [#1295](https://github.com/influxdata/telegraf/pull/1295): RabbitMQ/Apache/InfluxDB inputs: made url(s) parameter optional by using reasonable input defaults if not specified ### Bugfixes diff --git a/etc/telegraf.conf b/etc/telegraf.conf index 4081cf484..ebfc82e49 100644 --- a/etc/telegraf.conf +++ b/etc/telegraf.conf @@ -746,6 +746,7 @@ # ## See the influxdb plugin's README for more details. # # ## Multiple URLs from which to read InfluxDB-formatted JSON +# ## Default is "http://localhost:8086/debug/vars". # urls = [ # "http://localhost:8086/debug/vars" # ] diff --git a/plugins/inputs/influxdb/README.md b/plugins/inputs/influxdb/README.md index 433191495..c983e9749 100644 --- a/plugins/inputs/influxdb/README.md +++ b/plugins/inputs/influxdb/README.md @@ -15,6 +15,7 @@ InfluxDB-formatted endpoints. See below for more information. ## See the influxdb plugin's README for more details. ## Multiple URLs from which to read InfluxDB-formatted JSON + ## Default is "http://localhost:8086/debug/vars". urls = [ "http://localhost:8086/debug/vars" ] diff --git a/plugins/inputs/influxdb/influxdb.go b/plugins/inputs/influxdb/influxdb.go index 6a53ecdcb..974a1b9e7 100644 --- a/plugins/inputs/influxdb/influxdb.go +++ b/plugins/inputs/influxdb/influxdb.go @@ -28,6 +28,7 @@ func (*InfluxDB) SampleConfig() string { ## See the influxdb plugin's README for more details. ## Multiple URLs from which to read InfluxDB-formatted JSON + ## Default is "http://localhost:8086/debug/vars". urls = [ "http://localhost:8086/debug/vars" ] @@ -35,6 +36,9 @@ func (*InfluxDB) SampleConfig() string { } func (i *InfluxDB) Gather(acc telegraf.Accumulator) error { + if len(i.URLs) == 0 { + i.URLs = []string{"http://localhost:8086/debug/vars"} + } errorChannel := make(chan error, len(i.URLs)) var wg sync.WaitGroup