From ad1b0356e68d60dfd2ea8c7cea8892cd3e9cb1fe Mon Sep 17 00:00:00 2001 From: Slavik Panasovets Date: Thu, 16 Feb 2023 13:54:17 +0000 Subject: [PATCH] Log metrics updates with V(2) for L4 Controllers --- pkg/l4lb/l4controller.go | 8 ++++---- pkg/l4lb/l4netlbcontroller.go | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pkg/l4lb/l4controller.go b/pkg/l4lb/l4controller.go index 02ec791d9a..b54c84ab0c 100644 --- a/pkg/l4lb/l4controller.go +++ b/pkg/l4lb/l4controller.go @@ -497,10 +497,10 @@ func (l4c *L4Controller) publishMetrics(result *loadbalancers.L4ILBSyncResult, n } switch result.SyncType { case loadbalancers.SyncTypeCreate, loadbalancers.SyncTypeUpdate: - klog.V(6).Infof("Internal L4 Loadbalancer for Service %s ensured, updating its state %v in metrics cache", namespacedName, result.MetricsState) + klog.V(2).Infof("Internal L4 Loadbalancer for Service %s ensured, updating its state %v in metrics cache", namespacedName, result.MetricsState) l4c.ctx.ControllerMetrics.SetL4ILBService(namespacedName, result.MetricsState) if l4c.enableDualStack { - klog.V(6).Infof("Internal L4 DualStack Loadbalancer for Service %s ensured, updating its state %v in metrics cache", namespacedName, result.DualStackMetricsState) + klog.V(2).Infof("Internal L4 DualStack Loadbalancer for Service %s ensured, updating its state %v in metrics cache", namespacedName, result.DualStackMetricsState) l4c.ctx.ControllerMetrics.SetL4ILBDualStackService(namespacedName, result.DualStackMetricsState) } l4metrics.PublishILBSyncMetrics(result.Error == nil, result.SyncType, result.GCEResourceInError, utils.GetErrorType(result.Error), result.StartTime) @@ -508,10 +508,10 @@ func (l4c *L4Controller) publishMetrics(result *loadbalancers.L4ILBSyncResult, n case loadbalancers.SyncTypeDelete: // if service is successfully deleted, remove it from cache if result.Error == nil { - klog.V(6).Infof("Internal L4 Loadbalancer for Service %s deleted, removing its state from metrics cache", namespacedName) + klog.V(2).Infof("Internal L4 Loadbalancer for Service %s deleted, removing its state from metrics cache", namespacedName) l4c.ctx.ControllerMetrics.DeleteL4ILBService(namespacedName) if l4c.enableDualStack { - klog.V(6).Infof("Internal L4 DualStack LoadBalancer for Service %s deleted, removing its state from metrics cache", namespacedName) + klog.V(2).Infof("Internal L4 DualStack LoadBalancer for Service %s deleted, removing its state from metrics cache", namespacedName) l4c.ctx.ControllerMetrics.DeleteL4ILBDualStackService(namespacedName) } } diff --git a/pkg/l4lb/l4netlbcontroller.go b/pkg/l4lb/l4netlbcontroller.go index 6d020c2228..411e094e40 100644 --- a/pkg/l4lb/l4netlbcontroller.go +++ b/pkg/l4lb/l4netlbcontroller.go @@ -633,20 +633,20 @@ func (lc *L4NetLBController) publishMetrics(result *loadbalancers.L4NetLBSyncRes namespacedName := types.NamespacedName{Name: name, Namespace: namespace}.String() switch result.SyncType { case loadbalancers.SyncTypeCreate, loadbalancers.SyncTypeUpdate: - klog.V(4).Infof("External L4 Loadbalancer for Service %s ensured, updating its state %v in metrics cache", namespacedName, result.MetricsState) + klog.V(2).Infof("External L4 Loadbalancer for Service %s ensured, updating its state %v in metrics cache", namespacedName, result.MetricsState) lc.ctx.ControllerMetrics.SetL4NetLBService(namespacedName, result.MetricsState) if lc.enableDualStack { - klog.V(6).Infof("External L4 DualStack Loadbalancer for Service %s ensured, updating its state %v in metrics cache", namespacedName, result.DualStackMetricsState) + klog.V(2).Infof("External L4 DualStack Loadbalancer for Service %s ensured, updating its state %v in metrics cache", namespacedName, result.DualStackMetricsState) lc.ctx.ControllerMetrics.SetL4NetLBDualStackService(namespacedName, result.DualStackMetricsState) } lc.publishSyncMetrics(result) case loadbalancers.SyncTypeDelete: // if service is successfully deleted, remove it from cache if result.Error == nil { - klog.V(4).Infof("External L4 Loadbalancer for Service %s deleted, removing its state from metrics cache", namespacedName) + klog.V(2).Infof("External L4 Loadbalancer for Service %s deleted, removing its state from metrics cache", namespacedName) lc.ctx.ControllerMetrics.DeleteL4NetLBService(namespacedName) if lc.enableDualStack { - klog.V(6).Infof("External L4 Loadbalancer for Service %s deleted, removing its state from metrics cache", namespacedName) + klog.V(2).Infof("External L4 Loadbalancer for Service %s deleted, removing its state from metrics cache", namespacedName) lc.ctx.ControllerMetrics.DeleteL4NetLBDualStackService(namespacedName) } }