From 1dcb74a1f3a87cd1f882b6590794bc903fb3c404 Mon Sep 17 00:00:00 2001 From: Imran Pochi Date: Thu, 7 Aug 2025 23:10:53 +0000 Subject: [PATCH] fix: update log levels Following [the guidelines](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/logging.md#what-method-to-use), the change reflects changing the verbosity levels to reflect significant or extended state changes Signed-off-by: Imran Pochi --- pkg/server/backend_manager.go | 8 ++++---- pkg/server/server.go | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/server/backend_manager.go b/pkg/server/backend_manager.go index 3ecb6bb86..97b5d8c7d 100644 --- a/pkg/server/backend_manager.go +++ b/pkg/server/backend_manager.go @@ -244,10 +244,10 @@ func containIDType(idTypes []header.IdentifierType, idType header.IdentifierType // addBackend adds a backend. func (s *DefaultBackendStorage) addBackend(identifier string, idType header.IdentifierType, backend *Backend) { if !containIDType(s.idTypes, idType) { - klog.V(4).InfoS("fail to add backend", "backend", identifier, "error", &ErrWrongIDType{idType, s.idTypes}) + klog.V(3).InfoS("fail to add backend", "backend", identifier, "error", &ErrWrongIDType{idType, s.idTypes}) return } - klog.V(5).InfoS("Register backend for agent", "agentID", identifier) + klog.V(2).InfoS("Register backend for agent", "agentID", identifier) s.mu.Lock() defer s.mu.Unlock() _, ok := s.backends[identifier] @@ -273,7 +273,7 @@ func (s *DefaultBackendStorage) removeBackend(identifier string, idType header.I klog.ErrorS(&ErrWrongIDType{idType, s.idTypes}, "fail to remove backend") return } - klog.V(5).InfoS("Remove connection for agent", "agentID", identifier) + klog.V(2).InfoS("Remove connection for agent", "agentID", identifier) s.mu.Lock() defer s.mu.Unlock() backends, ok := s.backends[identifier] @@ -347,7 +347,7 @@ func (s *DefaultBackendStorage) GetRandomBackend() (*Backend, error) { return nil, &ErrNotFound{} } agentID := s.agentIDs[s.random.Intn(len(s.agentIDs))] - klog.V(5).InfoS("Pick agent as backend", "agentID", agentID) + klog.V(3).InfoS("Pick agent as backend", "agentID", agentID) // always return the first connection to an agent, because the agent // will close later connections if there are multiple. return s.backends[agentID][0], nil diff --git a/pkg/server/server.go b/pkg/server/server.go index e609584f1..8ca3f0cef 100644 --- a/pkg/server/server.go +++ b/pkg/server/server.go @@ -719,7 +719,7 @@ func (s *ProxyServer) Connect(stream agent.AgentService_ConnectServer) error { } agentID := backend.GetAgentID() - klog.V(5).InfoS("Connect request from agent", "agentID", agentID, "serverID", s.serverID) + klog.V(2).InfoS("Connect request from agent", "agentID", agentID, "serverID", s.serverID) labels := runpprof.Labels( "serverCount", strconv.Itoa(s.serverCount), "agentID", agentID, @@ -946,7 +946,7 @@ func (s *ProxyServer) serveRecvBackend(backend *Backend, agentID string, recvCh klog.V(5).InfoS("Ignoring unrecognized packet from backend", "packet", pkt, "agentID", agentID) } } - klog.V(5).InfoS("Close backend of agent", "agentID", agentID) + klog.V(3).InfoS("Close backend of agent", "agentID", agentID) } func (s *ProxyServer) sendBackendClose(backend *Backend, connectID int64, random int64, reason string) {