Merge pull request #45 from jhofeditz/patch-1
skip disk tags with no value
This commit is contained in:
commit
1d8e6473c6
|
@ -55,9 +55,12 @@ func (s *DiskIOStats) Gather(acc plugins.Accumulator) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, io := range diskio {
|
for _, io := range diskio {
|
||||||
tags := map[string]string{
|
tags := map[string]string{}
|
||||||
"name": io.Name,
|
if len(io.Name) != 0 {
|
||||||
"serial": io.SerialNumber,
|
tags["name"] = io.Name
|
||||||
|
}
|
||||||
|
if len(io.SerialNumber) != 0 {
|
||||||
|
tags["serial"] = io.SerialNumber
|
||||||
}
|
}
|
||||||
|
|
||||||
acc.Add("reads", io.ReadCount, tags)
|
acc.Add("reads", io.ReadCount, tags)
|
||||||
|
|
Loading…
Reference in New Issue