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

Improve controller manager logs #4115

Merged
merged 1 commit into from Nov 17, 2022
Merged

Conversation

g-gaston
Copy link
Member

Description of changes

This now makes use of the tooling provided by upstream controller-runtime and component-base/logs. As a consequence, the manager now takes a standard set of flags to configure logging.

The default logging format is configured to json, it's the direction upstream is going due to its tooling support. For tilt, using text for now until we provide better tooling to analyze the logs.

Instead of injecting a logger in the reconciler on construction, we now use contextual logging. The benefit here is controller-runtime will inject a default set of values that uniquely identify the reconcile request.

More info

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@eks-distro-bot eks-distro-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 16, 2022
k8s.io/apimachinery v0.24.3
k8s.io/apiserver v0.24.2
k8s.io/client-go v0.24.2
k8s.io/api v0.25.4
Copy link
Member

Choose a reason for hiding this comment

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

Why all the go mod changes?

Copy link
Member Author

Choose a reason for hiding this comment

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

I bumped controller-runtime to use their latest logger attributes (reconcileID for example).

Also, go upgraded some modules when adding component-base.

Copy link
Member

@vivek-koppuru vivek-koppuru left a comment

Choose a reason for hiding this comment

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

Just some questions that I am not sure of

manager/main.go Show resolved Hide resolved
manager/main.go Show resolved Hide resolved
controllers/cluster_controller.go Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Nov 16, 2022

Codecov Report

Merging #4115 (721b5fc) into main (a1479b9) will decrease coverage by 0.00%.
The diff coverage is 88.88%.

@@            Coverage Diff             @@
##             main    #4115      +/-   ##
==========================================
- Coverage   67.59%   67.58%   -0.01%     
==========================================
  Files         397      397              
  Lines       32072    32064       -8     
==========================================
- Hits        21679    21671       -8     
  Misses       8966     8966              
  Partials     1427     1427              
Impacted Files Coverage Δ
controllers/factory.go 94.94% <ø> (-0.12%) ⬇️
controllers/vsphere_datacenter_controller.go 10.34% <50.00%> (-1.52%) ⬇️
controllers/cluster_controller.go 75.51% <92.30%> (-0.17%) ⬇️
controllers/docker_datacenter_controller.go 100.00% <100.00%> (ø)
controllers/snow_machineconfig_controller.go 89.09% <100.00%> (-0.20%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@g-gaston
Copy link
Member Author

/approve

This now makes use of the tooling provided by upstream
controller-runtime and component-base/logs. As a consequence, the
manager now takes a standard set of flags to configure logging.

The default logging format is configured to json, it's the direction
upstream is going duwe to its tooling support. For tilt, using text
for now until we provide better tooling to analyze the logs.

Instead of injecting a logger in the reconciler on construction, we now
use contextual logging. The benefit here is controller-runtime will
inject a default set of values that uniquely identify the reconcile
request.
@g-gaston
Copy link
Member Author

/approve

@eks-distro-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: g-gaston

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

@eks-distro-bot eks-distro-bot merged commit 8dfb38f into aws:main Nov 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants