Skip to content

feat(cni): Name the VRF device in per-VPC metrics - #873

Merged
privateip merged 1 commit into
mainfrom
feat/vpc-attribution-vrf-interface
Oct 15, 2026
Merged

privateip merged 1 commit into
mainfrom
feat/vpc-attribution-vrf-interface

Conversation

@privateip

@privateip privateip commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

The per-VPC traffic metrics identify a VPC only by its uSID and encoded identifiers, so matching a series to the VRF device on a node means decoding names by hand.

Each node's VPC attribution map now stores the name of the VPC's VRF device, and every per-VRF traffic series names that device, with no new series and no label joins in infra's dashboards to break.

The map's layout changes, so an upgraded node recreates it empty and refills it from its attachments right after start. Forwarding never reads this map, but the per-VRF series show as unattributed until the refill finishes.

Test plan

  • Unit tests and lint pass
  • On a lab node after rollout, the per-VRF series name the VRF device that ip link shows
  • vpc="" series disappear within a minute of the CNI pod starting

🤖 Generated with Claude Code

vpc_attribution_table now stores the name of the VPC's VRF device next
to the VPC and VPCAttachment identifiers, and the per-VRF counters carry
it as a vrf_interface label. A map dump and a dashboard can then name
the kernel interface a VPC's traffic belongs to, without decoding the
base62 VPC identifier by hand.

CNI ADD and the datapath repair pass both write the name, derived the
same way the VRF itself is named. Register rejects a name that does not
fit IFNAMSIZ.

The map value grows, so the loader recreates vpc_attribution_table empty
on rollout and the repair pass refills it right after the datapath
loads. Forwarding never reads this map. Until the refill, the per-VRF
series report vpc="" as unattributed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@privateip privateip self-assigned this Oct 15, 2026
@privateip
privateip marked this pull request as ready for review October 15, 2026 17:33
@privateip
privateip requested a review from a team as a code owner October 15, 2026 17:33
@privateip privateip changed the title feat: Name the VRF device in per-VPC traffic metrics feat(cni): Name the VRF device in per-VPC metrics Oct 15, 2026
@privateip
privateip enabled auto-merge October 15, 2026 17:36
@privateip
privateip merged commit 3fce244 into main Oct 15, 2026
14 checks passed
@privateip
privateip deleted the feat/vpc-attribution-vrf-interface branch October 15, 2026 17:42
@privateip

Copy link
Copy Markdown
Collaborator Author

Two reviewers checked this before it was marked ready.

The adversarial review voted merge with no findings. It read the diff, checked the map value layout and the label order, confirmed the loader recreates only the changed map and the repair pass refills it, and ran vet and the unit tests for the touched packages. It did not run the live-node test plan or an upgrade.

The conventions review voted hold for two choices left to the author, who decided to ship with the next release with no landing order against #868, #869, #870 or #598, since none of them touch the attribution map or the metric labels. Its title and summary findings are fixed. Its request to drop the attribution lines was declined, since the session's commit rules require them.

CI passed on this head, including the root unit tests and E2E.

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.

2 participants