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

Add history trace command #2904

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

tonistiigi
Copy link
Member

Includes wip trace command on top of #2891

The goal was for this command to show a trace of the build directly, for example, in Jaeger UI, but it looks like there isn't a simple API that would allow uploading a trace to an existing Jaeger image (their upload feature is an ephemeral client-side-only solution).

Options would be to upload the trace spans again via controller APIs or build our own UI-only image that we could pair with a simple server that can return the trace JSON. Separating from #2891 in order to not block that PR.

The Jaeger conversion is mostly reuse of some old code. Looks like there is also a github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger package now that probably has similar functionality.

@tonistiigi
Copy link
Member Author

Added support for viewing traces using Jaeger UI.

// open trace for a ref in UI
docker buildx history trace <ref>

// open trace for last build in UI
docker buildx history trace

// save trace to file (eg. manual upload)
docker buildx history trace > trace.json

// open comparison trace with another build
docker buildx history trace --compare=otherref ref

// compare last build with the one before it
docker buildx history trace --compare '^1'

I think the UX is pretty ok and better than manual uploads and running jaeger-all-in-one. Maintainence-wise, there may be some questions though.

The old otelutil conversion code may need some updates as well. Looks like some info, like process data, could be deduplicated. I quickly looked at github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger but I don't think we have the original format for that converter, so still some work needed to use that.

@tonistiigi tonistiigi marked this pull request as ready for review February 6, 2025 07:17
@tonistiigi tonistiigi force-pushed the history-command-trace branch from d8a5cf8 to 7f84270 Compare February 6, 2025 07:19
@tonistiigi tonistiigi force-pushed the history-command-trace branch from 7f84270 to 3fd4ec0 Compare February 6, 2025 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant