feat(dispatch): wire traces through embed via EmbedConsumers (PIPE-1024)#235
Merged
Merged
Conversation
Contributor
Author
This was referenced Jun 2, 2026
eKuG
approved these changes
Jun 3, 2026
73fa41c to
f3df873
Compare
94618e6 to
2249d11
Compare
f3df873 to
45aabb7
Compare
2249d11 to
3982356
Compare
45aabb7 to
c130826
Compare
3982356 to
436369c
Compare
436369c to
5f02622
Compare
Merge activity
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Proposed Change
Refactor
dispatch.ForEmbedto take anEmbedConsumersstruct (withLogConsumer,MetricConsumer, andTraceConsumerfields) instead of a singleembed.LogConsumer. Each per-signal nil check is hoisted into arequireLog/requireMetric/requireTracehelper method onEmbedConsumers.New
GeneratorTypeTracescase constructstraces.New(...)withconsumers.TraceConsumer, returning the helper's typed error if it's nil.config.EmbedOptsgrows aTraceConsumer embed.TraceConsumerfield;config.LoadModulespasses all three consumers through todispatch.ForEmbed. The old "EmbedOpts.LogConsumer is required" early check goes away — the error now surfaces fromForEmbedper-generator-type.cmd/blitz/main.gono longer hand-constructs traces: it delegates todispatch.ForEmbedafter asserting the configured output implementsoutput.TraceWriterand wrapping it viaoutput.WriterAsTraceConsumer. Kills the per-generator-type duplication between cmd/blitz and dispatch.New
yamlSeedDefaulthelper translates YAML zero-valueSeedinto-1(randomize per worker) for traces. Programmatic Go callers bypass the translation. See PIPE-1036 for the follow-up that routes identity-level determinism throughenvironment.seed_config.Conflict-point note: this PR shares
internal/dispatch/embed.goandconfig/loader.gowith #231. Conflicts:EmbedConsumersstruct (each PR adds its consumer field),EmbedOptsstruct, onecaseper generator type, and theyamlSeedDefaulthelper (both PRs define it identically). Whichever lands second rebases mechanically.Tests
Existing
TestForEmbed*updated to useEmbedConsumers{LogConsumer: ...}; newTestForEmbedTracesReturnsProducerModule,TestForEmbedTracesRejectsMissingTraceConsumer,TestForEmbedRejectsMissingLogConsumerForLogType.TestLoadModules_NilConsumerupdated to feed a valid config.Part of PIPE-1024. Stacked on #234.