Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

VRF association in NetClassIface

Aperta
#405 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 4 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
go, linux

Direzione di ricerca

Inizia dall’implementazione di NetClassIface e dalla sua lettura esistente di /sys/class/net, quindi confronta questo approccio con l’esempio netlink dell’issue che usa ip link show type vrf. Il lavoro sarà completato quando l’associazione VRF delle interfacce sarà esposta in modo affidabile e sarà definito il design per identificare le interfacce VRF.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement

Hi,

One metric dimension that I am missing from Node Exporter is the VRF association for interfaces.

It looks like the current implementation relies on reading /sys/class/net. For VRFs this is visible as a generic upper (or master) / lower hierarchy.

Example:

bluecmd@adele:/sys/class/net/Ethernet92$ ls -lah
total 0
drwxr-xr-x   5 root root    0 Aug  2 15:06 .
drwxr-xr-x 122 root root    0 Aug  2 15:06 ..
-r--r--r--   1 root root 4.0K Aug  2 15:06 addr_assign_type
-r--r--r--   1 root root 4.0K Aug  2 15:06 address
[..]
-r--r--r--   1 root root 4.0K Aug  2 15:06 iflink
-r--r--r--   1 root root 4.0K Aug  2 15:06 link_mode
lrwxrwxrwx   1 root root    0 Aug  2 15:06 master -> ../VrfKamel
-rw-r--r--   1 root root 4.0K Aug  2 15:06 mtu
[..]
-rw-r--r--   1 root root 4.0K Aug  2 15:06 uevent
lrwxrwxrwx   1 root root    0 Aug  2 15:06 upper_VrfKamel -> ../VrfKamel

However, sadly, the VrfKamel master directory does not contain anything saying that it is a VRF interface. The type file would be my first guess but that appears to be more "What kind of protocol does this interface handle?" which is both 1 for EthernetX and VrfX.

The better way appears to use netlink to find the VRFs:

bluecmd@adele:/sys/class/net/eth0$ ip link show type vrf
9: mgmt: <NOARP,MASTER,UP,LOWER_UP> mtu 65536 qdisc noqueue state UP mode DEFAULT group default qlen 1000
    link/ether d6:1e:f6:a2:87:b9 brd ff:ff:ff:ff:ff:ff
12: VrfKamel: <NOARP,MASTER,UP,LOWER_UP> mtu 65536 qdisc noqueue state UP mode DEFAULT group default qlen 1000
    link/ether 66:d8:f1:b8:0f:96 brd ff:ff:ff:ff:ff:ff
14: VrfMainframe: <NOARP,MASTER,UP,LOWER_UP> mtu 65536 qdisc noqueue state UP mode DEFAULT group default qlen 1000
    link/ether 8e:37:34:f5:bd:e3 brd ff:ff:ff:ff:ff:ff

Happy to take any questions or suggestions! Might even end up making a PR for it if the stars align and we can figure out a design :-).

Lingua principale
Go
Stelle
883
Fork
395
Merge medio
6g 17h
PR unite (30g)
7

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di prometheus/procfs

Tutte le issue di prometheus/procfs

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.