add backwards-compatability for 'plugins', remove [inputs] and [outputs] headers
This commit is contained in:
parent
7499c1f969
commit
6496d185ab
|
@ -7,7 +7,7 @@ be "aggregator plugins" and "filter plugins" in the future. Additionally,
|
|||
`inputs/` and `outputs/` directories have been placed in the root-level `plugins/`
|
||||
directory.
|
||||
- **breaking change** the `io` plugin has been renamed `diskio`
|
||||
- **breaking change** Plugin measurements aggregated into a single measurement.
|
||||
- **breaking change** plugin measurements aggregated into a single measurement.
|
||||
- **breaking change** `jolokia` plugin: must use global tag/drop/pass parameters
|
||||
for configuration.
|
||||
- **breaking change** `twemproxy` plugin: `prefix` option removed.
|
||||
|
|
|
@ -24,27 +24,27 @@ InfluxDB.
|
|||
|
||||
## Input Configuration
|
||||
|
||||
There are some configuration options that are configurable per plugin:
|
||||
There are some configuration options that are configurable per input:
|
||||
|
||||
* **name_override**: Override the base name of the measurement.
|
||||
(Default is the name of the plugin).
|
||||
(Default is the name of the input).
|
||||
* **name_prefix**: Specifies a prefix to attach to the measurement name.
|
||||
* **name_suffix**: Specifies a suffix to attach to the measurement name.
|
||||
* **tags**: A map of tags to apply to a specific plugin's measurements.
|
||||
* **tags**: A map of tags to apply to a specific input's measurements.
|
||||
* **interval**: How often to gather this metric. Normal plugins use a single
|
||||
global interval, but if one particular plugin should be run less or more often,
|
||||
global interval, but if one particular input should be run less or more often,
|
||||
you can configure that here.
|
||||
|
||||
### Input Filters
|
||||
|
||||
There are also filters that can be configured per plugin:
|
||||
There are also filters that can be configured per input:
|
||||
|
||||
* **pass**: An array of strings that is used to filter metrics generated by the
|
||||
current plugin. Each string in the array is tested as a glob match against field names
|
||||
current input. Each string in the array is tested as a glob match against field names
|
||||
and if it matches, the field is emitted.
|
||||
* **drop**: The inverse of pass, if a field name matches, it is not emitted.
|
||||
* **tagpass**: tag names and arrays of strings that are used to filter
|
||||
measurements by the current plugin. Each string in the array is tested as a glob
|
||||
measurements by the current input. Each string in the array is tested as a glob
|
||||
match against the tag name, and if it matches the measurement is emitted.
|
||||
* **tagdrop**: The inverse of tagpass. If a tag matches, the measurement is not
|
||||
emitted. This is tested on measurements that have passed the tagpass test.
|
||||
|
@ -64,14 +64,12 @@ fields which begin with `time_`.
|
|||
interval = "10s"
|
||||
|
||||
# OUTPUTS
|
||||
[outputs]
|
||||
[[outputs.influxdb]]
|
||||
url = "http://192.168.59.103:8086" # required.
|
||||
database = "telegraf" # required.
|
||||
precision = "s"
|
||||
|
||||
# INPUTS
|
||||
[inputs]
|
||||
[[inputs.cpu]]
|
||||
percpu = true
|
||||
totalcpu = false
|
||||
|
@ -82,7 +80,6 @@ fields which begin with `time_`.
|
|||
### Input Config: tagpass and tagdrop
|
||||
|
||||
```toml
|
||||
[inputs]
|
||||
[[inputs.cpu]]
|
||||
percpu = true
|
||||
totalcpu = false
|
||||
|
|
|
@ -49,8 +49,6 @@
|
|||
# OUTPUTS #
|
||||
###############################################################################
|
||||
|
||||
[outputs]
|
||||
|
||||
# Configuration for influxdb server to send metrics to
|
||||
[[outputs.influxdb]]
|
||||
# The full HTTP or UDP endpoint URL for your InfluxDB instance.
|
||||
|
@ -79,8 +77,6 @@
|
|||
# INPUTS #
|
||||
###############################################################################
|
||||
|
||||
[inputs]
|
||||
|
||||
# Read metrics about cpu usage
|
||||
[[inputs.cpu]]
|
||||
# Whether to report per-cpu stats or not
|
||||
|
|
|
@ -287,7 +287,6 @@ var header = `# Telegraf configuration
|
|||
# OUTPUTS #
|
||||
###############################################################################
|
||||
|
||||
[outputs]
|
||||
`
|
||||
|
||||
var pluginHeader = `
|
||||
|
@ -296,7 +295,6 @@ var pluginHeader = `
|
|||
# INPUTS #
|
||||
###############################################################################
|
||||
|
||||
[inputs]
|
||||
`
|
||||
|
||||
var serviceInputHeader = `
|
||||
|
@ -470,7 +468,7 @@ func (c *Config) LoadConfig(path string) error {
|
|||
pluginName)
|
||||
}
|
||||
}
|
||||
case "inputs":
|
||||
case "inputs", "plugins":
|
||||
for pluginName, pluginVal := range subTable.Fields {
|
||||
switch pluginSubTable := pluginVal.(type) {
|
||||
case *ast.Table:
|
||||
|
|
|
@ -39,8 +39,6 @@
|
|||
# OUTPUTS #
|
||||
###############################################################################
|
||||
|
||||
[outputs]
|
||||
|
||||
# Configuration for influxdb server to send metrics to
|
||||
[[outputs.influxdb]]
|
||||
# The full HTTP endpoint URL for your InfluxDB instance
|
||||
|
@ -70,8 +68,6 @@
|
|||
# PLUGINS #
|
||||
###############################################################################
|
||||
|
||||
[inputs]
|
||||
|
||||
# Read Apache status information (mod_status)
|
||||
[[inputs.apache]]
|
||||
# An array of Apache status URI to gather stats.
|
||||
|
|
Loading…
Reference in New Issue