feat(query): per-dispatch latency metric tagged by local vs remote - #2273
Open
siri-varma wants to merge 1 commit into
Open
feat(query): per-dispatch latency metric tagged by local vs remote#2273siri-varma wants to merge 1 commit into
siri-varma wants to merge 1 commit into
Conversation
Measure ExecPlan dispatch latency at the PlanDispatcher itself -- the single choke point every dispatch flows through -- rather than wrapping individual call sites, which were inconsistent (some code calls dispatcher.dispatch directly, bypassing QueryPlanner.dispatchExecPlan). - PlanDispatcher.dispatch/dispatchStreaming are now final template methods that time the dispatch and record "query-dispatch-latency", delegating the actual work to doDispatch/doDispatchStreaming. - Tagged "dispatch" (local|remote, derived from isLocalCall) and "dataset"; exported to Prometheus as query_dispatch_latency_seconds. - Implementations (InProcess/Actor/RemoteActor/Grpc/Flight + test dummies) rename dispatch -> doDispatch and dispatchStreaming -> doDispatchStreaming. - RemoteActorPlanDispatcher delegates via the inner doDispatch to avoid double-counting its wrapped dispatch. Co-Authored-By: Claude Opus 4.8 (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.
What
Adds a single dispatch-latency metric measured at the
PlanDispatcheritself, tagged by whether the dispatch is local (in-process) or remote (actor / grpc / flight).Exported to Prometheus as
query_dispatch_latency_seconds{dispatch="local"|"remote", dataset=...}.Why
We wanted to compare query dispatch latency across transport paths. Measuring at
QueryPlanner.dispatchExecPlanis leaky — some code callsexecPlan.dispatcher.dispatch(...)directly (e.g.PromQLGrpcServer.executePlan, the Flight producer, and internal child-plan dispatch), bypassing it. The dispatcher is the single choke point that every dispatch flows through, so the measurement belongs there.How
PlanDispatcher.dispatch/dispatchStreamingare nowfinaltemplate methods that record latency and delegate the actual work to abstractdoDispatch/doDispatchStreaming.PlanDispatcher.isLocalCall(dispatch=local|remote) plusdataset.InProcessPlanDispatcher,ActorPlanDispatcher,RemoteActorPlanDispatcher,GrpcPlanDispatcher,FlightPlanDispatcher— and the test dummy dispatchers implementdoDispatch/doDispatchStreaminginstead ofdispatch/dispatchStreaming.RemoteActorPlanDispatcherdelegates to the inner dispatcher'sdoDispatchto avoid double-counting its wrapped dispatch.Notes
isLocalCall); no field is added toQueryContext/ proto, so there are no cross-node (Kryo/proto) serialization concerns.local/remote.🤖 Generated with Claude Code