Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce verbose logs that dump large objects #6197

Merged
merged 1 commit into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/monitor/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,6 @@ func (monitor *agentMonitor) getAgentCRD() (*v1beta1.AntreaAgentInfo, error) {
func (monitor *agentMonitor) updateAgentCRD(partial bool) (*v1beta1.AntreaAgentInfo, error) {
monitor.querier.GetAgentInfo(monitor.agentCRD, partial)
monitor.agentCRD.APICABundle = monitor.apiCertData
klog.V(2).Infof("Updating agent monitoring CRD %+v, partial: %t", monitor.agentCRD, partial)
klog.V(2).InfoS("Updating agent monitoring CRD", "name", klog.KObj(monitor.agentCRD), "partial", partial)
return monitor.client.CrdV1beta1().AntreaAgentInfos().Update(context.TODO(), monitor.agentCRD, metav1.UpdateOptions{})
}
4 changes: 2 additions & 2 deletions pkg/monitor/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,14 +188,14 @@ func (monitor *controllerMonitor) createControllerCRD(crdName string) (*v1beta1.
controllerCRD := new(v1beta1.AntreaControllerInfo)
controllerCRD.Name = crdName
monitor.querier.GetControllerInfo(controllerCRD, false)
klog.V(2).Infof("Creating controller monitoring CRD %+v", controllerCRD)
klog.V(2).InfoS("Creating controller monitoring CRD", "name", klog.KObj(controllerCRD))
return monitor.client.CrdV1beta1().AntreaControllerInfos().Create(context.TODO(), controllerCRD, metav1.CreateOptions{})
}

// updateControllerCRD updates the monitoring CRD.
func (monitor *controllerMonitor) updateControllerCRD(partial bool) (*v1beta1.AntreaControllerInfo, error) {
monitor.querier.GetControllerInfo(monitor.controllerCRD, partial)
klog.V(2).Infof("Updating controller monitoring CRD %+v, partial: %t", monitor.controllerCRD, partial)
klog.V(2).InfoS("Updating controller monitoring CRD", "name", klog.KObj(monitor.controllerCRD), "partial", partial)
return monitor.client.CrdV1beta1().AntreaControllerInfos().Update(context.TODO(), monitor.controllerCRD, metav1.UpdateOptions{})
}

Expand Down
8 changes: 7 additions & 1 deletion pkg/ovs/openflow/ofctrl_bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,13 @@ func (b *OFBridge) DumpTableStatus() []TableStatus {

// PacketRcvd is a callback when a packetIn is received on ofctrl.OFSwitch.
func (b *OFBridge) PacketRcvd(sw *ofctrl.OFSwitch, packet *ofctrl.PacketIn) {
klog.V(2).InfoS("Received packetIn", "packet", packet)
// Correspond to MessageStream.outbound log level.
if klog.V(7).Enabled() {
klog.InfoS("Received packetIn", "packet", packet)
} else {
klog.V(4).InfoS("Received packetIn")
}

if len(packet.UserData) == 0 {
klog.Info("Received packetIn without packetIn category in userdata")
return
Expand Down
6 changes: 3 additions & 3 deletions third_party/proxy/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ func (c *EndpointSliceConfig) handleAddEndpointSlice(obj interface{}) {
return
}
for _, h := range c.eventHandlers {
klog.V(4).InfoS("Calling handler.OnEndpointSliceAdd", "endpointSlice", endpointSlice)
klog.V(4).InfoS("Calling handler.OnEndpointSliceAdd", "endpointSlice", klog.KObj(endpointSlice))
h.OnEndpointSliceAdd(endpointSlice)
}
}
Expand All @@ -347,7 +347,7 @@ func (c *EndpointSliceConfig) handleUpdateEndpointSlice(oldObj, newObj interface
return
}
for _, h := range c.eventHandlers {
klog.V(4).InfoS("Calling handler.OnEndpointSliceUpdate", "from", oldEndpointSlice, "to", newEndpointSlice)
klog.V(4).InfoS("Calling handler.OnEndpointSliceUpdate", "endpointSlice", klog.KObj(newEndpointSlice))
h.OnEndpointSliceUpdate(oldEndpointSlice, newEndpointSlice)
}
}
Expand All @@ -366,7 +366,7 @@ func (c *EndpointSliceConfig) handleDeleteEndpointSlice(obj interface{}) {
}
}
for _, h := range c.eventHandlers {
klog.V(4).InfoS("Calling handler.OnEndpointSliceDelete", "endpointSlice", endpointSlice)
klog.V(4).InfoS("Calling handler.OnEndpointSliceDelete", "endpointSlice", klog.KObj(endpointSlice))
h.OnEndpointSliceDelete(endpointSlice)
}
}
Expand Down
Loading