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

[cinder-csi-plugin] implement structured logging #2652

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sergelogvinov
Copy link
Contributor

@sergelogvinov sergelogvinov commented Sep 17, 2024

What this PR does / why we need it:

implement structured logging KEP 1602

CSI plugins often use common values like node name, volume name, volume ID, and instance ID in unstructured error and log messages. This makes it hard to group and sort them. I want to change these logs to structured logs, as the core Kubernetes team has decided to move in this direction

Current logs:

CreateVolume: Successfully created volume 47d323fd-b06c-424e-b27b-d27db2fb2c5c in Availability Zone: nova of size 10 GiB

Structured logs

"Successfully created volume" func="CreateVolume" volumeID="228d4464-48a2-4a45-81a7-24d3d0a1862a" size=10 zone="nova"
"Successfully detached volume" func="ControllerUnpublishVolume" volumeID="228d4464-48a2-4a45-81a7-24d3d0a1862a" instanceID="89e33913-0cce-4c1a-be2f-4e6a39d32b51"
"Successfully deleted volume" func="DeleteVolume" volumeID="228d4464-48a2-4a45-81a7-24d3d0a1862a" cloud=""

Default log keys:

  • func- name of function, example CreateVolume
  • size - volume size
  • volume - volume name
  • volumeID - volume ID
  • snapshotID - snapshot ID
  • instanceID - instance ID
  • zone - availability zone
  • cloud - cloud config

Which issue this PR fixes(if applicable):

make sense after #2640

Special notes for reviewers:

Release note:

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Sep 17, 2024
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Sep 17, 2024
@k8s-ci-robot k8s-ci-robot requested a review from kayrus September 17, 2024 05:23
@k8s-ci-robot
Copy link
Contributor

Hi @sergelogvinov. Thanks for your PR.

I'm waiting for a kubernetes 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-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 17, 2024
@sergelogvinov sergelogvinov force-pushed the logging branch 3 times, most recently from 485fd9c to 4ea910a Compare September 17, 2024 06:28
@jichenjc
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 20, 2024
@kayrus
Copy link
Contributor

kayrus commented Sep 25, 2024

@sergelogvinov thanks for the PR. Please add more context in the PR description, e.g. how logs will look like comparing to old style. Also its worth to add this link for the context https://github.com/kubernetes/enhancements/blob/master/keps/sig-instrumentation/1602-structured-logging/README.md#new-klog-methods
The release notes are must have for such changes.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 15, 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 Oct 22, 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 Nov 14, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign zetaab for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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 removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 28, 2024
@sergelogvinov sergelogvinov force-pushed the logging branch 3 times, most recently from ab6b90e to 874790c Compare November 30, 2024 15:50
@sergelogvinov sergelogvinov marked this pull request as ready for review November 30, 2024 18:40
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 30, 2024
@k8s-ci-robot k8s-ci-robot requested review from dulek and zetaab November 30, 2024 18:40
@sergelogvinov
Copy link
Contributor Author

/retest

@sergelogvinov
Copy link
Contributor Author

@kayrus Whenever you have a moment, could you please take a look at this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note-none Denotes a PR that doesn't merit a release note. 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.

4 participants