Skip to content

[RFE] Export certain network routes (e.g. default) #1639

Description

@squeed

(I intend to implement this, and I have a functioning patch for Linux already, but I'd like to discuss exactly how this should look before filing the PR)

Goal:

Write alerts that detect, for example, that a node's uplink network interface is nearing saturation.

Challenge:

Modern Linux boxes, especially with containers, have lots of network interfaces, and you can't count on the uplink being called eth0 (see systemd.net-naming-scheme).

It would be useful for the node exporter to indicate which network interface has the default route. This is a pretty reasonable proxy for the "uplink" interface.

Proposal:

The simplest solution is to add an additional label (per family) to the node_network_info metric, so it looks something like

node_network_info{address="01:01:01:01:01:01",broadcast="ff:ff:ff:ff:ff:ff",default_route_v4="1",default_route_v6="1",device="eth0",duplex="full",ifalias="",operstate="up"}

Alternatively, we could allow for more flexibility. I could see wanting to expose which interface has a route to a specific IP address. For example, I could see wanting know which interface is the SAN interface. So, I'd configure the node-exporter with the destination 1.2.3.4 as "san" and get the following metrics:

node_network_has_route{device="enp1s0",route="default"} 1
node_network_has_route{device="enp1s0",route="san"} 0
node_network_has_route{device="enp6s1",route="default"} 0
node_network_has_route{device="enp6s1",route="san"} 1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions