Skip to content

InfluxDB Storage driver sends network stats of only the first interface found #1737

@cirocosta

Description

@cirocosta

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.

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:

// 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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions