Skip to content

Commit

Permalink
Cleanup comments and indentation in config file
Browse files Browse the repository at this point in the history
  • Loading branch information
sparrc committed Feb 9, 2016
1 parent fb75db2 commit fc7fa4b
Show file tree
Hide file tree
Showing 45 changed files with 237 additions and 242 deletions.
38 changes: 20 additions & 18 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@ func (c *Config) ListTags() string {
return strings.Join(tags, " ")
}

var header = `# Telegraf configuration
var header = `###############################################################################
# Telegraf Configuration #
###############################################################################
# Telegraf is entirely plugin driven. All metrics are gathered from the
# declared inputs, and sent to the declared outputs.
Expand All @@ -145,35 +147,35 @@ var header = `# Telegraf configuration
# Configuration for telegraf agent
[agent]
# Default data collection interval for all inputs
### Default data collection interval for all inputs
interval = "10s"
# Rounds collection interval to 'interval'
# ie, if interval="10s" then always collect on :00, :10, :20, etc.
### Rounds collection interval to 'interval'
### ie, if interval="10s" then always collect on :00, :10, :20, etc.
round_interval = true
# Telegraf will cache metric_buffer_limit metrics for each output, and will
# flush this buffer on a successful write.
### Telegraf will cache metric_buffer_limit metrics for each output, and will
### flush this buffer on a successful write.
metric_buffer_limit = 10000
# Collection jitter is used to jitter the collection by a random amount.
# Each plugin will sleep for a random time within jitter before collecting.
# This can be used to avoid many plugins querying things like sysfs at the
# same time, which can have a measurable effect on the system.
### Collection jitter is used to jitter the collection by a random amount.
### Each plugin will sleep for a random time within jitter before collecting.
### This can be used to avoid many plugins querying things like sysfs at the
### same time, which can have a measurable effect on the system.
collection_jitter = "0s"
# Default data flushing interval for all outputs. You should not set this below
# interval. Maximum flush_interval will be flush_interval + flush_jitter
### Default flushing interval for all outputs. You shouldn't set this below
### interval. Maximum flush_interval will be flush_interval + flush_jitter
flush_interval = "10s"
# Jitter the flush interval by a random amount. This is primarily to avoid
# large write spikes for users running a large number of telegraf instances.
# ie, a jitter of 5s and interval 10s means flushes will happen every 10-15s
### Jitter the flush interval by a random amount. This is primarily to avoid
### large write spikes for users running a large number of telegraf instances.
### ie, a jitter of 5s and interval 10s means flushes will happen every 10-15s
flush_jitter = "0s"
# Run telegraf in debug mode
### Run telegraf in debug mode
debug = false
# Run telegraf in quiet mode
### Run telegraf in quiet mode
quiet = false
# Override default hostname, if empty use os.Hostname()
### Override default hostname, if empty use os.Hostname()
hostname = ""
Expand Down
8 changes: 3 additions & 5 deletions plugins/inputs/aerospike/aerospike.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,9 @@ type Aerospike struct {
}

var sampleConfig = `
# Aerospike servers to connect to (with port)
# Default: servers = ["localhost:3000"]
#
# This plugin will query all namespaces the aerospike
# server has configured and get stats for them.
### Aerospike servers to connect to (with port)
### This plugin will query all namespaces the aerospike
### server has configured and get stats for them.
servers = ["localhost:3000"]
`

Expand Down
2 changes: 1 addition & 1 deletion plugins/inputs/apache/apache.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type Apache struct {
}

var sampleConfig = `
# An array of Apache status URI to gather stats.
### An array of Apache status URI to gather stats.
urls = ["http://localhost/server-status?auto"]
`

Expand Down
16 changes: 8 additions & 8 deletions plugins/inputs/bcache/bcache.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ type Bcache struct {
}

var sampleConfig = `
# Bcache sets path
# If not specified, then default is:
# bcachePath = "/sys/fs/bcache"
#
# By default, telegraf gather stats for all bcache devices
# Setting devices will restrict the stats to the specified
# bcache devices.
# bcacheDevs = ["bcache0", ...]
### Bcache sets path
### If not specified, then default is:
bcachePath = "/sys/fs/bcache"
### By default, telegraf gather stats for all bcache devices
### Setting devices will restrict the stats to the specified
### bcache devices.
bcacheDevs = ["bcache0"]
`

func (b *Bcache) SampleConfig() string {
Expand Down
8 changes: 4 additions & 4 deletions plugins/inputs/couchdb/couchdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ func (*CouchDB) Description() string {

func (*CouchDB) SampleConfig() string {
return `
# Works with CouchDB stats endpoints out of the box
# Multiple HOSTs from which to read CouchDB stats:
hosts = ["http://localhost:8086/_stats"]
`
### Works with CouchDB stats endpoints out of the box
### Multiple HOSTs from which to read CouchDB stats:
hosts = ["http://localhost:8086/_stats"]
`
}

func (c *CouchDB) Gather(accumulator telegraf.Accumulator) error {
Expand Down
10 changes: 5 additions & 5 deletions plugins/inputs/disque/disque.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ type Disque struct {
}

var sampleConfig = `
# An array of URI to gather stats about. Specify an ip or hostname
# with optional port and password. ie disque://localhost, disque://10.10.3.33:18832,
# 10.0.0.1:10000, etc.
#
# If no servers are specified, then localhost is used as the host.
### An array of URI to gather stats about. Specify an ip or hostname
### with optional port and password. ie disque://localhost, disque://10.10.3.33:18832,
### 10.0.0.1:10000, etc.
### If no servers are specified, then localhost is used as the host.
servers = ["localhost"]
`

Expand Down
8 changes: 4 additions & 4 deletions plugins/inputs/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ type Docker struct {
}

var sampleConfig = `
# Docker Endpoint
# To use TCP, set endpoint = "tcp://[ip]:[port]"
# To use environment variables (ie, docker-machine), set endpoint = "ENV"
### Docker Endpoint
### To use TCP, set endpoint = "tcp://[ip]:[port]"
### To use environment variables (ie, docker-machine), set endpoint = "ENV"
endpoint = "unix:///var/run/docker.sock"
# Only collect metrics for these containers, collect all if empty
### Only collect metrics for these containers, collect all if empty
container_names = []
`

Expand Down
8 changes: 4 additions & 4 deletions plugins/inputs/elasticsearch/elasticsearch.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ type indexHealth struct {
}

const sampleConfig = `
# specify a list of one or more Elasticsearch servers
### specify a list of one or more Elasticsearch servers
servers = ["http://localhost:9200"]
# set local to false when you want to read the indices stats from all nodes
# within the cluster
### set local to false when you want to read the indices stats from all nodes
### within the cluster
local = true
# set cluster_health to true when you want to also obtain cluster level stats
### set cluster_health to true when you want to also obtain cluster level stats
cluster_health = false
`

Expand Down
2 changes: 1 addition & 1 deletion plugins/inputs/github_webhooks/github_webhooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func NewGithubWebhooks() *GithubWebhooks {

func (gh *GithubWebhooks) SampleConfig() string {
return `
# Address and port to host Webhook listener on
### Address and port to host Webhook listener on
service_address = ":1618"
`
}
Expand Down
12 changes: 6 additions & 6 deletions plugins/inputs/haproxy/haproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ type haproxy struct {
}

var sampleConfig = `
# An array of address to gather stats about. Specify an ip on hostname
# with optional port. ie localhost, 10.10.3.33:1936, etc.
#
# If no servers are specified, then default to 127.0.0.1:1936
### An array of address to gather stats about. Specify an ip on hostname
### with optional port. ie localhost, 10.10.3.33:1936, etc.
### If no servers are specified, then default to 127.0.0.1:1936
servers = ["http://myhaproxy.com:1936", "http://anotherhaproxy.com:1936"]
# Or you can also use local socket(not work yet)
# servers = ["socket://run/haproxy/admin.sock"]
### Or you can also use local socket(not work yet)
### servers = ["socket://run/haproxy/admin.sock"]
`

func (r *haproxy) SampleConfig() string {
Expand Down
17 changes: 8 additions & 9 deletions plugins/inputs/httpjson/httpjson.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,37 +46,36 @@ func (c RealHTTPClient) MakeRequest(req *http.Request) (*http.Response, error) {
}

var sampleConfig = `
# NOTE This plugin only reads numerical measurements, strings and booleans
# will be ignored.
### NOTE This plugin only reads numerical measurements, strings and booleans
### will be ignored.
# a name for the service being polled
### a name for the service being polled
name = "webserver_stats"
# URL of each server in the service's cluster
### URL of each server in the service's cluster
servers = [
"http://localhost:9999/stats/",
"http://localhost:9998/stats/",
]
# HTTP method to use (case-sensitive)
### HTTP method to use (case-sensitive)
method = "GET"
# List of tag names to extract from top-level of JSON server response
### List of tag names to extract from top-level of JSON server response
# tag_keys = [
# "my_tag_1",
# "my_tag_2"
# ]
# HTTP parameters (all values must be strings)
### HTTP parameters (all values must be strings)
[inputs.httpjson.parameters]
event_type = "cpu_spike"
threshold = "0.75"
# HTTP Header parameters (all values must be strings)
### HTTP Header parameters (all values must be strings)
# [inputs.httpjson.headers]
# X-Auth-Token = "my-xauth-token"
# apiVersion = "v1"
`

func (h *HttpJson) SampleConfig() string {
Expand Down
8 changes: 4 additions & 4 deletions plugins/inputs/influxdb/influxdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ func (*InfluxDB) Description() string {

func (*InfluxDB) SampleConfig() string {
return `
# 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.
### 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.
# Multiple URLs from which to read InfluxDB-formatted JSON
### Multiple URLs from which to read InfluxDB-formatted JSON
urls = [
"http://localhost:8086/debug/vars"
]
Expand Down
11 changes: 6 additions & 5 deletions plugins/inputs/jolokia/jolokia.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,21 @@ type Jolokia struct {

func (j *Jolokia) SampleConfig() string {
return `
# This is the context root used to compose the jolokia url
### This is the context root used to compose the jolokia url
context = "/jolokia/read"
# List of servers exposing jolokia read service
### List of servers exposing jolokia read service
[[inputs.jolokia.servers]]
name = "stable"
host = "192.168.103.2"
port = "8180"
# username = "myuser"
# password = "mypassword"
# List of metrics collected on above servers
# Each metric consists in a name, a jmx path and either a pass or drop slice attributes
# This collect all heap memory usage metrics
### List of metrics collected on above servers
### Each metric consists in a name, a jmx path and either
### a pass or drop slice attribute.
### This collect all heap memory usage metrics.
[[inputs.jolokia.metrics]]
name = "heap_memory_usage"
jmx = "/java.lang:type=Memory/HeapMemoryUsage"
Expand Down
6 changes: 2 additions & 4 deletions plugins/inputs/leofs/leofs.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,8 @@ var serverTypeMapping = map[string]ServerType{
}

var sampleConfig = `
# An array of URI to gather stats about LeoFS.
# Specify an ip or hostname with port. ie 127.0.0.1:4020
#
# If no servers are specified, then 127.0.0.1 is used as the host and 4020 as the port.
### An array of URI to gather stats about LeoFS.
### Specify an ip or hostname with port. ie 127.0.0.1:4020
servers = ["127.0.0.1:4021"]
`

Expand Down
11 changes: 7 additions & 4 deletions plugins/inputs/lustre2/lustre2.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,13 @@ type Lustre2 struct {
}

var sampleConfig = `
# An array of /proc globs to search for Lustre stats
# If not specified, the default will work on Lustre 2.5.x
#
# ost_procfiles = ["/proc/fs/lustre/obdfilter/*/stats", "/proc/fs/lustre/osd-ldiskfs/*/stats"]
### An array of /proc globs to search for Lustre stats
### If not specified, the default will work on Lustre 2.5.x
###
# ost_procfiles = [
# "/proc/fs/lustre/obdfilter/*/stats",
# "/proc/fs/lustre/osd-ldiskfs/*/stats"
# ]
# mds_procfiles = ["/proc/fs/lustre/mdt/*/md_stats"]
`

Expand Down
10 changes: 5 additions & 5 deletions plugins/inputs/mailchimp/mailchimp.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ type MailChimp struct {
}

var sampleConfig = `
# MailChimp API key
# get from https://admin.mailchimp.com/account/api/
### MailChimp API key
### get from https://admin.mailchimp.com/account/api/
api_key = "" # required
# Reports for campaigns sent more than days_old ago will not be collected.
# 0 means collect all.
### Reports for campaigns sent more than days_old ago will not be collected.
### 0 means collect all.
days_old = 0
# Campaign ID to get, if empty gets all campaigns, this option overrides days_old
### Campaign ID to get, if empty gets all campaigns, this option overrides days_old
# campaign_id = ""
`

Expand Down
6 changes: 2 additions & 4 deletions plugins/inputs/memcached/memcached.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@ type Memcached struct {
}

var sampleConfig = `
# An array of address to gather stats about. Specify an ip on hostname
# with optional port. ie localhost, 10.0.0.1:11211, etc.
#
# If no servers are specified, then localhost is used as the host.
### An array of address to gather stats about. Specify an ip on hostname
### with optional port. ie localhost, 10.0.0.1:11211, etc.
servers = ["localhost:11211"]
# unix_sockets = ["/var/run/memcached.sock"]
`
Expand Down
10 changes: 5 additions & 5 deletions plugins/inputs/mongodb/mongodb.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ type Ssl struct {
}

var sampleConfig = `
# An array of URI to gather stats about. Specify an ip or hostname
# with optional port add password. ie mongodb://user:[email protected]:27017,
# mongodb://10.10.3.33:18832, 10.0.0.1:10000, etc.
#
# If no servers are specified, then 127.0.0.1 is used as the host and 27107 as the port.
### An array of URI to gather stats about. Specify an ip or hostname
### with optional port add password. ie,
### mongodb://user:auth_key@10.10.3.30:27017,
### mongodb://10.10.3.33:18832,
### 10.0.0.1:10000, etc.
servers = ["127.0.0.1:27017"]
`

Expand Down
16 changes: 8 additions & 8 deletions plugins/inputs/mysql/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ type Mysql struct {
}

var sampleConfig = `
# specify servers via a url matching:
# [username[:password]@][protocol[(address)]]/[?tls=[true|false|skip-verify]]
# see https://github.com/go-sql-driver/mysql#dsn-data-source-name
# e.g.
# root:passwd@tcp(127.0.0.1:3306)/?tls=false
# root@tcp(127.0.0.1:3306)/?tls=false
#
# If no servers are specified, then localhost is used as the host.
### specify servers via a url matching:
### [username[:password]@][protocol[(address)]]/[?tls=[true|false|skip-verify]]
### see https://github.com/go-sql-driver/mysql#dsn-data-source-name
### e.g.
### root:passwd@tcp(127.0.0.1:3306)/?tls=false
### root@tcp(127.0.0.1:3306)/?tls=false
###
### If no servers are specified, then localhost is used as the host.
servers = ["tcp(127.0.0.1:3306)/"]
`

Expand Down
Loading

0 comments on commit fc7fa4b

Please sign in to comment.