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

bklog: only log tracing ids when span exporter not nil #2351

Merged
merged 1 commit into from
Sep 9, 2021

Conversation

morlay
Copy link
Contributor

@morlay morlay commented Sep 8, 2021

enhance #2235

util/bklog/log.go Outdated Show resolved Hide resolved
@morlay morlay force-pushed the log-fix branch 2 times, most recently from d990079 to feb9d38 Compare September 8, 2021 07:14
@morlay
Copy link
Contributor Author

morlay commented Sep 8, 2021

@tonistiigi. we have to added a toggle to enable log with tracing ids.

TracingProvider is a side process, we couldn't know is it ready from ctx.

util/bklog/log.go Outdated Show resolved Hide resolved
@@ -82,6 +83,10 @@ func detect() error {
if exp == nil {
return nil
}

// enable log with traceID when valid exporter
bklog.EnableLogWithTraceID()
Copy link
Member

Choose a reason for hiding this comment

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

Little bit weird still that this isn't called in main. But I guess it is ok as detect itself should only be called in main.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

in main, we still couldn't know the Exporter is ready or not.

so i have to enable log with trace id when setup exporter.

Signed-off-by: Morlay <morlay.null@gmail.com>
@tonistiigi tonistiigi merged commit e07f388 into moby:master Sep 9, 2021
@crazy-max crazy-max added this to the v0.10.0 milestone Feb 4, 2022
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.

3 participants