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

switch to go-kit logger #1575

Merged
merged 1 commit into from
Dec 31, 2019
Merged

switch to go-kit logger #1575

merged 1 commit into from
Dec 31, 2019

Conversation

yeya24
Copy link
Contributor

@yeya24 yeya24 commented Dec 26, 2019

Signed-off-by: yeya24 yb532204897@gmail.com
Fixes #1495
Seems #1496 is not active, so I open this PR.

@yeya24 yeya24 force-pushed the use-go-kit-logger branch 3 times, most recently from dc8e312 to b330ea4 Compare December 26, 2019 03:44
@SuperQ
Copy link
Member

SuperQ commented Dec 26, 2019

Thanks!

It looks like the buildkite failure is due to a broken build node. I'll see if I can fix it.

Copy link
Member

@SuperQ SuperQ left a comment

Choose a reason for hiding this comment

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

Seems pretty good so far. I'm wondering about the collector level messages. It would be useful to have a collector logging key appended to all the debug messages.

@yeya24
Copy link
Contributor Author

yeya24 commented Dec 26, 2019

Seems pretty good so far. I'm wondering about the collector level messages. It would be useful to have a collector logging key appended to all the debug messages.

@SuperQ Thanks for your review. Do you mean adding sth like level.Debug(logger).Log("collector", collectorName) ?

@SuperQ
Copy link
Member

SuperQ commented Dec 28, 2019

Yes, something like level.Debug(logger).Log("collector", collectorName, ...) is what I'm thinking.

@yeya24
Copy link
Contributor Author

yeya24 commented Dec 29, 2019

@SuperQ Done. PTAL

@brian-brazil
Copy link
Contributor

It's log.With(logger, "collector", collectorName) to get a per-collector logger.

@yeya24
Copy link
Contributor Author

yeya24 commented Dec 29, 2019

@brian-brazil @SuperQ Ready for review.

Copy link
Member

@SuperQ SuperQ left a comment

Choose a reason for hiding this comment

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

This is pretty great. A couple of minor nits.

collector/drbd_linux.go Outdated Show resolved Hide resolved
collector/drbd_linux.go Outdated Show resolved Hide resolved
collector/drbd_linux.go Outdated Show resolved Hide resolved
collector/systemd_linux.go Outdated Show resolved Hide resolved
collector/systemd_linux.go Outdated Show resolved Hide resolved
collector/systemd_linux.go Outdated Show resolved Hide resolved
collector/systemd_linux.go Outdated Show resolved Hide resolved
collector/systemd_linux.go Outdated Show resolved Hide resolved
collector/systemd_linux.go Outdated Show resolved Hide resolved
collector/systemd_linux.go Outdated Show resolved Hide resolved
@yeya24 yeya24 force-pushed the use-go-kit-logger branch 3 times, most recently from 054bcd6 to 0d3c210 Compare December 30, 2019 05:07
Signed-off-by: yeya24 <yb532204897@gmail.com>
@yeya24
Copy link
Contributor Author

yeya24 commented Dec 30, 2019

Thanks for your review. @SuperQ @brian-brazil I have addressed all the comments.

Copy link
Member

@SuperQ SuperQ left a comment

Choose a reason for hiding this comment

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

LGTM!

@SuperQ
Copy link
Member

SuperQ commented Dec 30, 2019

@brian-brazil Any other issues?

@brian-brazil
Copy link
Contributor

Oh no, I just noticed that in passing as I'd written similar code elsewhere recently.

@yeya24
Copy link
Contributor Author

yeya24 commented Dec 31, 2019

@brian-brazil Sorry I didn't get what you mean. Should I make other changes?

@brian-brazil
Copy link
Contributor

I'm not suggesting any other changes.

@SuperQ SuperQ merged commit 2477c5c into prometheus:master Dec 31, 2019
@yeya24 yeya24 deleted the use-go-kit-logger branch December 31, 2019 16:33
oblitorum pushed a commit to shatteredsilicon/node_exporter that referenced this pull request Apr 9, 2024
Signed-off-by: yeya24 <yb532204897@gmail.com>
oblitorum pushed a commit to shatteredsilicon/node_exporter that referenced this pull request Apr 9, 2024
Signed-off-by: yeya24 <yb532204897@gmail.com>
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.

Switch logging to go-kit
3 participants