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

[Feature]: Operator can get consistent logs from korifi-controllers-controller-manager #1180

Closed
julian-hj opened this issue Jun 3, 2022 · 2 comments

Comments

@julian-hj
Copy link
Member

julian-hj commented Jun 3, 2022

Blockers/Dependencies

Background

As a Operator
I want predictable and consistent log format
So that I can use tools to search and organize logs

Acceptance Criteria

GIVEN a Korifi deployment
WHEN I kubectl logs -n korifi-controllers-system korifi-controllers-controller-manager-xxxxxxxxxx-xxxxx manager
THEN I see that the results are consistently formatted in json following this proposal

Dev Notes

See implementation notes in the proposal for suggestions

Some logging appears to come from the k8s code, e.g.

I0603 20:05:55.339392       1 request.go:601] Waited for 1.040934921s due to client-side throttling, not priority and fairness, request: GET:https://10.96.0.1:443/apis/acme.cert-manager.io/v1?timeout=32s
I0603 20:05:25.656018       1 leaderelection.go:248] attempting to acquire leader lease korifi-controllers-system/13c200ec.cloudfoundry.org...

This logging is in a different format from the other log lines from the same executable. We may have some work to do in order to make sure we have loggers consistently plumbed through the layers in our code.

@julian-hj julian-hj added this to 🇺🇸 To do in Korifi - Backlog via automation Jun 3, 2022
@acosta11
Copy link
Member

acosta11 commented Oct 13, 2022

Some logging appears to come from the k8s code, e.g.

I0603 20:05:55.339392 1 request.go:601] Waited for 1.040934921s due to client-side throttling, not priority and fairness, request: GET:https://10.96.0.1:443/apis/acme.cert-manager.io/v1?timeout=32s
I0603 20:05:25.656018 1 leaderelection.go:248] attempting to acquire leader lease korifi-controllers-system/13c200ec.cloudfoundry.org...

Based on an issue we saw in controller runtime (1420) we may not be able to control the logger used by client-go in the leaderelection package, so those logs will remain controlled by the default klog implementation.

Edit: It looks like y'all managed to set the klog logger in a related story to defer to our logging without having to separately configure its format.

acosta11 added a commit that referenced this issue Oct 13, 2022
[#1180]

Co-authored-by: Clint Yoshimura <clinty@vmware.com>
acosta11 added a commit that referenced this issue Oct 13, 2022
[#1180]

Co-authored-by: Clint Yoshimura <clinty@vmware.com>
julian-hj added a commit that referenced this issue Oct 13, 2022
- leader election code uses klog, so we want to make sure it logs to the
  same format.

[#1180]

Co-authored-by: Julian Hjortshoj <hjortshojj@vmware.com>
Korifi - Backlog automation moved this from 🇺🇸 To do to ✅ Done Oct 14, 2022
@julian-hj
Copy link
Member Author

A/C passed

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

No branches or pull requests

2 participants