-
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
log should with traceID and spanID #2235
Conversation
But this will always logs the same ID that called edit: or am I wrong? Noticed this is actually containerd logs, not used by buildkit code itself |
Different traceID for different job. each log with traceID, |
Signed-off-by: Morlay <[email protected]>
I'm not know well about full process, from job start to ends, I found some logs without traceID, but i think it should related to some job. like:
|
Your screenshot looks cool but you are missing the traces from the client. Tracing should be cross-process.
Generally ok, but I don't want packages that currently depend only on Also, the trace starts from the client side that sends a parent span with the grpc requests. For logs in code that is outside gprc handlers there is no trace context in buildkitd. |
Yes, buildx still use the old version. so haven't collect that part.
We could do this in future. maybe we could use some simplier interface instead of
It doesn't matter. When trace context not exists, we can ignore it. |
) | ||
|
||
func init() { | ||
log.G = GetLogger |
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.
for a simple change to support buildkit's logs move this line out of util to cmd/buildkitd
and then you can replace the logrus calls with util/log.GetLogger()
without containerd/log dependency.
Can do this in separate PR as well.
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.
And when you do that, don't use log
package name as it collides with stdlib in imports. bklog
or logger.Get()
or smth else that doesn't collide is better.
@morlay It seems these show up even if no tracing is enabled. We should find a way to avoid that. PTAL |
Yeah it also seems custom fields are removed. Here v0.8.3
v0.9.0
|
sorry. i missed this msg. |
@crazy-max could you location where to define custom fields? i haven't find the configration fields |
Set
log.G
with aGetLogger
with FieldstraceID
andspanID
when tracing exists.example image
docker.io/morlay/buildkit:log-with-tracing
logs in buidlkit will be