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

Automaxprocs library prints log in a different format then the rest of the KEDA operator #5970

Open
zachgilbert-upwork opened this issue Jul 18, 2024 · 2 comments
Labels
bug Something isn't working good first issue Good for newcomers help wanted Looking for support from community

Comments

@zachgilbert-upwork
Copy link

Report

With the addition of the automaxprocs package to set GOMAXPROCS (#4999), the KEDA operator now prints one console type log on startup, then switches to the format configured by logging.operator.format:

2024/07/18 20:58:55 maxprocs: Updating GOMAXPROCS=1: determined from CPU quota
2024-07-18T20:58:57.052292080Z {"level":"info","ts":"2024-07-18T20:58:57Z","logger":"setup","msg":"Starting manager"}
2024-07-18T20:58:57.052312817Z {"level":"info","ts":"2024-07-18T20:58:57Z","logger":"setup","msg":"KEDA Version: 2.13.1"}
{"level":"info","ts":"2024-07-18T20:58:57Z","logger":"setup","msg":"Git Commit: 41dd7a8558fdb274f2c0861f6c6d1eba01f2dcd5"}
2024-07-18T20:58:57.052319615Z {"level":"info","ts":"2024-07-18T20:58:57Z","logger":"setup","msg":"Go Version: go1.21.6"}
2024-07-18T20:58:57.052321484Z {"level":"info","ts":"2024-07-18T20:58:57Z","logger":"setup","msg":"Go OS/Arch: linux/amd64"}
2024-07-18T20:58:57.052323828Z {"level":"info","ts":"2024-07-18T20:58:57Z","logger":"setup","msg":"Running on Kubernetes 1.29+","version":"v1.29.4-eks-036c24b"}
2024-07-18T20:58:57.153119735Z I0718 20:58:57.153022       1 leaderelection.go:250] attempting to acquire leader lease h6m-core-keda/operator.keda.sh...
2024-07-18T20:58:57.153330709Z {"level":"info","ts":"2024-07-18T20:58:57Z","msg":"starting server","kind":"health probe","addr":"[::]:8081"}

We are running KEDA in an environment where this is breaking our log ingestion, as we expect only one log format. The way to disable this logging, or implement it with the same logger as the rest app, is documented here: uber-go/automaxprocs#18.

Expected Behavior

When setting the logging.operator.format to json, I expect all logs produced by the KEDA operator to be in JSON format.

Actual Behavior

When running KEDA operator, there is one log printed by the automaxprocs package that doesn't respect the format as configured by the user.

Steps to Reproduce the Problem

  1. Run KEDA Operator
  2. Observe logs

Logs from KEDA operator

2024/07/18 20:58:55 maxprocs: Updating GOMAXPROCS=1: determined from CPU quota
2024-07-18T20:58:57.052292080Z {"level":"info","ts":"2024-07-18T20:58:57Z","logger":"setup","msg":"Starting manager"}
2024-07-18T20:58:57.052312817Z {"level":"info","ts":"2024-07-18T20:58:57Z","logger":"setup","msg":"KEDA Version: 2.13.1"}
{"level":"info","ts":"2024-07-18T20:58:57Z","logger":"setup","msg":"Git Commit: 41dd7a8558fdb274f2c0861f6c6d1eba01f2dcd5"}
2024-07-18T20:58:57.052319615Z {"level":"info","ts":"2024-07-18T20:58:57Z","logger":"setup","msg":"Go Version: go1.21.6"}
2024-07-18T20:58:57.052321484Z {"level":"info","ts":"2024-07-18T20:58:57Z","logger":"setup","msg":"Go OS/Arch: linux/amd64"}
2024-07-18T20:58:57.052323828Z {"level":"info","ts":"2024-07-18T20:58:57Z","logger":"setup","msg":"Running on Kubernetes 1.29+","version":"v1.29.4-eks-036c24b"}
2024-07-18T20:58:57.153119735Z I0718 20:58:57.153022       1 leaderelection.go:250] attempting to acquire leader lease h6m-core-keda/operator.keda.sh...
2024-07-18T20:58:57.153330709Z {"level":"info","ts":"2024-07-18T20:58:57Z","msg":"starting server","kind":"health probe","addr":"[::]:8081"}

KEDA Version

2.13.1

Kubernetes Version

1.29

Platform

Amazon Web Services

Scaler Details

No response

Anything else?

No response

@zachgilbert-upwork zachgilbert-upwork added the bug Something isn't working label Jul 18, 2024
@JorTurFer
Copy link
Member

Interesting catch!
are you willing to open a PR with the change?

Copy link

stale bot commented Sep 29, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale All issues that are marked as stale due to inactivity label Sep 29, 2024
@JorTurFer JorTurFer added help wanted Looking for support from community good first issue Good for newcomers and removed stale All issues that are marked as stale due to inactivity labels Sep 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Looking for support from community
Projects
None yet
Development

No branches or pull requests

2 participants