-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add structured logging support to promhttp #1601
Conversation
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.
\o/
e42eb81
to
ce14c97
Compare
We might want to split out the Go version change into a separate PR. |
ce14c97
to
201b770
Compare
Ok, yaks shaven, this is ready to go. |
Seems like dagger is a bit of technical debt for keeping Go versions up to date as well. |
dc79689
to
51c188e
Compare
In order to better support the standard library `log/slog` add a new interface to the `promhttp` `HandlerOpts`. Signed-off-by: SuperQ <superq@gmail.com>
3d57041
to
c652332
Compare
Hmmm, feels strange that we have 2 loggers in the struct now. I'm assuming this is needed somewhere in a different package/repository, could you clarify how you're planning to use this? |
@SuperQ we're only ever logging at // make logger with promslog like normal
slogger := promslog.New(&promslog.Config{})
// make stdlog adapter from slogger
logger := slog.NewLogLogger(slogger.Handler(), slog.LevelError) Bonus points -- log output is still structured |
Yea, I suppose using a stdlib adapter would be fine. |
In order to better support the standard library
log/slog
add a new interface to thepromhttp
HandlerOpts
.