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

switch to structured logging #126

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

Conversation

pinikomarov
Copy link

@pinikomarov pinikomarov commented Sep 3, 2023

This automatically adds additional fields like reconcile_id etc.. from the controller context.

before :

2023-05-18T01:53:14+03:00 INFO controllers.KeystoneAPI Reconciled Service init successfully

after:

`2023-10-19T12:26:41+03:00 INFO Controllers.ManilaAPI Reconciling Service 'manilaapi-sample' {"controller": "manilaapi", "controllerGroup": "manila.openstack.org", "controllerKind": "ManilaAPI", "ManilaAPI": {"name":"manilaapi-sample","namespace":"openstack"}, "namespace": "openstack", "name": "manilaapi-sample", "reconcileID": "360c1316-82f3-4b34-a510-8030ca39fefb"}

`

*by using per reconcile function respective logger objects, the intention is to lay the ground for parallel reconciliation in future and avoid race conditions as ctx objects are reconcile run specific.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 3, 2023

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: pinikomarov
Once this PR has been reviewed and has the lgtm label, please assign viroel 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

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 3, 2023

Hi @pinikomarov. Thanks for your PR.

I'm waiting for a openstack-k8s-operators 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.

@fmount
Copy link
Collaborator

fmount commented Oct 24, 2023

/ok-to-test

@pinikomarov
Copy link
Author

/retest-required

@pinikomarov
Copy link
Author

recheck

update logging

fix name

update test logging

update logging

update logging

Structured logging
@pinikomarov
Copy link
Author

recheck

1 similar comment
@pinikomarov
Copy link
Author

recheck

@abays
Copy link
Contributor

abays commented Nov 16, 2023

/test manila-operator-build-deploy-tempest

@abays
Copy link
Contributor

abays commented Nov 16, 2023

@pinikomarov: 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
ci/prow/manila-operator-build-deploy-tempest fc55570 link true /test manila-operator-build-deploy-tempest

Full PR test history. Your PR dashboard.

@pinikomarov It looks like something isn't happy with the code:

controllers/manila_controller.go:269:6: r.Log undefined (type *ManilaReconciler has no field or method Log)
controllers/manila_controller.go:279:7: r.Log undefined (type *ManilaReconciler has no field or method Log)
Go compliance shim [4035] [][]: Exited with: 1
make: *** [Makefile:133: vet] Error 1

@pinikomarov
Copy link
Author

/retest

@pinikomarov
Copy link
Author

hi @abays , that's weird , do you know why the test complains about lines that are different in the patch?
according to the failed test error:

controllers/manila_controller.go:269:6: r.Log undefined (type *ManilaReconciler has no field or method Log) controllers/manila_controller.go:279:7: r.Log undefined (type *ManilaReconciler has no field or method Log) Go compliance shim [4078] [][]: Exited with: 1 make: *** [Makefile:133: vet] Error 1

But those locations (on manila_controller.go) are not as they they are in the patch:
i.e. no Log usage on thise lines at all
https://github.com/openstack-k8s-operators/manila-operator/pull/126/files#diff-4e27682ccc90b4003362f107571ffb93ae5820ee0618b20054065d7473c6ea79L269

https://github.com/openstack-k8s-operators/manila-operator/pull/126/files#diff-4e27682ccc90b4003362f107571ffb93ae5820ee0618b20054065d7473c6ea79L279

@pinikomarov
Copy link
Author

/retest

1 similar comment
@pinikomarov
Copy link
Author

/retest

Copy link
Contributor

openshift-ci bot commented Dec 18, 2023

@pinikomarov: 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
ci/prow/manila-operator-build-deploy-tempest fc55570 link true /test manila-operator-build-deploy-tempest

Full PR test history. Your PR dashboard.

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.

@stuggi
Copy link
Contributor

stuggi commented Jun 3, 2024

@pinikomarov can you rebase?

@openshift-merge-robot
Copy link
Contributor

PR needs rebase.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants