openstack-k8s-operators / dev-docs

Documentation
9 stars 25 forks source link

switch to structured logging #53

Closed pinikomarov closed 10 months ago

pinikomarov commented 1 year ago

This patch adds the explanation for the changes that incorporate the below :

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-05-18T02:00:28+03:00 INFO Controllers.KeystoneAPI Reconciled Service init successfully {"controller": "keystoneapi", "controllerGroup": "keystone.openstack.org", "controllerKind":"KeystoneAPI", "KeystoneAPI": {"name":"keystone","namespace":"openstack"}, "namespace": "openstack", "name": "keystone", "reconcileID": "512a4d9b-f31d-4fa4-a4cc-cd6c13e4455d"}

*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.

*example logs lines are currently from keystone operator #220_patch until this operator deployment patch testing is is done

pinikomarov commented 10 months ago

@gibizer can you review please ?