Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
ethanndickson merged 13 commits intomainfromethan/send-ping-results
Jun 6, 2025

Conversation

ethanndickson
Copy link
Member

@ethanndicksonethanndickson commentedJun 3, 2025
edited
Loading

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:

messageLastPing {// latency is the RTT of the ping to the agent.google.protobuf.Durationlatency=1;// did_p2p indicates whether the ping was sent P2P, or over DERP.booldid_p2p=2;// preferred_derp is the human readable name of the preferred DERP region,// or the region used for the last ping, if it was sent over DERP.stringpreferred_derp=3;// preferred_derp_latency is the last known latency to the preferred DERP// region. Unset if the region does not appear in the DERP map.optionalgoogle.protobuf.Durationpreferred_derp_latency=4;}

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 thelast_handshake value.

On the desktop apps, this message will be used to produce a tooltip similar to that of the VS Code extension:
image
(wording not final)

Unlike the VS Code extension, we omit:

  • The Latency ofall available DERP regions. It seems not ideal to send a copy of this entire map for every online agent, and it certainly doesn't make sense for it to be on theAgent 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 genericNetcheck message.
  • The current throughput (Bytes up/down). This is out of scope of the linked issue, and is non-trivial to implement. I'm also not sure of the value given the frequency we're doing these status updates (every 5 seconds).
    If we want to expose it, it'll be in a separate PR.
image

matifali reacted with thumbs up emoji
@ethanndicksonGraphite App
Copy link
MemberAuthor

ethanndickson commentedJun 3, 2025
edited
Loading

Copy link
Contributor

@CopilotCopilotAI left a 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
FileDescription
vpn/vpn.protoAdded LastPing message definition and field in Agent message
vpn/version.goUpdated version from 1.1 to 1.2 with new network-related information
vpn/tunnel_internal_test.goUpdated tests to verify ping and latency data in agent updates
vpn/tunnel.goRefactored agent types, updated conversion functions, and added latency recording
vpn/speaker_internal_test.goUpdated expected handshake version
vpn/client.goAdded Ping, Node, and DERPMap functions to the VPN connection
tailnet/derpmap_test.go & derpmap.goAdded functions to extract DERP latency and preferred DERP names
coderd/util/maps/maps.goAdded a generic Map function for maps
coderd/database/db2sdk/db2sdk.goRemoved duplicate Map function
cli/ssh.goUpdated DERP latency extraction to use new tailnet functions

@ethanndicksonethanndickson marked this pull request as ready for reviewJune 3, 2025 06:50
johnstcn
johnstcn previously approved these changesJun 3, 2025
Copy link
Member

@johnstcnjohnstcn left a 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!

@ethanndicksonethanndickson marked this pull request as draftJune 4, 2025 11:15
@ethanndickson
Copy link
MemberAuthor

Found some issues, don't review.

deansheather
deansheather previously approved these changesJun 5, 2025
@deansheatherdeansheather dismissed stale reviews fromjohnstcn and themselfJune 5, 2025 03:13

still draft

@ethanndicksonethanndickson marked this pull request as ready for reviewJune 5, 2025 03:15
@ethanndicksonGraphite App
Copy link
MemberAuthor

ethanndickson commentedJun 6, 2025
edited
Loading

Merge activity

  • Jun 6, 4:18 AM UTC: A user started a stack merge that includes this pull request viaGraphite.
  • Jun 6, 4:18 AM UTC:@ethanndickson merged this pull request withGraphite.

@ethanndicksonethanndickson merged commit0076e84 intomainJun 6, 2025
35 checks passed
@ethanndicksonethanndickson deleted the ethan/send-ping-results branchJune 6, 2025 04:18
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

Copilot code reviewCopilotCopilot left review comments

@deansheatherdeansheatherdeansheather approved these changes

@johnstcnjohnstcnjohnstcn left review comments

@spikecurtisspikecurtisAwaiting requested review from spikecurtisspikecurtis is a code owner

Assignees

@ethanndicksonethanndickson

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Support exposing workspace latency for Coder Connect
3 participants
@ethanndickson@johnstcn@deansheather

[8]ページ先頭

©2009-2025 Movatter.jp