Log aerospike field value on error

This commit is contained in:
Daniel Nelson 2017-06-26 14:48:22 -07:00
parent cbd93f0598
commit 6f803308c5
1 changed files with 2 additions and 2 deletions

View File

@ -85,7 +85,7 @@ func (a *Aerospike) gatherServer(hostport string, acc telegraf.Accumulator) erro
if err == nil { if err == nil {
fields[strings.Replace(k, "-", "_", -1)] = val fields[strings.Replace(k, "-", "_", -1)] = val
} else { } else {
log.Printf("I! skipping aerospike field %v with int64 overflow", k) log.Printf("I! skipping aerospike field %v with int64 overflow: %q", k, v)
} }
} }
acc.AddFields("aerospike_node", fields, tags, time.Now()) acc.AddFields("aerospike_node", fields, tags, time.Now())
@ -117,7 +117,7 @@ func (a *Aerospike) gatherServer(hostport string, acc telegraf.Accumulator) erro
if err == nil { if err == nil {
nFields[strings.Replace(parts[0], "-", "_", -1)] = val nFields[strings.Replace(parts[0], "-", "_", -1)] = val
} else { } else {
log.Printf("I! skipping aerospike field %v with int64 overflow", parts[0]) log.Printf("I! skipping aerospike field %v with int64 overflow: %q", parts[0], parts[1])
} }
} }
acc.AddFields("aerospike_namespace", nFields, nTags, time.Now()) acc.AddFields("aerospike_namespace", nFields, nTags, time.Now())