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

fix: ensure consistent JSON log format for automaxprocs #6335

Merged
merged 2 commits into from
Nov 21, 2024

Conversation

omerap12
Copy link
Contributor

@omerap12 omerap12 commented Nov 15, 2024

Configures automaxprocs to use the application logger instead of default console logging to maintain consistent JSON format across all log output.
output:

keda-admission-webhooks:
 ~/ k logs deployments.apps/keda-admission-webhooks -n keda
2024-11-15T18:39:05Z	INFO	setup	maxprocs: Updating GOMAXPROCS=1: determined from CPU quota	{"system": "automaxprocs"}
2024-11-15T18:39:05Z	INFO	setup	Starting admission webhooks
2024-11-15T18:39:05Z	INFO	setup	KEDA Version: main
2024-11-15T18:39:05Z	INFO	setup	Git Commit: c2a6df04230e1f62d335127e0a02694015c79fa6
2024-11-15T18:39:05Z	INFO	setup	Go Version: go1.23.3
2024-11-15T18:39:05Z	INFO	setup	Go OS/Arch: linux/arm64
2024-11-15T18:39:05Z	INFO	setup	Running on Kubernetes 1.30	{"version": "v1.30.0"}
2024-11-15T18:39:05Z	INFO	controller-runtime.builder	skip registering a mutating webhook, object does not implement admission.Defaulter or WithDefaulter wasn't called	{"GVK": "keda.sh/v1alpha1, Kind=ScaledObject"}

keda-operator:

 ~/ k logs deployment/keda-operator -n keda
2024-11-15T18:39:00Z	INFO	setup	maxprocs: Updating GOMAXPROCS=1: determined from CPU quota	{"system": "automaxprocs"}
2024-11-15T18:39:00Z	INFO	setup	Starting manager
2024-11-15T18:39:00Z	INFO	setup	KEDA Version: main
2024-11-15T18:39:00Z	INFO	setup	Git Commit: c2a6df04230e1f62d335127e0a02694015c79fa6
2024-11-15T18:39:00Z	INFO	setup	Go Version: go1.23.3
2024-11-15T18:39:00Z	INFO	setup	Go OS/Arch: linux/arm64
2024-11-15T18:39:00Z	INFO	setup	Running on Kubernetes 1.30	{"version": "v1.30.0"}
2024-11-15T18:39:01Z	INFO	starting server	{"name": "health probe", "addr": "[::]:8081"}
I1115 18:39:01.071646       1 leaderelection.go:254] attempting to acquire leader lease keda/operator.keda.sh...
I1115 18:39:39.767722       1 leaderelection.go:268] successfully acquired lease keda/operator.keda.sh

keda-operator-metrics-apiserver:

 ~/ k logs deployments.apps/keda-operator-metrics-apiserver -n keda                       
I1115 18:38:55.350590       1 welcome.go:34] "msg"="Starting metrics server" "logger"="keda_metrics_adapter"
I1115 18:38:55.350752       1 welcome.go:35] "msg"="KEDA Version: main" "logger"="keda_metrics_adapter"
I1115 18:38:55.350756       1 welcome.go:36] "msg"="Git Commit: c2a6df04230e1f62d335127e0a02694015c79fa6" "logger"="keda_metrics_adapter"
I1115 18:38:55.350759       1 welcome.go:37] "msg"="Go Version: go1.23.3" "logger"="keda_metrics_adapter"
I1115 18:38:55.350761       1 welcome.go:38] "msg"="Go OS/Arch: linux/arm64" "logger"="keda_metrics_adapter"
I1115 18:38:55.350775       1 welcome.go:39] "msg"="Running on Kubernetes 1.30" "logger"="keda_metrics_adapter" "version"={"major":"1","minor":"30","gitVersion":"v1.30.0","gitCommit":"7c48c2bd72b9bf5c44d21d7338cc7bea77d0ad2a","gitTreeState":"clean","buildDate":"2024-05-13T22:02:25Z","goVersion":"go1.22.2","compiler":"gc","platform":"linux/arm64"}
I1115 18:38:55.350913       1 main.go:263] "msg"="maxprocs: Updating GOMAXPROCS=1: determined from CPU quota" "logger"="keda_metrics_adapter"
I1115 18:38:55.351645       1 main.go:112] "msg"="Connecting Metrics Service gRPC client to the server" "address"="keda-operator.keda.svc.cluster.local:9666" "logger"="keda_metrics_adapter"

Checklist

Fixes #5970

@omerap12 omerap12 requested a review from a team as a code owner November 15, 2024 18:42
Copy link
Member

@zroubalik zroubalik left a comment

Choose a reason for hiding this comment

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

Thanks, this is great!

Could you please define this in a single place and just reference in each component? The best place is probably a new file in https://github.com/kedacore/keda/tree/main/pkg/util

@omerap12
Copy link
Contributor Author

Thanks, this is great!

Could you please define this in a single place and just reference in each component? The best place is probably a new file in https://github.com/kedacore/keda/tree/main/pkg/util

fixed :)

@zroubalik
Copy link
Member

zroubalik commented Nov 19, 2024

/run-e2e internal
Update: You can check the progress here

@zroubalik
Copy link
Member

@omerap12
Copy link
Contributor Author

@omerap12 could you please also update Changelog? https://github.com/kedacore/keda/blob/main/CHANGELOG.md#improvements-1

Done

@omerap12 omerap12 requested a review from zroubalik November 19, 2024 12:29
@wozniakjan
Copy link
Member

wozniakjan commented Nov 19, 2024

/run-e2e internal
Update: You can check the progress here

@omerap12
Copy link
Contributor Author

/run-e2e internal Update: You can check the progress here

Passed. can we merge it? :)

Copy link
Member

@JorTurFer JorTurFer left a comment

Choose a reason for hiding this comment

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

LGTM! Could you move the changelog entry to the unreleased section? after the release it was moved to v2.16 and should be unreleased yet

Signed-off-by: Omer Aplatony <[email protected]>
@omerap12
Copy link
Contributor Author

omerap12 commented Nov 21, 2024

LGTM! Could you move the changelog entry to the unreleased section? after the release it was moved to v2.16 and should be unreleased yet

hope I did it right this time lol

@wozniakjan wozniakjan enabled auto-merge (squash) November 21, 2024 08:39
@wozniakjan
Copy link
Member

/skip-e2e
(last commit is just CHANGELOG.md change, previous commit e2e tests passed)

@wozniakjan wozniakjan merged commit 8b4ccdb into kedacore:main Nov 21, 2024
19 checks passed
mpechner-akasa pushed a commit to nrichardson-akasa/keda that referenced this pull request Nov 29, 2024
* fix: ensure consistent JSON log format for automaxprocs

Signed-off-by: Omer Aplatony <[email protected]>

* moved to Unreleased

Signed-off-by: Omer Aplatony <[email protected]>

---------

Signed-off-by: Omer Aplatony <[email protected]>
Signed-off-by: michael pechner <[email protected]>
robpickerill pushed a commit to robpickerill/keda that referenced this pull request Nov 30, 2024
* fix: ensure consistent JSON log format for automaxprocs

Signed-off-by: Omer Aplatony <[email protected]>

* moved to Unreleased

Signed-off-by: Omer Aplatony <[email protected]>

---------

Signed-off-by: Omer Aplatony <[email protected]>
rickbrouwer pushed a commit to rickbrouwer/keda that referenced this pull request Dec 4, 2024
* fix: ensure consistent JSON log format for automaxprocs

Signed-off-by: Omer Aplatony <[email protected]>

* moved to Unreleased

Signed-off-by: Omer Aplatony <[email protected]>

---------

Signed-off-by: Omer Aplatony <[email protected]>
rickbrouwer pushed a commit to rickbrouwer/keda that referenced this pull request Dec 4, 2024
* fix: ensure consistent JSON log format for automaxprocs

Signed-off-by: Omer Aplatony <[email protected]>

* moved to Unreleased

Signed-off-by: Omer Aplatony <[email protected]>

---------

Signed-off-by: Omer Aplatony <[email protected]>
rickbrouwer pushed a commit to rickbrouwer/keda that referenced this pull request Dec 4, 2024
* fix: ensure consistent JSON log format for automaxprocs

Signed-off-by: Omer Aplatony <[email protected]>

* moved to Unreleased

Signed-off-by: Omer Aplatony <[email protected]>

---------

Signed-off-by: Omer Aplatony <[email protected]>
ctccxxd pushed a commit to ctccxxd/keda that referenced this pull request Dec 10, 2024
* fix: ensure consistent JSON log format for automaxprocs

Signed-off-by: Omer Aplatony <[email protected]>

* moved to Unreleased

Signed-off-by: Omer Aplatony <[email protected]>

---------

Signed-off-by: Omer Aplatony <[email protected]>
@JorTurFer JorTurFer mentioned this pull request Dec 22, 2024
24 tasks
JorTurFer pushed a commit to JorTurFer/keda that referenced this pull request Dec 22, 2024
* fix: ensure consistent JSON log format for automaxprocs

Signed-off-by: Omer Aplatony <[email protected]>

* moved to Unreleased

Signed-off-by: Omer Aplatony <[email protected]>

---------

Signed-off-by: Omer Aplatony <[email protected]>
JorTurFer pushed a commit to JorTurFer/keda that referenced this pull request Dec 22, 2024
* fix: ensure consistent JSON log format for automaxprocs

Signed-off-by: Omer Aplatony <[email protected]>

* moved to Unreleased

Signed-off-by: Omer Aplatony <[email protected]>

---------

Signed-off-by: Omer Aplatony <[email protected]>
Signed-off-by: Jorge Turrado <[email protected]>
JorTurFer added a commit that referenced this pull request Dec 24, 2024
* fix: CVE-2024-45337 (#6422)

Signed-off-by: Jorge Turrado <[email protected]>

* :fix: ensure consistent JSON log format for automaxprocs (#6335)

* fix: ensure consistent JSON log format for automaxprocs

Signed-off-by: Omer Aplatony <[email protected]>

* moved to Unreleased

Signed-off-by: Omer Aplatony <[email protected]>

---------

Signed-off-by: Omer Aplatony <[email protected]>
Signed-off-by: Jorge Turrado <[email protected]>

* Upgrade to the latest new-relic-go v2 client (#6325)

Signed-off-by: Jorge Turrado <[email protected]>

* refactor: replace experimental `maps` and `slices` with stdlib (#6372)

Signed-off-by: Eng Zer Jun <[email protected]>
Signed-off-by: Jan Wozniak <[email protected]>
Co-authored-by: Jan Wozniak <[email protected]>
Signed-off-by: Jorge Turrado <[email protected]>

* fix: Selenium Grid scaler exposes sum of pending and ongoing sessions to KDEA (#6368)

Signed-off-by: Jorge Turrado <[email protected]>

* fix: scaledjobs stuck as not ready (#6329)

since code was missing for setting a scaledjob as ready it was stuck as unready if there ever was a problem

This is a fix for a regression in #5916

Signed-off-by: Mårten Svantesson <[email protected]>
Signed-off-by: Jorge Turrado <[email protected]>

* fix: Paused ScaledObject count is reported correctly after operator restart (#6322)

Signed-off-by: Jorge Turrado <[email protected]>

* update changelog

Signed-off-by: Jorge Turrado <[email protected]>

* Bump go and deps (#6434)

* Bump go and deps

Signed-off-by: Jorge Turrado <[email protected]>

* bump golang.org/x/net

Signed-off-by: Jorge Turrado <[email protected]>

* Add missing permissions to code-scaners

Signed-off-by: Jorge Turrado <[email protected]>

* update release tracker

Signed-off-by: Jorge Turrado <[email protected]>

* fix aws scaler

Signed-off-by: Jorge Turrado <[email protected]>

* Pass theregion

Signed-off-by: Jorge Turrado <[email protected]>

* Pass theregion

Signed-off-by: Jorge Turrado <[email protected]>

* fix aws tests

Signed-off-by: Jorge Turrado <[email protected]>

* fix aws tests

Signed-off-by: Jorge Turrado <[email protected]>

* Update AWS admission probes

Signed-off-by: Jorge Turrado <[email protected]>

---------

Signed-off-by: Jorge Turrado <[email protected]>
Signed-off-by: Jorge Turrado <[email protected]>

* commit last vendored deps

Signed-off-by: Jorge Turrado <[email protected]>

* fix: Selenium Grid in case multiple scaler triggers are activate (#6437)

* fix: Selenium Grid scaler avoids overlapping when multiple browserVersion triggers are active

Signed-off-by: Viet Nguyen Duc <[email protected]>

* Update CHANGELOG

Signed-off-by: Viet Nguyen Duc <[email protected]>

* Fix e2e template test

Signed-off-by: Viet Nguyen Duc <[email protected]>

* Change imagePullPolicy to Always to take latest change

Signed-off-by: Viet Nguyen Duc <[email protected]>

* Update platformName default value as empty

Signed-off-by: Viet Nguyen Duc <[email protected]>

---------

Signed-off-by: Viet Nguyen Duc <[email protected]>
Signed-off-by: Jorge Turrado <[email protected]>

* add missing change

Signed-off-by: Jorge Turrado <[email protected]>

---------

Signed-off-by: Jorge Turrado <[email protected]>
Signed-off-by: Omer Aplatony <[email protected]>
Signed-off-by: Eng Zer Jun <[email protected]>
Signed-off-by: Jan Wozniak <[email protected]>
Signed-off-by: Mårten Svantesson <[email protected]>
Signed-off-by: Jorge Turrado <[email protected]>
Signed-off-by: Viet Nguyen Duc <[email protected]>
Co-authored-by: Omer Aplatony <[email protected]>
Co-authored-by: smcavallo <[email protected]>
Co-authored-by: Eng Zer Jun <[email protected]>
Co-authored-by: Jan Wozniak <[email protected]>
Co-authored-by: Viet Nguyen Duc <[email protected]>
Co-authored-by: Mårten Svantesson <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automaxprocs library prints log in a different format then the rest of the KEDA operator
5 participants