diff --git a/plugins/jolokia/jolokia.go b/plugins/jolokia/jolokia.go index ee43246da..4dbd2fea0 100644 --- a/plugins/jolokia/jolokia.go +++ b/plugins/jolokia/jolokia.go @@ -32,7 +32,7 @@ type Jolokia struct { Context string Servers []Server Metrics []Metric - + Tags map[string]string } @@ -40,6 +40,9 @@ func (j *Jolokia) SampleConfig() string { return `[jolokia] context = "/jolokia/read" + [[jolokia.tags]] + group = "as" + [[jolokia.servers]] name = "stable" host = "192.168.103.2" @@ -147,10 +150,12 @@ func (j *Jolokia) Gather(acc plugins.Accumulator) error { context := j.Context //"/jolokia/read" servers := j.Servers metrics := j.Metrics + tags := j.Tags + + if tags == nil{ + tags = map[string]string{} + } - var tags = map[string]string{ - "group": "application_server", - } for _, server := range servers { for _, metric := range metrics { @@ -174,7 +179,7 @@ func (j *Jolokia) Gather(acc plugins.Accumulator) error { acc.Add(measurement, values.(interface{}), tags) } }else{ - fmt.Println("Missing key value") + fmt.Printf("Missing key 'value' in '%s' output response\n", url) } } }