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

Migrate sample-controller to contextual logging #113879

Merged

Conversation

pchan
Copy link
Contributor

@pchan pchan commented Nov 14, 2022

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

It migrates sample-controller to contextual and structured logging which is superior to the current unstructured logging.

Which issue(s) this PR fixes:

Part of kubernetes/enhancements#3077

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Migrated the “sample-controller” controller to use [contextual logging](https://k8s.io/docs/concepts/cluster-administration/system-logs/#contextual-logging).

/wg structured-logging
/assign @pohly
/cc @pohly
/cc @kubernetes/wg-structured-logging-reviews
/priority important-longterm
/area logging

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. labels Nov 14, 2022
@k8s-ci-robot k8s-ci-robot added do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. wg/structured-logging Categorizes an issue or PR as relevant to WG Structured Logging. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. area/logging cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Nov 14, 2022
@k8s-ci-robot
Copy link
Contributor

Hi @pchan. 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/test-infra 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. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. labels Nov 14, 2022
Copy link
Contributor

@yangjunmyfm192085 yangjunmyfm192085 left a comment

Choose a reason for hiding this comment

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

/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 Nov 15, 2022
@yangjunmyfm192085
Copy link
Contributor

/sig instrumentation

@k8s-ci-robot k8s-ci-robot added the sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. label Nov 15, 2022
@alexzielenski
Copy link
Contributor

/remove-sig api-machinery

@k8s-ci-robot k8s-ci-robot removed the sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. label Nov 15, 2022
@dashpole
Copy link
Contributor

/triage accepted

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Nov 17, 2022
staging/src/k8s.io/sample-controller/main.go Outdated Show resolved Hide resolved
staging/src/k8s.io/sample-controller/controller_test.go Outdated Show resolved Hide resolved
staging/src/k8s.io/sample-controller/controller.go Outdated Show resolved Hide resolved
@pohly
Copy link
Contributor

pohly commented Nov 25, 2022

You can squash all commits right away.

@pchan pchan force-pushed the contextual_logging_sample_controller branch from 4a1188a to c0ed4bf Compare November 30, 2022 10:25
@pchan
Copy link
Contributor Author

pchan commented Nov 30, 2022

You can squash all commits right away.

Done.

@pohly
Copy link
Contributor

pohly commented Dec 8, 2022

The cancel is called only when SIGINT or SIGTERM is received, there is an alternate path through the main function which will never hit this cancel (if no SIGINT/SIGTERM is received).

Are you talking about the normal path where main exits the program?

It doesn't matter whether cancel is called in that case.

@pchan pchan force-pushed the contextual_logging_sample_controller branch from c0ed4bf to e346475 Compare December 8, 2022 13:03
@shiva1333
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 8, 2022
@shiva1333
Copy link
Contributor

/assign @pohly for approval

@k8s-ci-robot
Copy link
Contributor

@shivanshu1333: GitHub didn't allow me to assign the following users: for, approval.

Note that only kubernetes members with read permissions, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time.
For more information please see the contributor guide

In response to this:

/assign @pohly for approval

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.

@pohly
Copy link
Contributor

pohly commented Dec 8, 2022

/assign @munnerz

For approval.

@pohly
Copy link
Contributor

pohly commented Feb 22, 2023

/assign @soltysh

For approval.

@soltysh
Copy link
Contributor

soltysh commented Mar 7, 2023

/release-note-edit Migrated the “sample-controller” controller to use contextual logging.

@soltysh
Copy link
Contributor

soltysh commented Mar 7, 2023

/release-note-edit Migrated the “sample-controller” controller to use [contextual logging](https://k8s.io/docs/concepts/cluster-administration/system-logs/#contextual-logging).

@soltysh
Copy link
Contributor

soltysh commented Mar 7, 2023

/release-note-edit release-note Migrated the “sample-controller” controller to use [contextual logging](https://k8s.io/docs/concepts/cluster-administration/system-logs/#contextual-logging).

Copy link
Contributor

@soltysh soltysh left a comment

Choose a reason for hiding this comment

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

/approve

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Mar 7, 2023
@sttts
Copy link
Contributor

sttts commented Mar 7, 2023

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: pchan, soltysh, sttts

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 Mar 7, 2023
@k8s-ci-robot
Copy link
Contributor

@pchan: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-kubernetes-e2e-gce e346475 link unknown /test pull-kubernetes-e2e-gce

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

@soltysh
Copy link
Contributor

soltysh commented Mar 7, 2023

/test pull-kubernetes-e2e-gce

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/logging cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on. wg/structured-logging Categorizes an issue or PR as relevant to WG Structured Logging.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants