mirror of
https://github.com/coder/coder.git
synced 2025-07-15 22:20:27 +00:00
fix: set network telemetry client version on server (#14376)
This commit is contained in:
@ -1230,19 +1230,18 @@ func netcheckFromProto(proto *tailnetproto.Netcheck) Netcheck {
|
||||
|
||||
// NetworkEvent and all related structs come from tailnet.proto.
|
||||
type NetworkEvent struct {
|
||||
ID uuid.UUID `json:"id"`
|
||||
Time time.Time `json:"time"`
|
||||
Application string `json:"application"`
|
||||
Status string `json:"status"` // connected, disconnected
|
||||
DisconnectionReason string `json:"disconnection_reason"`
|
||||
ClientType string `json:"client_type"` // cli, agent, coderd, wsproxy
|
||||
ClientVersion string `json:"client_version"`
|
||||
NodeIDSelf uint64 `json:"node_id_self"`
|
||||
NodeIDRemote uint64 `json:"node_id_remote"`
|
||||
P2PEndpoint NetworkEventP2PEndpoint `json:"p2p_endpoint"`
|
||||
HomeDERP int `json:"home_derp"`
|
||||
DERPMap DERPMap `json:"derp_map"`
|
||||
LatestNetcheck Netcheck `json:"latest_netcheck"`
|
||||
ID uuid.UUID `json:"id"`
|
||||
Time time.Time `json:"time"`
|
||||
Application string `json:"application"`
|
||||
Status string `json:"status"` // connected, disconnected
|
||||
ClientType string `json:"client_type"` // cli, agent, coderd, wsproxy
|
||||
ClientVersion string `json:"client_version"`
|
||||
NodeIDSelf uint64 `json:"node_id_self"`
|
||||
NodeIDRemote uint64 `json:"node_id_remote"`
|
||||
P2PEndpoint NetworkEventP2PEndpoint `json:"p2p_endpoint"`
|
||||
HomeDERP int `json:"home_derp"`
|
||||
DERPMap DERPMap `json:"derp_map"`
|
||||
LatestNetcheck Netcheck `json:"latest_netcheck"`
|
||||
|
||||
ConnectionAge *time.Duration `json:"connection_age"`
|
||||
ConnectionSetup *time.Duration `json:"connection_setup"`
|
||||
@ -1277,18 +1276,18 @@ func NetworkEventFromProto(proto *tailnetproto.TelemetryEvent) (NetworkEvent, er
|
||||
}
|
||||
|
||||
return NetworkEvent{
|
||||
ID: id,
|
||||
Time: proto.Time.AsTime(),
|
||||
Application: proto.Application,
|
||||
Status: strings.ToLower(proto.Status.String()),
|
||||
DisconnectionReason: proto.DisconnectionReason,
|
||||
ClientType: strings.ToLower(proto.ClientType.String()),
|
||||
NodeIDSelf: proto.NodeIdSelf,
|
||||
NodeIDRemote: proto.NodeIdRemote,
|
||||
P2PEndpoint: p2pEndpointFromProto(proto.P2PEndpoint),
|
||||
HomeDERP: int(proto.HomeDerp),
|
||||
DERPMap: derpMapFromProto(proto.DerpMap),
|
||||
LatestNetcheck: netcheckFromProto(proto.LatestNetcheck),
|
||||
ID: id,
|
||||
Time: proto.Time.AsTime(),
|
||||
Application: proto.Application,
|
||||
Status: strings.ToLower(proto.Status.String()),
|
||||
ClientType: strings.ToLower(proto.ClientType.String()),
|
||||
ClientVersion: proto.ClientVersion,
|
||||
NodeIDSelf: proto.NodeIdSelf,
|
||||
NodeIDRemote: proto.NodeIdRemote,
|
||||
P2PEndpoint: p2pEndpointFromProto(proto.P2PEndpoint),
|
||||
HomeDERP: int(proto.HomeDerp),
|
||||
DERPMap: derpMapFromProto(proto.DerpMap),
|
||||
LatestNetcheck: netcheckFromProto(proto.LatestNetcheck),
|
||||
|
||||
ConnectionAge: protoDurationNil(proto.ConnectionAge),
|
||||
ConnectionSetup: protoDurationNil(proto.ConnectionSetup),
|
||||
|
Reference in New Issue
Block a user