prometheus / prometheus/node_exporter

Network card status confuses me

Open
#2,972 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

ifconfig output is as follows

[root@localhost ~]# ifconfig -a
enp3s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.7.48.160 netmask 255.255.224.0 broadcast 10.7.63.255
inet6 fe80::e160:a350:7997:8e66 prefixlen 64 scopeid 0x20
ether 52:54:00:05:0b:bd txqueuelen 1000 (Ethernet)
RX packets 1719090 bytes 344162608 (328.2 MiB)
RX errors 0 dropped 152019 overruns 0 frame 0
TX packets 113183 bytes 30701961 (29.2 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10
loop txqueuelen 1000 (Local Loopback)
RX packets 224 bytes 18480 (18.0 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 224 bytes 18480 (18.0 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

tap0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether 5e🇩🇪fe:68:41:65 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

tap1: flags=4098<BROADCAST,MULTICAST> mtu 1500
ether a6:cf:9f:07:c1:0e txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[root@localhost ~]#

node_exporter output as follows

node_network_transmit_queue_length{device="tap1"} 1000
# HELP node_network_up Value is 1 if operstate is 'up', 0 otherwise.
# TYPE node_network_up gauge
node_network_up{device="enp3s0"} 1
node_network_up{device="lo"} 0
node_network_up{device="tap0"} 0
node_network_up{device="tap1"} 0
# HELP node_nfs_connections_total Total number of NFSd TCP connections.

my confusion

Judging from the output of ifocnfig, the status of tap0 is "up"
node_export considers the status value tap0 to be 0
I analyzed that node_export takes the value from the file , which is also consistent with the output of node_exporter. I
I think this is very conflicting, it seems that the value should be read from ifconfig

[root@localhost ~]# cat /sys/class/net/tap0/operstate
down
[root@localhost ~]#

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

Start by comparing the node_network_up metric with /sys/class/net/tap0/operstate and the corresponding ifconfig flags shown in the issue. Determine whether the metric's documented meaning matches the observed values, then resolve the discrepancy with a clear explanation or a focused change whose behavior can be verified against these outputs.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, linux, prometheus
Domain
observability, operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.