Add an interface:"all" tag to the net protocol counters

fixes #508
This commit is contained in:
Cameron Sparr 2016-01-14 10:31:47 -08:00
parent 923be102b3
commit a39a7a7a03
3 changed files with 9 additions and 2 deletions

View File

@ -6,6 +6,7 @@
### Bugfixes
- [#506](https://github.com/influxdb/telegraf/pull/506): Ping input doesn't return response time metric when timeout. Thanks @titilambert!
- [#508](https://github.com/influxdb/telegraf/pull/508): Fix prometheus cardinality issue with the `net` plugin
## v0.10.0 [2014-01-12]

View File

@ -94,7 +94,10 @@ func (s *NetIOStats) Gather(acc inputs.Accumulator) error {
fields[name] = value
}
}
acc.AddFields("net", fields, nil)
tags := map[string]string{
"interface": "all",
}
acc.AddFields("net", fields, tags)
return nil
}

View File

@ -80,7 +80,10 @@ func TestNetStats(t *testing.T) {
"udp_noports": int64(892592),
"udp_indatagrams": int64(4655),
}
acc.AssertContainsTaggedFields(t, "net", fields2, make(map[string]string))
ntags = map[string]string{
"interface": "all",
}
acc.AssertContainsTaggedFields(t, "net", fields2, ntags)
acc.Points = nil