-
Couldn't load subscription status.
- Fork 2.4k
Description
Hey,
I was comparing some metrics from both influxdb and prometheus and it looked weird to me that influx wasn't reporting per-interface statistics.
cadvisor/storage/influxdb/influxdb.go
Lines 206 to 209 in 2835c35
| points = append(points, makePoint(serRxBytes, stats.Network.RxBytes)) | |
| points = append(points, makePoint(serRxErrors, stats.Network.RxErrors)) | |
| points = append(points, makePoint(serTxBytes, stats.Network.TxBytes)) | |
| points = append(points, makePoint(serTxErrors, stats.Network.TxErrors)) |
This seems wrong as that data is coming from a single iface:
cadvisor/container/libcontainer/helpers.go
Lines 138 to 141 in c2f8191
| // For backwards compatibility. | |
| if len(stats.Network.Interfaces) > 0 { | |
| stats.Network.InterfaceStats = stats.Network.Interfaces[0] | |
| } |
Am I missing something?
If that's really incorrect, how should we approach this? Should we add a new metric like rx_bytes_per_iface to not change expectations of those that already rely on rx_bytes or do you think it's ok to just add an extra tag on rx_bytes with the interface field (with values for each interface)?
I like the second case (_per_iface) as people that were relying on the old behavior could find things a bit off when updating (suddenly there's loopback and other ifaces being counted).
Thanks!