Repository navigation
feat(cni): Name the VRF device in per-VPC metrics - #873
Conversation
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>
|
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. |
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
ip linkshowsvpc=""series disappear within a minute of the CNI pod starting🤖 Generated with Claude Code