Skip to content

feat(dispatch): wire traces through embed via EmbedConsumers (PIPE-1024)#235

Merged
Dylan-M merged 1 commit into
mainfrom
dylanmyers/pipe-1024-dispatch-runtime-wiring
Jun 3, 2026
Merged

feat(dispatch): wire traces through embed via EmbedConsumers (PIPE-1024)#235
Dylan-M merged 1 commit into
mainfrom
dylanmyers/pipe-1024-dispatch-runtime-wiring

Conversation

@Dylan-M
Copy link
Copy Markdown
Contributor

@Dylan-M Dylan-M commented Jun 2, 2026

Proposed Change

Refactor dispatch.ForEmbed to take an EmbedConsumers struct (with LogConsumer, MetricConsumer, and TraceConsumer fields) instead of a single embed.LogConsumer. Each per-signal nil check is hoisted into a requireLog/requireMetric/requireTrace helper method on EmbedConsumers.

New GeneratorTypeTraces case constructs traces.New(...) with consumers.TraceConsumer, returning the helper's typed error if it's nil.

config.EmbedOpts grows a TraceConsumer embed.TraceConsumer field; config.LoadModules passes all three consumers through to dispatch.ForEmbed. The old "EmbedOpts.LogConsumer is required" early check goes away — the error now surfaces from ForEmbed per-generator-type.

cmd/blitz/main.go no longer hand-constructs traces: it delegates to dispatch.ForEmbed after asserting the configured output implements output.TraceWriter and wrapping it via output.WriterAsTraceConsumer. Kills the per-generator-type duplication between cmd/blitz and dispatch.

New yamlSeedDefault helper translates YAML zero-value Seed into -1 (randomize per worker) for traces. Programmatic Go callers bypass the translation. See PIPE-1036 for the follow-up that routes identity-level determinism through environment.seed_config.

Conflict-point note: this PR shares internal/dispatch/embed.go and config/loader.go with #231. Conflicts: EmbedConsumers struct (each PR adds its consumer field), EmbedOpts struct, one case per generator type, and the yamlSeedDefault helper (both PRs define it identically). Whichever lands second rebases mechanically.

Tests

Existing TestForEmbed* updated to use EmbedConsumers{LogConsumer: ...}; new TestForEmbedTracesReturnsProducerModule, TestForEmbedTracesRejectsMissingTraceConsumer, TestForEmbedRejectsMissingLogConsumerForLogType. TestLoadModules_NilConsumer updated to feed a valid config.

Part of PIPE-1024. Stacked on #234.

@Dylan-M Dylan-M requested review from a team as code owners June 2, 2026 15:46
@Dylan-M Dylan-M force-pushed the dylanmyers/pipe-1024-traces-migration branch from 73fa41c to f3df873 Compare June 3, 2026 12:29
@Dylan-M Dylan-M force-pushed the dylanmyers/pipe-1024-dispatch-runtime-wiring branch from 94618e6 to 2249d11 Compare June 3, 2026 12:29
@Dylan-M Dylan-M force-pushed the dylanmyers/pipe-1024-traces-migration branch from f3df873 to 45aabb7 Compare June 3, 2026 13:42
@Dylan-M Dylan-M force-pushed the dylanmyers/pipe-1024-dispatch-runtime-wiring branch from 2249d11 to 3982356 Compare June 3, 2026 13:42
@Dylan-M Dylan-M force-pushed the dylanmyers/pipe-1024-traces-migration branch from 45aabb7 to c130826 Compare June 3, 2026 14:01
@Dylan-M Dylan-M force-pushed the dylanmyers/pipe-1024-dispatch-runtime-wiring branch from 3982356 to 436369c Compare June 3, 2026 14:01
Base automatically changed from dylanmyers/pipe-1024-traces-migration to main June 3, 2026 14:23
@Dylan-M Dylan-M force-pushed the dylanmyers/pipe-1024-dispatch-runtime-wiring branch from 436369c to 5f02622 Compare June 3, 2026 14:24
@graphite-app
Copy link
Copy Markdown

graphite-app Bot commented Jun 3, 2026

Merge activity

  • Jun 3, 2:24 PM UTC: Graphite rebased this pull request, because this pull request is set to merge when ready.

@Dylan-M Dylan-M added this pull request to the merge queue Jun 3, 2026
Merged via the queue into main with commit 301f284 Jun 3, 2026
19 checks passed
@Dylan-M Dylan-M deleted the dylanmyers/pipe-1024-dispatch-runtime-wiring branch June 3, 2026 14:30
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