kubernetes-sigs / sig-storage-lib-external-provisioner

Apache License 2.0
548 stars 174 forks source link

Set log level for k8log.Info calls #145

Closed VladimirMarkelov closed 7 months ago

VladimirMarkelov commented 1 year ago

What

The MR sets a log level for k8log.Info calls in the module. I used a few sources to choose what level to set:

It resulted in setting V(4) for informational (e.g, klog.V(4).Info(logOperation(operation, "started"))) and successful operations (e.g, klog.V(4).Info(logOperation(operation, "succeeded")). For more important but still informational message I choose V(2) (e.g, klog.V(2).Info(logOperation(operation, "volume rescheduled because: %v", err)))

Why

Higher-level packages like external-provisioner provides a way to reduce logging by setting a certain log level at start. But majority of log messages of sig-storage-lib-external-provisioner are logged always. In some cases, logging everything may result in excessive logging that is hard to look through. An example is external-provisioner, which depends on this module. It is deployed on a few nodes of a cluster. When a volume is deleted, all nodes with running external-provisioner receive a request to delete the volume. But only one node contains it. So the log is filled with a plenty of messages deletion of PV started and deletion of PV ignored because the node does not contain the volume from the other nodes. I think, it would be good to have a "switch" to enable/disable certain message via setting log level as it is done in other Kubernetes packages.

linux-foundation-easycla[bot] commented 1 year ago

CLA Signed

The committers listed above are authorized under a signed CLA.

k8s-ci-robot commented 1 year ago

Welcome @VladimirMarkelov!

It looks like this is your first PR to kubernetes-sigs/sig-storage-lib-external-provisioner 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/sig-storage-lib-external-provisioner has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. :smiley:

k8s-ci-robot commented 1 year ago

Hi @VladimirMarkelov. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
VladimirMarkelov commented 1 year ago

Closing the MR for now. I'll reopen it later when everything is ready

VladimirMarkelov commented 1 year ago

@humblec , @chrishenzie

I reopen my PR after getting "green light" from my manager. The PR is ready for review.

Thank you.

sunnylovestiramisu commented 11 months ago

/ok-to-test

k8s-triage-robot commented 8 months ago

The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

VladimirMarkelov commented 8 months ago

/remove-lifecycle stale

VladimirMarkelov commented 7 months ago

@humblec , @chrishenzie, @sunnylovestiramisu The tests passed. Please review the MR or advise me who I can ask to do it. Thank you!

jsafrane commented 7 months ago

@VladimirMarkelov I am terribly sorry, this library did not get enough review attention. Can you please rebase? And if I don't review it in a few days, please ping me on slack.

VladimirMarkelov commented 7 months ago

/ok-to-test

VladimirMarkelov commented 7 months ago

@jsafrane I've rebased my MR. Please review when you have time. Thank you!

jsafrane commented 7 months ago

/lgtm /approve

Thanks a lot!

k8s-ci-robot commented 7 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jsafrane, VladimirMarkelov

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/kubernetes-sigs/sig-storage-lib-external-provisioner/blob/master/OWNERS)~~ [jsafrane] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment