Skip to content

fix: attach only to pod uplinks (eth<N>, net<N>) and log interface events at debug - #173

Merged
beneiltis merged 1 commit into
mainfrom
fix/uplinks-only-quiet-logs
Nov 13, 2026
Merged

beneiltis merged 1 commit into
mainfrom
fix/uplinks-only-quiet-logs

Conversation

@beneiltis

Copy link
Copy Markdown
Contributor

Problem

Found in node-metrics debug logs on homeserver after rolling out v0.4.39: an ARC runner pod runs docker-in-docker as a native sidecar, so its netns contains docker0 plus one veth per job container.

  • snoopy attached counters to docker0 and to every new veth: one eBPF object load (verifier run) per job container start
  • the operator summed all interfaces; traffic of a job container crosses its veth, docker0 and eth0, so it was counted two or three times
  • every interface change was logged at info on stderr (in addition to the stdout event), ~20 lines per minute from one runner pod in the operator log

Changes

  • --interface-prefix (repeatable, default eth, net): only interfaces named <prefix><digits> get counters, i.e. the pod uplinks (eth<N> from the CNI, net<N> from Multus). --exclude-interface still applies on top.
  • interface was removed, interface changed, closed ebpf module and the RLIMIT_MEMLOCK notice are logged at debug.

All interface events are still printed to stdout, so the operator keeps seeing them.

Verification (homeserver, isolated netns)

Interfaces lo, eth0, hostside, docker0, vethabc (on docker0), vethin, plus vethdef/vethin2 added at runtime → 8 InterfaceAdded events, counters attached only to eth0; stderr at default level only shows the shutdown line. cargo fmt, cargo clippy --release, cargo test clean.

The operator side (count only uplinks, works with any snoopy version) is in mogenius/mogenius-operator branch fix/node-metrics-uplinks-sidecars.

🤖 Generated with Claude Code

…ents at debug

In pods with a nested runtime (docker-in-docker, kind) snoopy attached to
docker0 and to every veth a job container created, so each container
start cost an eBPF load, and the operator summed traffic that crosses
veth, bridge and eth0 two or three times.

- new `--interface-prefix` (repeatable, default `eth`, `net`): attach only
  to interfaces named <prefix><digits>; `--exclude-interface` still wins
- interface removed/changed, closed module and the memlock notice are
  logged at debug: the events are on stdout already, and a CI runner pod
  produced ~20 info lines per minute in the operator log

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant