Skip to content

fix(go): continue the engine's trace in the dispatcher - #75

Merged
eunomie merged 2 commits into
dagger:mainfrom
eunomie:fix-dispatcher-telemetry
Oct 17, 2026
Merged

eunomie merged 2 commits into
dagger:mainfrom
eunomie:fix-dispatcher-telemetry

Conversation

@eunomie

@eunomie eunomie commented Oct 16, 2026

Copy link
Copy Markdown
Member

What

With a Dang entrypoint, the dispatcher called module functions with
context.Background() and never set up telemetry. In author code the
trace ID was all zeros, and spans from Tracer() were never exported.

The dispatcher now calls telemetry.InitEmbedded like the Go runtime's
main, so it reads the engine's TRACEPARENT and OTEL_*. It closes
telemetry before exit, on errors too. Generation pins otel-go again before
the final tidy, so the dispatcher's import does not resolve at latest.

How verified

  • On v1.0.0-beta.18: before, the ctx trace ID was zero and the author's span
    was missing. Now the ctx carries the engine's trace and the span parents
    the function's calls, as on the Go runtime.
  • Unit test: with TRACEPARENT set, the dispatched ctx has its trace ID.

Not covered

Generated modules require otel-go again, as Go-runtime modules do; go.mod
and the dispatcher build grow accordingly.

Land together with or after #74 (it seeds the genproto requirements this change makes every module need).

Walkthrough: https://gistpreview.github.io/?a7487916f6cd169a072034196d0db7ae

The dispatcher called module functions with an empty context, so their
trace ID was zero and the spans they started were never exported. It now
initializes telemetry from the engine's TRACEPARENT and OTEL_* variables,
as the Go runtime does.

Signed-off-by: Yves Brissaud <[email protected]>
@eunomie
eunomie force-pushed the fix-dispatcher-telemetry branch from 9b626e5 to ada037f Compare October 16, 2026 20:02
The collection build loads package main with the dispatcher, which
imports otel-go, before the final tidy restored that requirement. With
unified bindings, which do not import otel-go, the load failed for a
+collection module.

Signed-off-by: Yves Brissaud <[email protected]>
@eunomie
eunomie merged commit 6db69a1 into dagger:main Oct 17, 2026
8 of 9 checks passed
@eunomie
eunomie deleted the fix-dispatcher-telemetry branch October 17, 2026 17:47
eunomie added a commit to eunomie/dagger that referenced this pull request Oct 18, 2026
dagger/go-sdk#75 continues the engine's trace in the dispatcher. Git
workspaces resolve go-sdk main live instead of the lock pin, so Cloud
already generates with it.

Signed-off-by: Yves Brissaud <[email protected]>
eunomie added a commit to eunomie/dagger that referenced this pull request Oct 20, 2026
dagger/go-sdk#75 continues the engine's trace in the dispatcher. Git
workspaces resolve go-sdk main live instead of the lock pin, so Cloud
already generates with it.

Signed-off-by: Yves Brissaud <[email protected]>
eunomie added a commit to eunomie/dagger that referenced this pull request Oct 21, 2026
dagger/go-sdk#75 continues the engine's trace in the dispatcher. Git
workspaces resolve go-sdk main live instead of the lock pin, so Cloud
already generates with it.

Signed-off-by: Yves Brissaud <[email protected]>
eunomie added a commit to eunomie/dagger that referenced this pull request Oct 22, 2026
dagger/go-sdk#75 continues the engine's trace in the dispatcher. Git
workspaces resolve go-sdk main live instead of the lock pin, so Cloud
already generates with it.

Signed-off-by: Yves Brissaud <[email protected]>
eunomie added a commit to eunomie/dagger that referenced this pull request Oct 22, 2026
dagger/go-sdk#75 continues the engine's trace in the dispatcher. Git
workspaces resolve go-sdk main live instead of the lock pin, so Cloud
already generates with it.

Signed-off-by: Yves Brissaud <[email protected]>
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.

1 participant