- Notifications
You must be signed in to change notification settings - Fork928
chore: add additional network telemetry stats & events#13800
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
server.telemetryStore.setNetInfo(ni) | ||
nodeUp.setNetInfo(ni) | ||
}) | ||
server.wireguardEngine.AddNetworkMapCallback(func(nm *netmap.NetworkMap) { |
ethanndicksonJul 8, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
We use this callback to ensure we always have the latest Tailscale node data for a given peer.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
// Watch for changes in the connection type (P2P<->DERP) and send telemetry events. | ||
func (c *Conn) watchConnChange() { | ||
ticker := time.NewTicker(time.Millisecond * 50) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Because we have to manually check if the connection has changed like this, P2PSetup can be ~50ms off it's true value.
// nil if not connected | ||
connSetupTime *durationpb.Duration | ||
connectedIP *netip.Addr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
To support coderd and agent telemetry in the future, we'll need to change this to a map of peers to nodes/IPs.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
e8db21c
intomainUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
ConnectionAge
to the time sincetailnet.NewConn
was called.ConnectionSetup
to the time betweentailnet.NewConn
being called, and a connected telemetry event being sent.P2PSetup
to the time betweentailnet.NewConn
and when we find out our connection is direct.