diff --git a/CHANGELOG.md b/CHANGELOG.md index 56058b4d3..9e7fc92da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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] diff --git a/plugins/inputs/system/net.go b/plugins/inputs/system/net.go index 95df7a741..42f0d5854 100644 --- a/plugins/inputs/system/net.go +++ b/plugins/inputs/system/net.go @@ -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 } diff --git a/plugins/inputs/system/net_test.go b/plugins/inputs/system/net_test.go index ba71848d1..3ec2cb990 100644 --- a/plugins/inputs/system/net_test.go +++ b/plugins/inputs/system/net_test.go @@ -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