sig-storage-lib-external-provisioner icon indicating copy to clipboard operation
sig-storage-lib-external-provisioner copied to clipboard

Set log level for k8log.Info calls

Open VladimirMarkelov opened this issue 1 year ago • 9 comments

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:

  • https://github.com/kubernetes-csi/external-attacher
  • https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/logging.md#what-method-to-use

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.

VladimirMarkelov avatar Jun 23 '23 22:06 VladimirMarkelov

CLA Signed

The committers listed above are authorized under a signed CLA.

  • :white_check_mark: login: VladimirMarkelov / name: Vladimir Markelov (400b63c1ab1854212ec9038906367d7957ed49a8)

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 avatar Jun 23 '23 22:06 k8s-ci-robot

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. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

k8s-ci-robot avatar Jun 23 '23 22:06 k8s-ci-robot

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

VladimirMarkelov avatar Jun 26 '23 22:06 VladimirMarkelov

@humblec , @chrishenzie

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

Thank you.

VladimirMarkelov avatar Aug 15 '23 22:08 VladimirMarkelov

/ok-to-test

sunnylovestiramisu avatar Dec 26 '23 15:12 sunnylovestiramisu

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

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle stale
  • Close this PR with /close
  • Offer to help out with Issue Triage

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

/lifecycle stale

k8s-triage-robot avatar Mar 25 '24 16:03 k8s-triage-robot

/remove-lifecycle stale

VladimirMarkelov avatar Mar 25 '24 20:03 VladimirMarkelov

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

VladimirMarkelov avatar Apr 19 '24 23:04 VladimirMarkelov

@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.

jsafrane avatar Apr 26 '24 07:04 jsafrane

/ok-to-test

VladimirMarkelov avatar Apr 26 '24 18:04 VladimirMarkelov

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

VladimirMarkelov avatar Apr 26 '24 18:04 VladimirMarkelov

/lgtm /approve

Thanks a lot!

jsafrane avatar Apr 29 '24 09:04 jsafrane

[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:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

k8s-ci-robot avatar Apr 29 '24 09:04 k8s-ci-robot