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

chore: add function to group entries by action in changeset output #844

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

94DanielBrown
Copy link

This can then be used to improve cardinality of logs in kustomize-controller.
I have tested and will make a PR to kustomize-controller which does this:

log.Info("server-side apply for cluster definitions completed", "output", changeSet.ToMap())
+                       log.Info("server-side apply for cluster definitions completed", "output", changeSet.ToGroupedMap()

It helps with fluxcd/flux2#4036

Signed-off-by: Daniel Brown <daniel.brown2@sainsburys.co.uk>
@stefanprodan
Copy link
Member

We can't just change the log format of a GA controller, we'll break the filters people have for these logs just to comply with a small subset that are using elastic. If we decide to get this in, it needs to be under a feature flag in kustomize-controller.

@94DanielBrown
Copy link
Author

Yeah that makes sense

But is there any harm getting the function added into here for now and then I can look at adding the feature flag in the controller and using it there after, if you agree that's an okay thing to do?

@stefanprodan
Copy link
Member

stefanprodan commented Dec 13, 2024

We need to analyse all the logging across all controllers and check if the structure logs contain keys with namespace/name/kind/etc. Changing this one log line may not solve the issue with ES.

@94DanielBrown
Copy link
Author

Can it not just be added as a feature flag for just the kustomize controller as this is where the issue are?

Also if it's added here as a function it doesn't have to be used but it makes it easier to use if someone want to run a fork of the controller to sort out the logging in ES/OS ?

@stefanprodan
Copy link
Member

Can it not just be added as a feature flag for just the kustomize controller as this is where the issue are?

Yes, what I'm saying is that there may be other places where the log keys are high cardinality, and the feature flag should fix this everywhere. I'll run some queries on my clusters and see if such logs are in other places besides here.

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

Successfully merging this pull request may close these issues.

2 participants