Repository navigation
fix: resolve subscriber trace scope through forwards and same-process units - #15
Merged
Merged
Conversation
… units Starting a profiling trace on a publisher plotted a single line. It was the publish delta -- the two subscriber metrics never arrived at all, because the dashboard asked the processes for a scope that could not match anything. The publisher's own route unit was scoped with `subscriber_topics` set to the publisher's own topic. A subscriber is registered under its own input topic, never under the topic of the publisher feeding it, so that filter disabled every subscriber in the publisher's process. The downstream topics only ever reached other processes' route units, and the publisher's own route unit was explicitly discarded from that fan-out. In a graph whose publisher/subscriber edges are intra-process -- an ordinary single-process pipeline, or any collection whose units share a process -- that left lease time and user span disabled everywhere. The publisher's route unit now carries the same resolved downstream scope the remote ones get. The scope itself only walked one route hop. A publisher nested in collections reaches its subscribers through one forwarding topic per boundary, and only the topic at the end of that chain is one a subscriber holds. One hop finds the first alias and stops, so a publisher two or more boundaries away from its subscriber reported "No subscriber profiling data is available for this topic" and could not be traced at all. Both the service and the panel now walk the forward chain to exhaustion; forwards terminate at subscriber input topics, so the closure stays inside the publisher's downstream, and a visited set keeps a cyclic graph from spinning. The trace-control response now reports the resolved `topic_scope`. Without it an empty `route_units` -- every subscriber lives in the publisher's own process -- is indistinguishable from a scope that resolved to nothing, which is what made the original failure so hard to see from outside. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Starting a profiling trace on a publisher plotted a single line. It was the publish delta — the two subscriber metrics never arrived at all, because the dashboard asked the processes for a scope that could not match anything.
Same-process subscribers were never enabled
The publisher's own route unit was scoped with
subscriber_topicsset to the publisher's own topic. A subscriber is registered under its own input topic, never under the topic of the publisher feeding it, so that filter disabled every subscriber in the publisher's process. The resolved downstream topics only ever reached other processes' route units, and the publisher's own was explicitly discarded from that fan-out (route_units_for_subscribers.discard(route_unit)).In a graph whose publisher/subscriber edges are intra-process — an ordinary single-process pipeline, or any collection whose units share a process — that left
lease_time_nsanduser_span_nsdisabled everywhere. The publisher's route unit now carries the same resolved scope the remote ones get.The scope walked only one hop
A publisher nested in collections reaches its subscribers through one forwarding topic per boundary, and only the topic at the end of that chain is one a subscriber holds:
One hop finds
UCDF/INPUT_SIGNAL— a pure forward with no unit behind it — and stops, soHUB1/SDAreported "No subscriber profiling data is available for this topic" and could not be traced at all._topic_scope_for_seedandtopicScopeForPublishernow walk the chain to exhaustion. Forwards terminate at subscriber input topics, so the closure stays inside the publisher's downstream, and a visited set keeps a cyclic graph from spinning.Diagnosability
The trace-control response now reports the resolved
topic_scope. Without it, an emptyroute_units(every subscriber lives in the publisher's own process) is indistinguishable from a scope that resolved to nothing — which is what made the original failure so hard to see from outside.Verification
Against a live 3-process pipeline with two levels of collection nesting, replaying the exact request the UI sends:
HUB1/UCDF/BUTTER0/OUTPUT_SIGNALlease_time_ns, 1105user_span_nsonLRR/INPUT_SIGNALHUB1/SDA/OUTPUT_SIGNALUCDF/BUTTER0/INPUT_SIGNALezmsg core needed no change — its publisher/subscriber filtering was correct once handed a scope that matches.
Tests
subscriber_topicsvalues and were updated; one new test covers the forward chain together with the in-process case._webbundle refreshed perdocs/development.md.🤖 Generated with Claude Code