feat: unified trace waterfall with GraphQL field tracing and a request lifecycle band - #220
Open
fpasquet wants to merge 3 commits into
Open
feat: unified trace waterfall with GraphQL field tracing and a request lifecycle band#220fpasquet wants to merge 3 commits into
fpasquet wants to merge 3 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
fpasquet
force-pushed
the
feat/unified-trace-waterfall
branch
from
July 18, 2026 13:14
313c764 to
f523877
Compare
fpasquet
marked this pull request as ready for review
July 18, 2026 13:14
fpasquet
force-pushed
the
feat/unified-trace-waterfall
branch
from
July 19, 2026 05:40
f523877 to
6a5d2a1
Compare
… with a lifecycle band - assemble a causal TraceSpan tree (buildTrace) merging phases, HTTP, DB and GraphQL-field spans - nest spans under a reported parentId, else the tightest enclosing container by time, else the root - only containers (entrypoint, phase, GraphQL field, opt-in `container: true`) adopt children by time, so calls fired concurrently stay siblings instead of chaining into a fictitious ancestry - widen a parent onto its children when it stopped being timed before the work it triggered resolved - time every measured surface with a sub-millisecond clock (utils/clock) instead of Date.now(), whose rounding collapsed a whole unit of work onto one instant - render durations in the unit that fits them (ns, µs, ms, s, m, h) so nothing measured reads as 0ms - wrap each SQL `BEGIN … COMMIT/ROLLBACK` run in a synthetic transaction span covering the unit of work - trace each GraphQL resolveField and stamp its span on the DB/HTTP calls it issues - surface performance tags and self-time on spans; deep-link DB/HTTP spans to their panel row - compute self-time against the union of the children's intervals, not the sum of their durations - add a flat request-lifecycle band (guards, controller, validation) above the waterfall (HTTP-only) - give the badge column a fixed width so a tagged row keeps the same time axis as its neighbours - always emit the entrypoint root so every HTTP request, command and message gets a Timeline
…g and a DataLoader flag - wire the GraphQL field middleware into the catalog schema so resolveField spans are traced - add a FEATURE_DATALOADER flag batching Product.reviews to compare N+1 vs one query in the trace
…ecycle band - rewrite the Timeline section as the unified nested trace waterfall (self-time, tags, deep-links) - explain containers versus leaves, and why the `% of total` column does not sum to 100% - document the sub-millisecond clock and the unit-following duration format - refresh the Timeline screenshot as a GraphQL N+1 waterfall + a DataLoader-batched counterpart - teach the screenshots script to shoot both traces (N+1 and DataLoader-batched) - describe the flat Request Lifecycle band and the lifecycleSpans option - add createProfilerFieldMiddleware + FieldTracingOptions to the GraphQL guide and API reference - note the field middleware must be registered conditionally for zero cost when the profiler is off - update the setup/harden/collector skills for GraphQL field tracing and the lifecycleSpans option - add TraceSpan and LifecyclePhase to the core API reference
fpasquet
force-pushed
the
feat/unified-trace-waterfall
branch
from
July 22, 2026 19:07
6a5d2a1 to
2adf310
Compare
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.
Summary
Turns the Timeline panel into a unified, causally-nested trace waterfall. A new
buildTracestep assembles aTraceSpantree (Profile.trace) that merges every timed operation of a request on one time axis — lifecycle phases (startSpan), outgoing HTTP calls, database queries and each GraphQLresolveField— nested by causality (an explicit parent, else time containment). Spans carry their performance tags (slow, N+1) and self-time, are collapsible, and deep-link to their source panel row.createProfilerFieldMiddleware(code-first) times eachresolveFieldand opens a nested CLS scope so the DB/HTTP calls it issues are stamped as its children; an N+1 reads as one field with its repeated child queries.traceFields/minFieldMstune what is traced.guards,controller,validation) above the waterfall for HTTP requests, controlled by the newlifecycleSpansoption. Zero-duration phases are dropped; GraphQL/commands/messages keep their own breakdown.examples/api, and aFEATURE_DATALOADERflag batchesProduct.reviewsto compare the N+1 shape (4 queries) with the batched shape (1 query) in the trace.Non-breaking:
Profile.spans/startSpanstill work, and all new fields, options and exports are additive.Related issue
None.
Checklist
majorchangeset with aBREAKING:noteBreaking changes