netmon: add per-interface metric field - #414
Merged
Merged
Conversation
npry
added this pull request to stack #397
September 16, 2026 17:13
npry
requested review from
danderson,
dylan-tailscale and
nrc
as code owners
September 16, 2026 17:13
npry
force-pushed
the
npry/netmon.interface-metric
branch
3 times, most recently
from
September 16, 2026 17:19
4e47d44 to
d9a4b09
Compare
dylan-tailscale
approved these changes
Sep 16, 2026
dylan-tailscale
left a comment
Collaborator
There was a problem hiding this comment.
lgtm, one docstring suggestion
Signed-off-by: Nathan Perry <nathan@tailscale.com> Change-Id: I00d92d7d0dd5c5ad5ac2f8e19692b0fb6a6a6964
npry
force-pushed
the
npry/netmon.interface-metric
branch
from
September 16, 2026 21:28
d9a4b09 to
24144a5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a follow-on to #396 which is technically required for it to function properly (but kind of in an edge case: only if you have more than one default route on your machine). I'm splitting it out to a stacked PR to avoid re-requesting the same review on the same PR again and because this is mostly logically standalone.
Context: #396 (comment)
This implements what was discussed there^: netmon routes and interfaces now both have a metric field, and the netmon implementation fills whatever is appropriate on its platform. Then it's the responsibility of the pieces that consume updates from netmon to add those fields together to get the true route metric. Currently that's just used by the default route metric tracker, which needed some refactoring to handle this.