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 #576

Conversation

pinikomarov
Copy link
Contributor

@pinikomarov pinikomarov commented Oct 17, 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-18T02:27:44.637+0300 INFO Controllers.NovaNoVNCProxy Successfully reconciled {"control
ler": "novanovncproxy", "controllerGroup": "nova.openstack.org", "controllerKind": "NovaNoVNCProxy", "Nov
aNoVNCProxy": {"name":"nova-cell1-novncproxy","namespace":"openstack"}, "namespace": "openstack", "name":
"nova-cell1-novncproxy", "reconcileID": "93d8ab7c-76f0-45ed-9981-f925fef21ae7", "instance": {"apiVersion
": "nova.openstack.org/v1beta1", "kind": "NovaNoVNCProxy", "namespace": "openstack", "name": "nova-cell1-
novncproxy"}}

*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 Oct 17, 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.

@pinikomarov pinikomarov marked this pull request as ready for review October 17, 2023 22:39
@softwarefactory-project-zuul
Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://review.rdoproject.org/zuul/buildset/13855129374f4722874b12e8456ce0f2

✔️ nova-operator-content-provider SUCCESS in 1h 27m 52s
nova-operator-kuttl FAILURE in 37m 10s
nova-operator-tempest-multinode FAILURE in 1h 08m 47s

@pinikomarov pinikomarov force-pushed the structured_logging branch 5 times, most recently from 6d67aab to 3084649 Compare October 18, 2023 02:06
@gibizer
Copy link
Contributor

gibizer commented Oct 19, 2023

/ok-to-test

Copy link
Contributor

@mrkisaolamb mrkisaolamb left a comment

Choose a reason for hiding this comment

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

Unfortunatly tests are failing with error:
panic: odd number of arguments passed as key-value pairs for logging [recovered] panic: odd number of arguments passed as key-value pairs for logging. Looks like some log texts need to be reformated by fmt.Sprintf

@pinikomarov
Copy link
Contributor Author

thanks @mrkisaolamb , I have uploaded a fix in all locations I saw a syntax mishap ,
can you point me to the link where that error was printed ? (I can't seem to find that in the tests` logs)

@pinikomarov
Copy link
Contributor Author

/retest

@softwarefactory-project-zuul
Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://review.rdoproject.org/zuul/buildset/c40496857e6a480d855dc90cad749a94

✔️ nova-operator-content-provider SUCCESS in 2h 12m 30s
✔️ nova-operator-kuttl SUCCESS in 38m 14s
nova-operator-tempest-multinode FAILURE in 1h 54m 08s

@mrkisaolamb mrkisaolamb self-requested a review October 23, 2023 07:10
@mrkisaolamb
Copy link
Contributor

thanks @mrkisaolamb , I have uploaded a fix in all locations I saw a syntax mishap , can you point me to the link where that error was printed ? (I can't seem to find that in the tests` logs)

hey @pinikomarov I run locally GINKGO_ARGS="--output-interceptor-mode=none" make test to got full error output. Now I see that syntax is fixed, thanks!

@bogdando
Copy link
Contributor

lgtm

Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://review.rdoproject.org/zuul/buildset/28645cfcb3a44956885e212f192b52a9

✔️ nova-operator-content-provider SUCCESS in 2h 59m 03s
✔️ nova-operator-kuttl SUCCESS in 37m 33s
nova-operator-tempest-multinode FAILURE in 2h 20m 27s

@mrkisaolamb
Copy link
Contributor

recheck

controllers/nova_controller.go Show resolved Hide resolved
Copy link
Contributor

openshift-ci bot commented Dec 5, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gibizer, mrkisaolamb, pinikomarov

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:
  • OWNERS [gibizer,mrkisaolamb]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved label Dec 5, 2023
@openshift-merge-bot openshift-merge-bot bot merged commit a80926e into openstack-k8s-operators:main Dec 5, 2023
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