prometheus / prometheus/node_exporter

feat: add `node_network_address_valid_lft` and `node_network_address_preferred_lft` metrics

Open
#3,392 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
13.8k
Forks
2.7k
Avg merge
1d 23h
Merged PRs (30d)
8

Description

Such metrics could help detecting DHCP lease not being renewed in-time.

E.g. the values could come from the stats shown by:

$ ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host noprefixroute
       valid_lft forever preferred_lft forever
2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1460 qdisc mq state UP group default qlen 1000
    link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
    altname enp0s3
    inet nn.nn.nn.nn/32 metric 100 scope global dynamic ens3
       valid_lft 68465sec preferred_lft 68465sec
    inet6 xxxx::xxxx:xxxx:xxxx:xxxx/64 scope link
       valid_lft forever preferred_lft forever

..and result in metrics like:

# HELP node_network_address_valid_lft The valid lifetime of an address
# TYPE node_network_address_valid_lft gauge
node_network_address_valid_lft{device="ens3",family="inet"} 68465
node_network_address_valid_lft{device="ens3",family="inet6"} -1
node_network_address_valid_lft{device="lo",family="inet"} -1
node_network_address_valid_lft{device="lo",family="inet6"} -1
# HELP node_network_address_preferred_lft The preferred lifetime of an address
# TYPE node_network_address_preferred_lft gauge
node_network_address_preferred_lft{device="ens3",family="inet"} 68465
node_network_address_preferred_lft{device="ens3",family="inet6"} -1
node_network_address_preferred_lft{device="lo",family="inet"} -1
node_network_address_preferred_lft{device="lo",family="inet6"} -1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Use the ip addr show output in the issue as the reference for address lifetimes, then trace node_exporter's existing network-address collection entry point. Done means exposing both gauge metrics with device and family labels, including the shown -1 representation for forever values.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, linux
Domain
networking, observability
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.