-
Notifications
You must be signed in to change notification settings - Fork 557
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
feat: added support for streaming stdout when --progress=plain #7069
Conversation
7d86438
to
2db590e
Compare
return nil | ||
} | ||
|
||
func (t *streamingExporter) getSpanName(spanID trace.SpanID) string { |
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.
the span name is not always get cause otel emit the spans until span.End() called.
may consider set span name in log attrs too.
b8b2b38
to
74f8714
Compare
I think this makes sense 🎉 I'm really not familiar with how To me, it feels confusing that the logic for adding new views/etc is really complex - ideally, we'd have an |
There were still some color issues (particularly in the summary that's still printed at the end), so pushed a fix for that (the extra |
I'd like to do some further refactoring of this later, but for now, this fixes the issue, and it would be awesome to include this in v0.11.1, so going to approve now, and I'll happily iterate on this after the release. |
fix dagger#7057 Signed-off-by: Morlay <morlay.null@gmail.com>
Signed-off-by: Justin Chadwell <me@jedevc.com>
Signed-off-by: Justin Chadwell <me@jedevc.com>
1c0aae3
to
3c375eb
Compare
func (w *batchPrinter) render(out *termenv.Output, final bool) { | ||
w.mu.Lock() | ||
defer w.mu.Unlock() | ||
|
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.
it could ignore logs without spanName for now.
spanName := w.getSpanName(w.spanID)
if spanName == "" {
return
}
@jedevc spanName may empty. it could safe fixed by https://github.com/dagger/dagger/pull/7069/files#r1559461303 |
This is needed for printing out the final data! Signed-off-by: Justin Chadwell <me@jedevc.com>
@morlay can you share an example of where span is empty? |
this first It logs before trace span emitted. |
Right, yeah, I meant, do you have a publicly-available example I can run to get this? I'm trying to understand why this can happen. |
Signed-off-by: Justin Chadwell <me@jedevc.com>
Signed-off-by: Justin Chadwell <me@jedevc.com>
It from github actions logs of my tool. It base dagger for container. To make logs in same view, I reuse idtui when dagger v0.11.0 released. So in local host execution, it will be fast. All tasks defined by cue lang. It could be run To see the issue should delete this condition |
https://github.com/dagger/dagger/blob/main/dagql/idtui/types.go#L133 Btw, in my case. It will make my final report hide some spans. 😂 Could we make it configable? |
This view is fundamentally different so it makes sense to me. Normally we're rendering into a viewport and dynamically redrawing parts of the screen, TUI style. This one just needs to print output directly without any funny business and let it go into the scrollback infinitely, skipping past all those moving parts and disregarding screen size and all that. In the end they're both implementing an interface, just perhaps a lower level one than you might have expected (OpenTelemetry span/log exporter). |
Already is - if you pass |
but with it, the final reporter is too noisy. 😂 |
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.
This is a great start, but I noticed it seems impossible to interrupt it at the moment with Ctrl+C. But, I think that was already broken in plain mode, so approving anyway; this is still a net positive. I think we can merge this as-is and I can try to fix that + maybe do some refactoring after. Thanks a bunch!
I'd prefer to avoid a bunch of flags, but feel free to make it a param or var instead of a const, if you're using this code directly. |
…r#7069) * feat: added support for streaming stdout when --progress=plain fix dagger#7057 Signed-off-by: Morlay <morlay.null@gmail.com> * chore: fix some linting issues Signed-off-by: Justin Chadwell <me@jedevc.com> * fix: ensure we set tty everywhere Signed-off-by: Justin Chadwell <me@jedevc.com> * streaming output should still collect db This is needed for printing out the final data! Signed-off-by: Justin Chadwell <me@jedevc.com> * apply suggested fix for empty span name Signed-off-by: Justin Chadwell <me@jedevc.com> * import newoutput from progrock Signed-off-by: Justin Chadwell <me@jedevc.com> --------- Signed-off-by: Morlay <morlay.null@gmail.com> Signed-off-by: Justin Chadwell <me@jedevc.com> Co-authored-by: Justin Chadwell <me@jedevc.com>
fix #7057