Skip to content

Commit 38af62c

Browse files
committed
ipn/ipnlocal: remove the primary routes gauge for now
Not confident this is the right way to expose this, so let's remote it for now. Updates tailscale/corp#22075 Signed-off-by: Anton Tolchanov <[email protected]>
1 parent 11e9676 commit 38af62c

File tree

2 files changed

+0
-21
lines changed

2 files changed

+0
-21
lines changed

ipn/ipnlocal/local.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -399,11 +399,6 @@ type metrics struct {
399399
// approvedRoutes is a metric that reports the number of network routes served by the local node and approved
400400
// by the control server.
401401
approvedRoutes *usermetric.Gauge
402-
403-
// primaryRoutes is a metric that reports the number of primary network routes served by the local node.
404-
// A route being a primary route implies that the route is currently served by this node, and not by another
405-
// subnet router in a high availability configuration.
406-
primaryRoutes *usermetric.Gauge
407402
}
408403

409404
// clientGen is a func that creates a control plane client.
@@ -454,8 +449,6 @@ func NewLocalBackend(logf logger.Logf, logID logid.PublicID, sys *tsd.System, lo
454449
"tailscaled_advertised_routes", "Number of advertised network routes (e.g. by a subnet router)"),
455450
approvedRoutes: sys.UserMetricsRegistry().NewGauge(
456451
"tailscaled_approved_routes", "Number of approved network routes (e.g. by a subnet router)"),
457-
primaryRoutes: sys.UserMetricsRegistry().NewGauge(
458-
"tailscaled_primary_routes", "Number of network routes for which this node is a primary router (in high availability configuration)"),
459452
}
460453

461454
b := &LocalBackend{
@@ -5477,7 +5470,6 @@ func (b *LocalBackend) setNetMapLocked(nm *netmap.NetworkMap) {
54775470
// If there is no netmap, the client is going into a "turned off"
54785471
// state so reset the metrics.
54795472
b.metrics.approvedRoutes.Set(0)
5480-
b.metrics.primaryRoutes.Set(0)
54815473
return
54825474
}
54835475

@@ -5506,7 +5498,6 @@ func (b *LocalBackend) setNetMapLocked(nm *netmap.NetworkMap) {
55065498
}
55075499
}
55085500
b.metrics.approvedRoutes.Set(approved)
5509-
b.metrics.primaryRoutes.Set(float64(tsaddr.WithoutExitRoute(nm.SelfNode.PrimaryRoutes()).Len()))
55105501
}
55115502
for _, p := range nm.Peers {
55125503
addNode(p)

tsnet/tsnet_test.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,13 +1080,6 @@ func TestUserMetrics(t *testing.T) {
10801080
t.Errorf("metrics1, tailscaled_health_messages: got %v, want %v", got, want)
10811081
}
10821082

1083-
// The node is the primary subnet router for 2 routes:
1084-
// - 192.0.2.0/24
1085-
// - 192.0.5.1/32
1086-
if got, want := parsedMetrics1["tailscaled_primary_routes"], wantRoutes; got != want {
1087-
t.Errorf("metrics1, tailscaled_primary_routes: got %v, want %v", got, want)
1088-
}
1089-
10901083
// Verify that the amount of data recorded in bytes is higher or equal to the
10911084
// 10 megabytes sent.
10921085
inboundBytes1 := parsedMetrics1[`tailscaled_inbound_bytes_total{path="direct_ipv4"}`]
@@ -1131,11 +1124,6 @@ func TestUserMetrics(t *testing.T) {
11311124
t.Errorf("metrics2, tailscaled_health_messages: got %v, want %v", got, want)
11321125
}
11331126

1134-
// The node is the primary subnet router for 0 routes
1135-
if got, want := parsedMetrics2["tailscaled_primary_routes"], 0.0; got != want {
1136-
t.Errorf("metrics2, tailscaled_primary_routes: got %v, want %v", got, want)
1137-
}
1138-
11391127
// Verify that the amount of data recorded in bytes is higher or equal than the
11401128
// 10 megabytes sent.
11411129
outboundBytes2 := parsedMetrics2[`tailscaled_outbound_bytes_total{path="direct_ipv4"}`]

0 commit comments

Comments
 (0)