Overhaul config <-> agent coupling. Put config in it's own package.

This commit is contained in:
Cameron Sparr
2015-11-24 14:22:11 -07:00
parent 8dde60e869
commit 979e5f193a
23 changed files with 554 additions and 748 deletions

View File

@@ -16,7 +16,7 @@ import (
const sampleConfig = `
# specify commands via an array of tables
[[exec.commands]]
[[plugins.exec.commands]]
# the command to run
command = "/usr/bin/mycollector --foo=bar"

View File

@@ -48,7 +48,7 @@ func (c RealHTTPClient) MakeRequest(req *http.Request) (*http.Response, error) {
var sampleConfig = `
# Specify services via an array of tables
[[httpjson.services]]
[[plugins.httpjson.services]]
# a name for the service being polled
name = "webserver_stats"
@@ -69,7 +69,7 @@ var sampleConfig = `
# ]
# HTTP parameters (all values must be strings)
[httpjson.services.parameters]
[plugins.httpjson.services.parameters]
event_type = "cpu_spike"
threshold = "0.75"
`

View File

@@ -55,7 +55,7 @@ func (j *Jolokia) SampleConfig() string {
group = "as"
# List of servers exposing jolokia read service
[[jolokia.servers]]
[[plugins.jolokia.servers]]
name = "stable"
host = "192.168.103.2"
port = "8180"
@@ -63,20 +63,20 @@ func (j *Jolokia) SampleConfig() string {
# 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
[[jolokia.metrics]]
[[plugins.jolokia.metrics]]
name = "heap_memory_usage"
jmx = "/java.lang:type=Memory/HeapMemoryUsage"
# This drops the 'committed' value from Eden space measurement
[[jolokia.metrics]]
[[plugins.jolokia.metrics]]
name = "memory_eden"
jmx = "/java.lang:type=MemoryPool,name=PS Eden Space/Usage"
drop = [ "committed" ]
# This passes only DaemonThreadCount and ThreadCount
[[jolokia.metrics]]
[[plugins.jolokia.metrics]]
name = "heap_threads"
jmx = "/java.lang:type=Threading"
pass = [

View File

@@ -25,7 +25,7 @@ var ignoredColumns = map[string]bool{"datid": true, "datname": true, "stats_rese
var sampleConfig = `
# specify servers via an array of tables
[[postgresql.servers]]
[[plugins.postgresql.servers]]
# specify address via a url matching:
# postgres://[pqgotest[:password]]@localhost[/dbname]?sslmode=[disable|verify-ca|verify-full]
@@ -49,7 +49,7 @@ var sampleConfig = `
# databases = ["app_production", "blah_testing"]
# [[postgresql.servers]]
# [[plugins.postgresql.servers]]
# address = "influx@remoteserver"
`

View File

@@ -30,7 +30,7 @@ func NewProcstat() *Procstat {
}
var sampleConfig = `
[[procstat.specifications]]
[[plugins.procstat.specifications]]
prefix = "" # optional string to prefix measurements
# Must specify one of: pid_file, exe, or pattern
# PID file to monitor process

View File

@@ -100,7 +100,7 @@ var gatherFunctions = []gatherFunc{gatherOverview, gatherNodes, gatherQueues}
var sampleConfig = `
# Specify servers via an array of tables
[[rabbitmq.servers]]
[[plugins.rabbitmq.servers]]
# name = "rmq-server-1" # optional tag
# url = "http://localhost:15672"
# username = "guest"

View File

@@ -22,7 +22,7 @@ type TwemproxyInstance struct {
}
var sampleConfig = `
[[twemproxy.instances]]
[[plugins.twemproxy.instances]]
# Twemproxy stats address and port (no scheme)
addr = "localhost:22222"
# Monitor pool name