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

Get rid of redundant logs in HCN version range checks #1053

Merged
merged 1 commit into from
Jun 25, 2021

Conversation

dcantah
Copy link
Contributor

@dcantah dcantah commented Jun 22, 2021

Kubeproxy logs are filled with redudnant version check spam from an unexported call that's invoked
as part of checking if a feature is supported. The logs don't detail what feature(s) are even being checked
so it just seems like spam. With the way things are implemented all of the hcn features are checked for support in
any of the hcn.XSupported() calls not just the one being checked, so these logs come up quite a bit if there's
many features that aren't supported on the machine.

Add two new logs in a sync.Once that logs the HNS version and supported features. This should be enough
to investigate version issues.

Should remedy #1043

Signed-off-by: Daniel Canter dcanter@microsoft.com

@dcantah dcantah requested a review from a team as a code owner June 22, 2021 23:26
Copy link
Member

@kevpar kevpar left a comment

Choose a reason for hiding this comment

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

LGTM assuming CI is happy. Thanks for cleaning up logs.

@dcantah
Copy link
Contributor Author

dcantah commented Jun 22, 2021

@elweb9858 @vikas-bh @Keith-Mange @erfrimod @netal. Talked with Betsy briefly but seems like these shouldn't be very useful in the unit tests either but wanted to make sure beforehand.

@elweb9858
Copy link
Contributor

@elweb9858
Copy link
Contributor

lgtm but would like a sanity check from someone else on my team. for reference this is called in kube-proxy here. the logging in this function seems unnecessary because any failed version checks will get a separate log message in kube-proxy, as Danny mentioned in the PR description

@dcantah
Copy link
Contributor Author

dcantah commented Jun 22, 2021

It's called in a couple other places where checking for specific features too https://github.com/kubernetes/kubernetes/blob/2453f07e933a6d2ac0be1eb35061a2154ccce5b8/pkg/proxy/winkernel/proxier.go#L588

@elweb9858
Copy link
Contributor

@dcantah ohhhh I didn't realize all those specific feature checks call this too. this is so much more logging spam than I originally thought!

@JocelynBerrendonner
Copy link
Member

I would advise not to remove these. I'd suggest moving them to "Debugf" or "Tracef" levels if they are too noisy. We needed these traces to debug feature availability in the past, so they are useful.

@JocelynBerrendonner
Copy link
Member

Also, as per our discussion, Kube-Proxy is repeatedly calling into this code, but this is less than efficient (since the response will never change). In an ideal world, kube proxy should check it once (in an init() block), cache the info, and use it later on.

@dcantah
Copy link
Contributor Author

dcantah commented Jun 23, 2021

After talking with @JocelynBerrendonner it sounds like it might make more sense to just have a log print out (once) the supported features and the version of HNS, so I'll add this. Sounds like there was some use for these in assistance for investigating issues but the spam is completely agreed upon.

@dcantah
Copy link
Contributor Author

dcantah commented Jun 24, 2021

@JocelynBerrendonner Updated! Not sure what else we can log if hcsshim is vendored into the project (kubernetes for example). If you have an idea let me know

hcn/hcnsupport.go Outdated Show resolved Hide resolved
hcn/hcnsupport.go Outdated Show resolved Hide resolved
hcn/hcnsupport.go Outdated Show resolved Hide resolved
logrus.WithFields(logrus.Fields{
"Major": globals.Version.Major,
"Minor": globals.Version.Minor,
}).Infof("HNS version")
Copy link
Member

Choose a reason for hiding this comment

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

Also think this should probably not be Info level. Can we make it Debug or Trace instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't believe k8s uses logrus so they don't set the level/expose configuring the logrus level by virtue of that. This would likely mean these logs won't show up

Copy link
Member

Choose a reason for hiding this comment

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

Do we believe it's important for this log to show up in k8s output?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@JocelynBerrendonner Had mentioned this would help with investigations regarding when a customer is questioning why certain HCN feature(s) aren't working/supported.

Copy link
Member

Choose a reason for hiding this comment

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

If it's helpful to have for that case, then I think it's okay to leave it at Info, given it only logs once.

Kubeproxy logs are filled with redudnant version check spam from an unexported call that's invoked
as part of checking if a feature is supported. The logs don't detail what feature(s) are even being checked
so it just seems like spam. With the way things are implemented all of the hcn features are checked for support in
any of the `hcn.XSupported()` calls not just the one being checked, so these logs come up quite a bit if there's
many features that aren't supported on the machine.

Add two new logs in a sync.Once that logs the HNS version and supported features. This should be enough
to investigate version issues.

Should remedy microsoft#1043

Signed-off-by: Daniel Canter <dcanter@microsoft.com>
Copy link
Contributor

@katiewasnothere katiewasnothere left a comment

Choose a reason for hiding this comment

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

lgtm, assuming @JocelynBerrendonner is okay with the removed logs

Copy link
Member

@kevpar kevpar left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@JocelynBerrendonner JocelynBerrendonner left a comment

Choose a reason for hiding this comment

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

LGTM

@JocelynBerrendonner
Copy link
Member

Thanks a lot, Danny for taking all my feedback and getting my suggestion in! This is much appreciated!

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.

Request to use Debugf instead of Infof for redundant logs in isFeatureInRange
5 participants