- Notifications
You must be signed in to change notification settings - Fork905
chore(vpn): send ping results over tunnel#18200
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
ethanndickson commentedJun 3, 2025 • 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.
This stack of pull requests is managed byGraphite. Learn more aboutstacking. |
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.
Pull Request Overview
This PR introduces support for sending ping results over the tunnel by adding a new LastPing proto message, updating version numbers to 1.2, and refactoring agent structures and latency recording logic. Key changes include:
- Adding the new LastPing message in vpn.proto.
- Updating version information in vpn/version.go and related tests.
- Refactoring agent types to include ping data and implementing latency recording in tunnel.go.
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
vpn/vpn.proto | Added LastPing message definition and field in Agent message |
vpn/version.go | Updated version from 1.1 to 1.2 with new network-related information |
vpn/tunnel_internal_test.go | Updated tests to verify ping and latency data in agent updates |
vpn/tunnel.go | Refactored agent types, updated conversion functions, and added latency recording |
vpn/speaker_internal_test.go | Updated expected handshake version |
vpn/client.go | Added Ping, Node, and DERPMap functions to the VPN connection |
tailnet/derpmap_test.go & derpmap.go | Added functions to extract DERP latency and preferred DERP names |
coderd/util/maps/maps.go | Added a generic Map function for maps |
coderd/database/db2sdk/db2sdk.go | Removed duplicate Map function |
cli/ssh.go | Updated DERP latency extraction to use new tailnet functions |
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.
Deferring approval to netgru folks, but I don't see any blocking issues 👍 I like the agent pings, this could potentially give us some very useful information!
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.
Uh oh!
There was an error while loading.Please reload this page.
Found some issues, don't review. |
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.
ethanndickson commentedJun 6, 2025 • 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.
Merge activity
|
0076e84
intomainUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Closes#17982.
The purpose of this PR is to expose network latency via the API used by Coder Desktop.
This PR has the tunnel ping all known agents every 5 seconds, in order to produce an instance of:
The contents of this message are stored and included on all subsequent upsertions of the agent.
Note that we upsert existing agents every 5 seconds to update the
last_handshake
value.On the desktop apps, this message will be used to produce a tooltip similar to that of the VS Code extension:

(wording not final)
Unlike the VS Code extension, we omit:
Agent
orLastPing
message.If we do want to expose this info on Coder Desktop, we should consider how best to do so; maybe we want to include it on a more generic
Netcheck
message.If we want to expose it, it'll be in a separate PR.