v0.10.1 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Jan 27, 2016 License: MIT Imports: 7 Imported by: 0


influxdb plugin

The influxdb plugin collects InfluxDB-formatted data from JSON endpoints.

With a configuration of:

  urls = [

And if responds with this JSON:

  "k1": {
    "name": "fruit",
    "tags": {
      "kind": "apple"
    "values": {
      "inventory": 371,
      "sold": 112
  "k2": {
    "name": "fruit",
    "tags": {
      "kind": "banana"
    "values": {
      "inventory": 1000,
      "sold": 403

And if responds like so:

  "k3": {
    "name": "transactions",
    "tags": {},
    "values": {
      "total": 100,
      "balance": 184.75

Then the collected metrics will be:

influxdb_fruit,url='',kind='apple' inventory=371.0,sold=112.0
influxdb_fruit,url='',kind='banana' inventory=1000.0,sold=403.0

influxdb_transactions,url='' total=100.0,balance=184.75

There are two important details to note about the collected metrics:

  1. Even though the values in JSON are being displayed as integers, the metrics are reported as floats. JSON encoders usually don't print the fractional part for round floats. Because you cannot change the type of an existing field in InfluxDB, we assume all numbers are floats.

  2. The top-level keys' names (in the example above, "k1", "k2", and "k3") are not considered when recording the metrics.




This section is empty.


This section is empty.


This section is empty.


type InfluxDB

type InfluxDB struct {
	URLs []string `toml:"urls"`

func (*InfluxDB) Description

func (*InfluxDB) Description() string

func (*InfluxDB) Gather

func (i *InfluxDB) Gather(acc inputs.Accumulator) error

func (*InfluxDB) SampleConfig

func (*InfluxDB) SampleConfig() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL