Remove 'Name' argument from influxdb plugin for 0.3.0 compatability

closes #449
This commit is contained in:
Cameron Sparr 2015-12-18 16:21:39 -07:00
parent 4f3d6ddf17
commit 0571eecb0c
4 changed files with 9 additions and 12 deletions

View File

@ -3,6 +3,7 @@
### Features
- [#427](https://github.com/influxdb/telegraf/pull/427): zfs plugin: pool stats added. Thanks @allenpetersen!
- [#428](https://github.com/influxdb/telegraf/pull/428): Amazon Kinesis output. Thanks @jimmystewpot!
- [#449](https://github.com/influxdb/telegraf/pull/449): influxdb plugin, thanks @mark-rushakoff
### Bugfixes
- [#430](https://github.com/influxdb/telegraf/issues/430): Network statistics removed in elasticsearch 2.1. Thanks @jipperinbham!

View File

@ -199,6 +199,7 @@ Telegraf currently has support for collecting metrics from:
* exec (generic JSON-emitting executable plugin)
* haproxy
* httpjson (generic JSON-emitting http service plugin)
* influxdb
* jolokia (remote JMX with JSON over HTTP)
* leofs
* lustre2

View File

@ -6,7 +6,6 @@ With a configuration of:
```toml
[[plugins.influxdb]]
name = "produce"
urls = [
"http://127.0.0.1:8086/debug/vars",
"http://192.168.2.1:8086/debug/vars"
@ -58,10 +57,10 @@ And if 192.168.2.1 responds like so:
Then the collected metrics will be:
```
influxdb_produce_fruit,url='http://127.0.0.1:8086/debug/vars',kind='apple' inventory=371.0,sold=112.0
influxdb_produce_fruit,url='http://127.0.0.1:8086/debug/vars',kind='banana' inventory=1000.0,sold=403.0
influxdb_fruit,url='http://127.0.0.1:8086/debug/vars',kind='apple' inventory=371.0,sold=112.0
influxdb_fruit,url='http://127.0.0.1:8086/debug/vars',kind='banana' inventory=1000.0,sold=403.0
influxdb_produce_transactions,url='http://192.168.2.1:8086/debug/vars' total=100.0,balance=184.75
influxdb_transactions,url='http://192.168.2.1:8086/debug/vars' total=100.0,balance=184.75
```
There are two important details to note about the collected metrics:

View File

@ -12,7 +12,6 @@ import (
)
type InfluxDB struct {
Name string
URLs []string `toml:"urls"`
}
@ -22,12 +21,9 @@ func (*InfluxDB) Description() string {
func (*InfluxDB) SampleConfig() string {
return `
# Reads InfluxDB-formatted JSON from given URLs.
# Works with InfluxDB debug endpoints out of the box, but other services can use this format too.
# Works with InfluxDB debug endpoints out of the box,
# but other services can use this format too.
# See the influxdb plugin's README for more details.
[[plugins.influxdb]]
# Name to use for measurement
name = "influxdb"
# Multiple URLs from which to read InfluxDB-formatted JSON
urls = [
@ -45,7 +41,7 @@ func (i *InfluxDB) Gather(acc plugins.Accumulator) error {
go func(url string) {
defer wg.Done()
if err := i.gatherURL(acc, url); err != nil {
errorChannel <- fmt.Errorf("[name=%s][url=%s]: %s", i.Name, url, err)
errorChannel <- fmt.Errorf("[url=%s]: %s", url, err)
}
}(u)
}
@ -134,7 +130,7 @@ func (i *InfluxDB) gatherURL(
p.Tags["url"] = url
acc.AddFields(
i.Name+"_"+p.Name,
p.Name,
p.Values,
p.Tags,
)