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

Optimize logs #356

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Optimize logs #356

wants to merge 1 commit into from

Conversation

dshehbaj
Copy link
Member

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@dshehbaj dshehbaj changed the title pkg ebpf: move logs to debug Optimize logs Jan 22, 2025
@henkka
Copy link

henkka commented Feb 5, 2025

I was about to submit an issue regarding the excessive logging verbosity caused by this component, but I'm glad to see that logging optimizations are already in progress. The code at https://github.com/aws/aws-network-policy-agent/blob/main/controllers/policyendpoints_controller.go#L327-L333 is generating a high volume of logs in our environments. Could these log statements also be optimized (e.g., moved to debug level) as part of this pull request?

@@ -149,7 +149,7 @@ func NewBpfClient(policyEndpointeBPFContext *sync.Map, nodeIP string, enablePoli
err = ebpfClient.bpfSDKClient.IncreaseRlimit()
if err != nil {
//No need to error out from here. We should be good to proceed.
ebpfClient.logger.Info("Failed to increase RLIMIT on the node....but moving forward")
ebpfClient.logger.V(1).Info("Failed to increase RLIMIT on the node....but moving forward")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dshehbaj Lets wrap this as logger.Debug logger.Info and logger.Error for readability.

We can modify the informational logs to Debug logs and any logs in critical code path should be left as Info

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants