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

Refactor logging #1755

Merged
merged 1 commit into from
May 22, 2024
Merged

Refactor logging #1755

merged 1 commit into from
May 22, 2024

Conversation

Amulyam24
Copy link
Contributor

@Amulyam24 Amulyam24 commented May 3, 2024

What this PR does / why we need it:

This PR adds

  • Logs wherever necessary
  • Proper naming for PowerVS and VPC
  • Consistent error format starting with failed to
  • Add appropriate log levels, debug set at level 3
  • Consistent naming of infra resources

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #1720

Special notes for your reviewer:

/area provider/ibmcloud

  1. Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.

Release note:

Refactor logging

@k8s-ci-robot k8s-ci-robot added area/provider/ibmcloud Issues or PRs related to ibmcloud provider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels May 3, 2024
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label May 3, 2024
Copy link

netlify bot commented May 3, 2024

Deploy Preview for kubernetes-sigs-cluster-api-ibmcloud ready!

Name Link
🔨 Latest commit 27f93eb
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-cluster-api-ibmcloud/deploys/664dbb1aa7854100089301b7
😎 Deploy Preview https://deploy-preview-1755--kubernetes-sigs-cluster-api-ibmcloud.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@Amulyam24 Amulyam24 force-pushed the logs branch 2 times, most recently from 8b7b720 to 7dc0f41 Compare May 3, 2024 09:33
@Prajyot-Parab
Copy link
Contributor

/cc @Karthik-K-N

Copy link
Contributor

@Karthik-K-N Karthik-K-N left a comment

Choose a reason for hiding this comment

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

This is one of the much needed PR, Thanks for submitting this.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 8, 2024
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 8, 2024
@Amulyam24
Copy link
Contributor Author

/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 8, 2024
@Prajyot-Parab
Copy link
Contributor

/remove-approve

@k8s-ci-robot k8s-ci-robot removed the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 8, 2024
@Amulyam24
Copy link
Contributor Author

@Karthik-K-N @Prajyot-Parab , what are your thoughts on changing the log level to 3 by default?
By default if user doesn't set v flag, we will be missing important log messages with the current changes right?

@Karthik-K-N
Copy link
Contributor

@Karthik-K-N @Prajyot-Parab , what are your thoughts on changing the log level to 3 by default? By default if user doesn't set v flag, we will be missing important log messages with the current changes right?

If we go as per capi standards the logs are not for users its for sre/developers https://cluster-api.sigs.k8s.io/developer/logging#logging.
So we can keep info/generic logs at level 1, debug information at 3 and more detailed info around 5 v levels.

So we can update the doc in developer section of the book about setting v level to higher one if the user is interested in debugging things.

Meanwhile we should spend some time in adding more events and condition with user perspective in mind.

@Amulyam24
Copy link
Contributor Author

@Karthik-K-N @Prajyot-Parab , what are your thoughts on changing the log level to 3 by default? By default if user doesn't set v flag, we will be missing important log messages with the current changes right?

If we go as per capi standards the logs are not for users its for sre/developers https://cluster-api.sigs.k8s.io/developer/logging#logging. So we can keep info/generic logs at level 1, debug information at 3 and more detailed info around 5 v levels.

So we can update the doc in developer section of the book about setting v level to higher one if the user is interested in debugging things.

Meanwhile we should spend some time in adding more events and condition with user perspective in mind.

Thank you for the input @Karthik-K-N, will refactor the logs accordingly.

@dharaneeshvrd
Copy link
Contributor

@Amulyam24 errors appended during reconcileDelete are not printed in controller log, there is no way to know it as well, please see whether we can add a log message here

@mkumatag mkumatag added this to the v0.8 milestone May 17, 2024
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 20, 2024
@mkumatag
Copy link
Member

@Amulyam24 can you please resolve the conflicts and update the PR?

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 22, 2024
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 22, 2024
@Amulyam24 Amulyam24 force-pushed the logs branch 3 times, most recently from eaed366 to bf3ad89 Compare May 22, 2024 08:23
@mkumatag
Copy link
Member

/unhold

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 22, 2024
@Amulyam24
Copy link
Contributor Author

@Amulyam24 can you please resolve the conflicts and update the PR?

PR is ready for review, PTAL @mkumatag @Karthik-K-N

cloud/scope/powervs_machine.go Outdated Show resolved Hide resolved
cloud/scope/powervs_cluster.go Outdated Show resolved Hide resolved
Copy link
Contributor

@Karthik-K-N Karthik-K-N left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 22, 2024
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 22, 2024
Copy link
Member

@mkumatag mkumatag left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 22, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Amulyam24, mkumatag

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 k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 22, 2024
@k8s-ci-robot k8s-ci-robot merged commit fd15e31 into kubernetes-sigs:main May 22, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/provider/ibmcloud Issues or PRs related to ibmcloud provider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhance and add proper logging
6 participants