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

add option to limit grpc logging length #127

Merged
merged 1 commit into from
Jan 13, 2023

Conversation

leiyiz
Copy link
Contributor

@leiyiz leiyiz commented Jan 13, 2023

What type of PR is this?
/kind feature

What this PR does / why we need it:
in some cases the GRPC response is huge and logging it entirely causes log space to fill up immediately.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

Now there's an option to set a universal limit on GRPC log length.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jan 13, 2023
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jan 13, 2023
@leiyiz
Copy link
Contributor Author

leiyiz commented Jan 13, 2023

this is similar to how pdcsi driver is going to limit log length in kubernetes-sigs/gcp-compute-persistent-disk-csi-driver#1085

@leiyiz
Copy link
Contributor Author

leiyiz commented Jan 13, 2023

/assign @msau42

Copy link
Collaborator

@msau42 msau42 left a comment

Choose a reason for hiding this comment

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

Log length is mainly an issue with List volume and snapshot calls, where there could be a lot of objects in the system.

The main downside I can see with this approach is that if there are any important fields in the struct after the list of volumes/snapshots, then those will get dropped. But in practice, that is not relevant to the csi list calls.

Another approach could be to allow setting a custom log function, and then having attacher and snapshotter implement some custom handling where maybe it could treat List calls at a debug log level. WDYT? Do you see value in logging the first few entries vs not logging any entries at all?

@leiyiz
Copy link
Contributor Author

leiyiz commented Jan 13, 2023

I think with truncated logging we can potentially do some driver-side randomization on the sequence of the list of Volumes in the future thus retain some debuggability. With the custom logger approach my intuition is that there's more potential to accidentally blast other types of rpc call also.

@msau42
Copy link
Collaborator

msau42 commented Jan 13, 2023

Thanks, I think this is sufficient for now. If anyone else thinks a custom logger may be beneficial, we can look into that as another enhancement.

/lgtm
/approve

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: leiyiz, msau42

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 Jan 13, 2023
@k8s-ci-robot k8s-ci-robot merged commit 680df1d into kubernetes-csi:master Jan 13, 2023
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants