Skip to content

Commit

Permalink
jolokia: add 'server_' prefix to tags
Browse files Browse the repository at this point in the history
it avoid overwriting the telegraf-wide host tag
  • Loading branch information
saiello committed Apr 18, 2016
1 parent 5e9980f commit 12b056c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions plugins/inputs/jolokia/jolokia.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,9 @@ func (j *Jolokia) Gather(acc telegraf.Accumulator) error {
tags := make(map[string]string)

for _, server := range servers {
tags["server"] = server.Name
tags["port"] = server.Port
tags["host"] = server.Host
tags["server_name"] = server.Name
tags["server_port"] = server.Port
tags["server_host"] = server.Host
fields := make(map[string]interface{})

for _, metric := range metrics {
Expand Down
6 changes: 3 additions & 3 deletions plugins/inputs/jolokia/jolokia_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ func TestHttpJsonMultiValue(t *testing.T) {
"heap_memory_usage_used": 203288528.0,
}
tags := map[string]string{
"host": "127.0.0.1",
"port": "8080",
"server": "as1",
"server_host": "127.0.0.1",
"server_port": "8080",
"server_name": "as1",
}
acc.AssertContainsTaggedFields(t, "jolokia", fields, tags)
}
Expand Down

0 comments on commit 12b056c

Please sign in to comment.