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

Commit4cc26be

Browse files
fix: set network telemetry client version on server (#14376)
1 parent5710a98 commit4cc26be

File tree

5 files changed

+151
-162
lines changed

5 files changed

+151
-162
lines changed

‎coderd/telemetry/telemetry.go

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1230,19 +1230,18 @@ func netcheckFromProto(proto *tailnetproto.Netcheck) Netcheck {
12301230

12311231
// NetworkEvent and all related structs come from tailnet.proto.
12321232
typeNetworkEventstruct {
1233-
ID uuid.UUID`json:"id"`
1234-
Time time.Time`json:"time"`
1235-
Applicationstring`json:"application"`
1236-
Statusstring`json:"status"`// connected, disconnected
1237-
DisconnectionReasonstring`json:"disconnection_reason"`
1238-
ClientTypestring`json:"client_type"`// cli, agent, coderd, wsproxy
1239-
ClientVersionstring`json:"client_version"`
1240-
NodeIDSelfuint64`json:"node_id_self"`
1241-
NodeIDRemoteuint64`json:"node_id_remote"`
1242-
P2PEndpointNetworkEventP2PEndpoint`json:"p2p_endpoint"`
1243-
HomeDERPint`json:"home_derp"`
1244-
DERPMapDERPMap`json:"derp_map"`
1245-
LatestNetcheckNetcheck`json:"latest_netcheck"`
1233+
ID uuid.UUID`json:"id"`
1234+
Time time.Time`json:"time"`
1235+
Applicationstring`json:"application"`
1236+
Statusstring`json:"status"`// connected, disconnected
1237+
ClientTypestring`json:"client_type"`// cli, agent, coderd, wsproxy
1238+
ClientVersionstring`json:"client_version"`
1239+
NodeIDSelfuint64`json:"node_id_self"`
1240+
NodeIDRemoteuint64`json:"node_id_remote"`
1241+
P2PEndpointNetworkEventP2PEndpoint`json:"p2p_endpoint"`
1242+
HomeDERPint`json:"home_derp"`
1243+
DERPMapDERPMap`json:"derp_map"`
1244+
LatestNetcheckNetcheck`json:"latest_netcheck"`
12461245

12471246
ConnectionAge*time.Duration`json:"connection_age"`
12481247
ConnectionSetup*time.Duration`json:"connection_setup"`
@@ -1277,18 +1276,18 @@ func NetworkEventFromProto(proto *tailnetproto.TelemetryEvent) (NetworkEvent, er
12771276
}
12781277

12791278
returnNetworkEvent{
1280-
ID:id,
1281-
Time:proto.Time.AsTime(),
1282-
Application:proto.Application,
1283-
Status:strings.ToLower(proto.Status.String()),
1284-
DisconnectionReason:proto.DisconnectionReason,
1285-
ClientType:strings.ToLower(proto.ClientType.String()),
1286-
NodeIDSelf:proto.NodeIdSelf,
1287-
NodeIDRemote:proto.NodeIdRemote,
1288-
P2PEndpoint:p2pEndpointFromProto(proto.P2PEndpoint),
1289-
HomeDERP:int(proto.HomeDerp),
1290-
DERPMap:derpMapFromProto(proto.DerpMap),
1291-
LatestNetcheck:netcheckFromProto(proto.LatestNetcheck),
1279+
ID:id,
1280+
Time:proto.Time.AsTime(),
1281+
Application:proto.Application,
1282+
Status:strings.ToLower(proto.Status.String()),
1283+
ClientType:strings.ToLower(proto.ClientType.String()),
1284+
ClientVersion:proto.ClientVersion,
1285+
NodeIDSelf:proto.NodeIdSelf,
1286+
NodeIDRemote:proto.NodeIdRemote,
1287+
P2PEndpoint:p2pEndpointFromProto(proto.P2PEndpoint),
1288+
HomeDERP:int(proto.HomeDerp),
1289+
DERPMap:derpMapFromProto(proto.DerpMap),
1290+
LatestNetcheck:netcheckFromProto(proto.LatestNetcheck),
12921291

12931292
ConnectionAge:protoDurationNil(proto.ConnectionAge),
12941293
ConnectionSetup:protoDurationNil(proto.ConnectionSetup),

‎tailnet/conn.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -733,6 +733,7 @@ func (c *Conn) SendConnectedTelemetry(ip netip.Addr, application string) {
733733
c.telemetryStore.markConnected(&ip,application)
734734
e:=c.newTelemetryEvent()
735735
e.Status=proto.TelemetryEvent_CONNECTED
736+
e.ConnectionSetup=durationpb.New(time.Since(c.createdAt))
736737
c.sendTelemetryBackground(e)
737738
}
738739

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp