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

Update Event Logging to Use Structured Logging #414

Conversation

seanmalloy
Copy link
Member

Related to #347.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Oct 1, 2020
@seanmalloy
Copy link
Member Author

I confirmed it compiles, but did not test it yet.

/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 Oct 1, 2020
@seanmalloy
Copy link
Member Author

Confirmed working. The logs created by event.go are now structured logs. These logs only get printed at log level greater than or equal to 3.

./_output/bin/descheduler --kubeconfig=/Users/myuser/.kube/config --policy-config-file=./examples/pod-life-time.yml --v=3
I1001 00:57:27.950065   50322 node.go:46] "Node lister returned empty list, now fetch directly"
I1001 00:57:28.080233   50322 pod_lifetime.go:92] "Processing node" node="master-a"
I1001 00:57:28.174701   50322 pod_lifetime.go:92] "Processing node" node="master-b"
I1001 00:57:28.335082   50322 evictions.go:117] "Evicted pod" pod="openshift-config-operator/openshift-config-operator-7c86496786-qf2vl" reason=" (PodLifeTime)"
I1001 00:57:28.335369   50322 pod_lifetime.go:98] "Evicted pod because it exceeded its lifetime" pod="openshift-config-operator/openshift-config-operator-7c86496786-qf2vl" maxPodLifeTime=60
I1001 00:57:28.335394   50322 pod_lifetime.go:92] "Processing node" node="master-c"
I1001 00:57:28.335656   50322 event.go:291] "Event occurred" object="openshift-config-operator/openshift-config-operator-7c86496786-qf2vl" kind="Pod" apiVersion="v1" type="Normal" reason="Descheduled" message="pod evicted by sigs.k8s.io/descheduler (PodLifeTime)"
I1001 00:57:28.431837   50322 pod_lifetime.go:92] "Processing node" node="router-a-7j2jk"
I1001 00:57:28.569738   50322 evictions.go:117] "Evicted pod" pod="openshift-console/downloads-97db85755-6wmb6" reason=" (PodLifeTime)"
I1001 00:57:28.569985   50322 pod_lifetime.go:98] "Evicted pod because it exceeded its lifetime" pod="openshift-console/downloads-97db85755-6wmb6" maxPodLifeTime=60
I1001 00:57:28.570226   50322 event.go:291] "Event occurred" object="openshift-console/downloads-97db85755-6wmb6" kind="Pod" apiVersion="v1" type="Normal" reason="Descheduled" message="pod evicted by sigs.k8s.io/descheduler (PodLifeTime)"
I1001 00:57:28.657059   50322 evictions.go:117] "Evicted pod" pod="openshift-kube-storage-version-migrator/migrator-84f6d56959-lnw68" reason=" (PodLifeTime)"
I1001 00:57:28.657298   50322 pod_lifetime.go:98] "Evicted pod because it exceeded its lifetime" pod="openshift-kube-storage-version-migrator/migrator-84f6d56959-lnw68" maxPodLifeTime=60
I1001 00:57:28.657399   50322 event.go:291] "Event occurred" object="openshift-kube-storage-version-migrator/migrator-84f6d56959-lnw68" kind="Pod" apiVersion="v1" type="Normal" reason="Descheduled" message="pod evicted by sigs.k8s.io/descheduler (PodLifeTime)"
I1001 00:57:28.723524   50322 evictions.go:117] "Evicted pod" pod="openshift-marketplace/certified-operators-ff5f5d7f5-gx888" reason=" (PodLifeTime)"
I1001 00:57:28.723692   50322 pod_lifetime.go:98] "Evicted pod because it exceeded its lifetime" pod="openshift-marketplace/certified-operators-ff5f5d7f5-gx888" maxPodLifeTime=60
I1001 00:57:28.723825   50322 event.go:291] "Event occurred" object="openshift-marketplace/certified-operators-ff5f5d7f5-gx888" kind="Pod" apiVersion="v1" type="Normal" reason="Descheduled" message="pod evicted by sigs.k8s.io/descheduler (PodLifeTime)"
I1001 00:57:28.799006   50322 evictions.go:117] "Evicted pod" pod="openshift-marketplace/community-operators-7cdb87cbc5-k7whg" reason=" (PodLifeTime)"
I1001 00:57:28.799211   50322 pod_lifetime.go:98] "Evicted pod because it exceeded its lifetime" pod="openshift-marketplace/community-operators-7cdb87cbc5-k7whg" maxPodLifeTime=60
I1001 00:57:28.799404   50322 event.go:291] "Event occurred" object="openshift-marketplace/community-operators-7cdb87cbc5-k7whg" kind="Pod" apiVersion="v1" type="Normal" reason="Descheduled" message="pod evicted by sigs.k8s.io/descheduler (PodLifeTime)"
I1001 00:57:28.864123   50322 evictions.go:117] "Evicted pod" pod="openshift-marketplace/redhat-marketplace-6b75b995f5-2np5r" reason=" (PodLifeTime)"
I1001 00:57:28.864348   50322 pod_lifetime.go:98] "Evicted pod because it exceeded its lifetime" pod="openshift-marketplace/redhat-marketplace-6b75b995f5-2np5r" maxPodLifeTime=60
I1001 00:57:28.864450   50322 event.go:291] "Event occurred" object="openshift-marketplace/redhat-marketplace-6b75b995f5-2np5r" kind="Pod" apiVersion="v1" type="Normal" reason="Descheduled" message="pod evicted by sigs.k8s.io/descheduler (PodLifeTime)"
I1001 00:57:28.954734   50322 evictions.go:117] "Evicted pod" pod="openshift-marketplace/redhat-operators-8479cd5684-ct8zr" reason=" (PodLifeTime)"
I1001 00:57:28.954849   50322 pod_lifetime.go:98] "Evicted pod because it exceeded its lifetime" pod="openshift-marketplace/redhat-operators-8479cd5684-ct8zr" maxPodLifeTime=60
I1001 00:57:28.954870   50322 pod_lifetime.go:92] "Processing node" node="router-a-tsvp4"
I1001 00:57:28.954900   50322 event.go:291] "Event occurred" object="openshift-marketplace/redhat-operators-8479cd5684-ct8zr" kind="Pod" apiVersion="v1" type="Normal" reason="Descheduled" message="pod evicted by sigs.k8s.io/descheduler (PodLifeTime)"
I1001 00:57:29.153786   50322 evictions.go:117] "Evicted pod" pod="xpaas-operations/k-rhel7-diags-6b8db8bc86-wxt8k" reason=" (PodLifeTime)"
I1001 00:57:29.153973   50322 pod_lifetime.go:98] "Evicted pod because it exceeded its lifetime" pod="xpaas-operations/k-rhel7-diags-6b8db8bc86-wxt8k" maxPodLifeTime=60
I1001 00:57:29.154057   50322 pod_lifetime.go:92] "Processing node" node="router-b-7qrsg"
I1001 00:57:29.154057   50322 event.go:291] "Event occurred" object="xpaas-operations/k-rhel7-diags-6b8db8bc86-wxt8k" kind="Pod" apiVersion="v1" type="Normal" reason="Descheduled" message="pod evicted by sigs.k8s.io/descheduler (PodLifeTime)"
I1001 00:57:29.312228   50322 evictions.go:117] "Evicted pod" pod="openshift-console/downloads-97db85755-cwmgz" reason=" (PodLifeTime)"
I1001 00:57:29.312379   50322 pod_lifetime.go:98] "Evicted pod because it exceeded its lifetime" pod="openshift-console/downloads-97db85755-cwmgz" maxPodLifeTime=60
I1001 00:57:29.312414   50322 pod_lifetime.go:92] "Processing node" node="router-f-qn594"
I1001 00:57:29.312539   50322 event.go:291] "Event occurred" object="openshift-console/downloads-97db85755-cwmgz" kind="Pod" apiVersion="v1" type="Normal" reason="Descheduled" message="pod evicted by sigs.k8s.io/descheduler (PodLifeTime)"

/hold cancel
/assign @damemi
/cc @ingvagabund @lixiang233

@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 Oct 1, 2020
@seanmalloy
Copy link
Member Author

/kind cleanup

@k8s-ci-robot k8s-ci-robot added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Oct 1, 2020
@ingvagabund
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 Oct 1, 2020
Copy link
Contributor

@damemi damemi 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
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: damemi, seanmalloy

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 Oct 1, 2020
@k8s-ci-robot k8s-ci-robot merged commit 52f43f0 into kubernetes-sigs:master Oct 1, 2020
@seanmalloy seanmalloy deleted the event-recorder-structured-logs branch October 1, 2020 21:37
briend pushed a commit to briend/descheduler that referenced this pull request Feb 11, 2022
…order-structured-logs

Update Event Logging to Use Structured Logging
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/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. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants