Skip to content

tui: reduce error verbosity, support go-to-error - #10512

Merged
vito merged 15 commits into
dagger:mainfrom
vito:error-origins
Jun 9, 2025
Merged

vito merged 15 commits into
dagger:mainfrom
vito:error-origins

Conversation

@vito

@vito vito commented May 30, 2025 •

Copy link
Copy Markdown
Contributor

Context: #10461

  • When returning errors, capture the current trace context and store it in error attributes
  • Preserve error origin data in all propagation paths
  • Spans now link to their error origin (OTel links + an attribute to distinguish from 'causal' links)
  • TUI dedupes errors and only shows them at their origin, with a hotkey r to jump to it

asciicast

@vito
vito requested a review from a team as a code owner May 30, 2025 21:32
@vito
vito force-pushed the error-origins branch 4 times, most recently from cca996a to b3233bc Compare June 4, 2025 16:09
@vito
vito force-pushed the error-origins branch 2 times, most recently from d0b01c8 to 85d8f41 Compare June 5, 2025 16:29
@vito
vito requested review from crjm, jedevc and sipsma June 6, 2025 15:11
vito added 14 commits June 9, 2025 11:31
* errors now store their originating trace context as extended fields
  * this happens automatically for errors returned by modules and for
    core API code paths
* when ending a span with an error, the trace context is extracted from
  the error and attached to the span as a span link
* error links use a new 'link purpose' attribute to distinguish from the
  typical usage of span links (continuation)

the end result is that we can now identify where exactly the root cause
of an error is, instead of repeating it as every place where it bubbles
up

Signed-off-by: Alex Suraci <[email protected]>
* look for ExtendedError everywhere, so internal core calls and client
  usage set up links properly
* preserve ExtendedError compliance in Dagger client so that module
  functions that return errors preserve their origins (even from
  ExecError)

on paper this looks like SDK specific work, but really it's because we
use the Go SDK telemetry code in the engine. modules errors are handled
generically in the engine, so other SDKs shouldn't need to implement
this - they should only need to preserve GraphQL error extensions, which
we already wanted prior to this change.

Signed-off-by: Alex Suraci <[email protected]>
* add ERROR suffix, like CACHED
* only put ! at first line of wrapped error text, so it's clearly a
  single error instead of multiple

Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
otherwise these just look like strings and are hard to see

not sure why I originally went with yellow - maybe because it was softer
when they spammed the screen? now that that's fixed, red seems obvious

Signed-off-by: Alex Suraci <[email protected]>
* press "r" on a span to jump to its e(r)rror
* shows in keymap if focused span has an error origin
* highlight on press, or generally when focusing the origin span, so you
  can see where the span's error bubbled up

Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
@vito
vito force-pushed the error-origins branch from 85d8f41 to 067c67e Compare June 9, 2025 15:32
* remove TrackOriginError and AroundFunc error returning which was from
  an earlier iteration
* add comments in a few key spots for clarification

Signed-off-by: Alex Suraci <[email protected]>
@vito
vito force-pushed the error-origins branch from 067c67e to 9e7e1db Compare June 9, 2025 15:47
● viztest: Viztest! X.Xs
▼ .failEffect: Container! X.Xs
▼ .failEffect: Container! X.Xs ERROR
! process "sh -c echo this is a failing effect; exit 1" did not complete successfully: exit code: 1

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ideally this would be deduped too, but it's pretty tricky. Going to leave it for another iteration.

The trickiness is in the fact that the "error" status here is actually coming from an effect. The failEffect function actually returns successfully, but the TUI bubbles up an error in its returned effects to any call sites that returned the failed effect. (s/effect/LLB vertex/ for those deep in Buildkit)

The hard part is deduping this without also deduping it from the Container.withExec call where we want to see the error, since that works via the same logic.

@vito vito added this to the v0.18.10 milestone Jun 9, 2025

@sipsma sipsma left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👨‍🎨

@vito
vito merged commit ba2452d into dagger:main Jun 9, 2025
@vito
vito deleted the error-origins branch June 9, 2025 18:12
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.

2 participants