refactor: Simplify telemetry metrics by removing site_id and enhancing tunnel_id usage

Former-commit-id: a86b14d97dbea5610705141fa8b8b6fea625b036
This commit is contained in:
Marc Schäfer
2025-10-07 18:43:09 +02:00
parent 1561554fec
commit 2a80d1fd45
10 changed files with 53 additions and 54 deletions
+2 -2
View File
@@ -295,7 +295,7 @@ func startPingCheck(tnet *netstack.Net, serverIP string, client *websocket.Clien
connectionLost = true
logger.Warn("Connection to server lost after %d failures. Continuous reconnection attempts will be made.", consecutiveFailures)
if tunnelID != "" {
telemetry.IncReconnect(context.Background(), "", tunnelID, telemetry.ReasonTimeout)
telemetry.IncReconnect(context.Background(), tunnelID, telemetry.ReasonTimeout)
}
stopFunc = client.SendMessageInterval("newt/ping/request", map[string]interface{}{}, 3*time.Second)
// Send registration message to the server for backward compatibility
@@ -325,7 +325,7 @@ func startPingCheck(tnet *netstack.Net, serverIP string, client *websocket.Clien
recentLatencies = append(recentLatencies, latency)
// Record tunnel latency (limit sampling to this periodic check)
if tunnelID != "" {
telemetry.ObserveTunnelLatency(context.Background(), "", tunnelID, "wireguard", latency.Seconds())
telemetry.ObserveTunnelLatency(context.Background(), tunnelID, "wireguard", latency.Seconds())
}
if len(recentLatencies) > 10 {
recentLatencies = recentLatencies[1:]