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

components, logger: use contextual logging approach #1253

Merged

Conversation

ykaliuta
Copy link
Contributor

@ykaliuta ykaliuta commented Sep 19, 2024

Jira: https://issues.redhat.com/browse/RHOAIENG-14366

Switch ReconcileComponent from passing logger explicitly to wrapping
it into context[1][2]

Makes one parameter less to pass and will allow called utilities to
report component context where they are called from.

No user or logging format impact until utilities takes contextual
logging in use.

[1] https://www.kubernetes.dev/blog/2022/05/25/contextual-logging/
[2] https://github.com/kubernetes/enhancements/blob/master/keps/sig-instrumentation/3077-contextual-logging/README.md

Credits-To: Bartosz Majsak [email protected]
Signed-off-by: Yauheni Kaliuta [email protected]

Description

How Has This Been Tested?

Screenshot or short clip

Merge criteria

  • You have read the contributors guide.
  • Commit messages are meaningful - have a clear and concise summary and detailed explanation of what was changed and why.
  • Pull Request contains a description of the solution, a link to the JIRA issue, and to any dependent or related Pull Request.
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has manually tested the changes and verified that the changes work

@ykaliuta
Copy link
Contributor Author

ykaliuta commented Sep 20, 2024

/cc @bartoszmajsak

would like to implement your proposal. May be it makes sense to do it on startup and controller reconciler's levels from the beginning?

Also, I'm wondering what are the reasons of such a different configuration for controllers and components. (consequence, I need to enable devel to get Info from components, otherwise former Info from waitfordeployment is not seen.

/cc @zdtsw @lburgazzoli

@zdtsw zdtsw requested review from bartoszmajsak and removed request for CFSNM and biswassri September 23, 2024 07:57
@ykaliuta ykaliuta force-pushed the logger-components branch 2 times, most recently from 11a2300 to adce0b4 Compare September 26, 2024 08:39
@ykaliuta ykaliuta marked this pull request as draft September 26, 2024 08:40
Switch ReconcileComponent from passing logger explicitly to wrapping
it into context[1][2]

Makes one parameter less to pass and will allow called utilities to
report component context where they are called from.

No user or logging format impact until utilities takes contextual
logging in use.

[1] https://www.kubernetes.dev/blog/2022/05/25/contextual-logging/
[2] https://github.com/kubernetes/enhancements/blob/master/keps/sig-instrumentation/3077-contextual-logging/README.md

Credits-To: Bartosz Majsak [email protected]
Signed-off-by: Yauheni Kaliuta <[email protected]>
@ykaliuta ykaliuta marked this pull request as ready for review October 4, 2024 06:03
@openshift-ci openshift-ci bot requested a review from gzaronikas October 4, 2024 06:03
@ykaliuta ykaliuta changed the title components: wrap logger into context components, logger: use contextual logging approach Oct 4, 2024
@lburgazzoli
Copy link
Contributor

LGTM, I let @zdtsw doing the final review :)

@ykaliuta
Copy link
Contributor Author

@zdtsw any concerns?

Copy link

openshift-ci bot commented Oct 17, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: zdtsw

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

@ykaliuta
Copy link
Contributor Author

/retest-required

@openshift-merge-bot openshift-merge-bot bot merged commit fa862a1 into opendatahub-io:incubation Oct 17, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants