-
Notifications
You must be signed in to change notification settings - Fork 39
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
Can we replace github.com/prometheus/common/log
with log/slog
?
#121
Conversation
Static analysis† of current
Can we continue the topic of replacing the logger with a lighter and simpler one? † I used vim and grep for analysis. |
Complete replacement of `github.com/go-kit/log` and its derivative `github.com/prometheus/common/promlog` with `log/slog`.
I have prepared a complete transition to Unfortunately, I have no way to try it at home. I will try the “production” operation of my full proposal in the first week of January 2024.
|
Thanks for your contribution. Sounds good to me. I will give this a try as well and we will sort it out soon. We can just go with the complete transition to log/slog and we'll do our testing with that |
I moved the |
Plus alignment of previously assigned names to the newly adopted convention.
Test run results.24 hours with logging level set to ‘debug’We have set the ‘debug’ logging level and ‘json’ logging format. The program behaved stably. Also when it comes to CPU and memory usage. In our environment it produced 300MB of logs per hour. At 3 a.m. service processes in the artifactory caused the program to produce over 7GB of logs and the orchestrator stopped the program. 24 hours with logging level set to ‘info’We have set the ‘info’ logging level and ‘json’ logging format. The program was as stable as before. In our environment, it produced less than eight log entries per day. |
Thanks for this change and all the testing. Looks good to me. You need to update golang version in here as well and we should be good to go. |
As suggested by Peiman in his comment to PR.
Quality Gate passedKudos, no new issues were introduced! 0 New issues |
Thank you for suggestion! I wasn't inquisitive enough to find it. I do hope that next commit meets the need. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Logger
github.com/prometheus/common/log
is already marked as obsolete in version v0.26.0.The
log/slog
component is new to the go standard library. It feels light and fast.Hopefully we could then use it to choke out the
github.com/go-kit/log
library.