console: maintained objects freshness diagnosis#36413
Open
leedqin wants to merge 15 commits into
Open
Conversation
- Sql queries and tests. Leveraging allObjects subscribe query in the console and only added a query for showing pMax values and hydration statuses. Joining this data client side to be rendered in a table
- Added a filter on Universal Table column header - Added a Maintained Objects route behind a Launch Darkly flag - Added filter chips to show filters selected - Added the filter components fror the different filter columns: freshness, multi select and search for cluster, object types, hydration status - Maintained Objects List with cells defined for each column, columns using Tanstack sorting / filtering, universal tanstack table components with Url params and pagination - Maintained Objects List react table with happy path of listing objects and listing objects with filters
- Changed the filter chips to show all the filters seelected i.e "Type: source x", "Type: index x" "Cluter: quickstart" etc - ujpdated the margins to match the Tag component margins - Moved search to the left
- Added a sql test to validate lookback minutes behavior for freshness - Collapsed cluster and lag objects - MaintainedObjectLIst is now a map keyed by the object id rather than a structured list
- Added pMAX ≥ 5s and ≥ 10s filter options to match the column's warning/outdated color thresholds (was previously starting at 1 minute) - Switched the freshness filter radios to the form variant so they pick up the brand purple instead of Chakra's default blue - Removed the duplicate "X of Y objects" footer that overlapped with the TablePagination summary when more than one page was visible
4445fe8 to
b5f955e
Compare
- Made the freshness filter a draft-then-apply flow matching query-history's FilterMenu, so typing a number or switching units no longer fires the filter through intermediate values - Added an Apply / Clear footer with a top divider; Enter in the number field also commits
- Adding object drawer with routes, clickable row, tabs to show metadata - added Object details card with cluster details / object metadata
- SQL definition using ShowCreateBlock component - Object columns using ObjectColumns components in Object Explorer. Moved Object Columns to TanStack table and reused it in Object Details drawer - Source Diagnostics card showing hydration status, messages receieves and messages recieved. This uses sourceStatistics query - Freshness tab placeholder
- Stop click propagation so the row's onRowClick (object drawer navigation) doesn't fire when the user clicks a cluster name. - Open the cluster details page in a new tab so the table view stays intact.
- Freshness graph modified to let the user select a point in time on the graph. This is useful for looking at critical path and upstream dependencies for the object in that point in time. - Utils for letting the user click on the graph and get the timestamp - Modified components to render Freshness graph and charts
- Added a WMR query (criticalPath.ts) that walks predecessors and marks the slowest input at each level with isBottleneck=true, while still emitting off-path siblings so the UI can splice them in on demand - Two perObjectLag CTE builders feed the recursion: pMAX over the lookback window for live mode, and the most recent observation in the bucket containing a chosen timestamp for locked mode - Added a SQL test with ASCII graph diagrams covering linear chain walk, tied bottlenecks, and off-path siblings; seed + data combined into a single testdrive call so the database isn't reset between them - Added a useCriticalPath hook (queries.ts) wrapping the query in React Query with staleTime/refetchInterval; CriticalPathData exposes both the full row set and a directInputs slice for downstream consumers
- Added a critical path DAG (CriticalPathGraph + CriticalPathGraphNode) with healthy/primary/upstream/offPath node coloring and dagre layout - Depth gating renders the chain up to visibleDepth; hiddenChainCount drives the "Show N more upstream" CTA, and Collapse returns to the default depth of 2 - Clicking the off-path chip on a chain node splices that node's non-bottleneck siblings in as dashed-edge dependencies; clicking the node body lifts it for full-name reading - Pulled the graph shape logic into a pure criticalPathRenderable module — buildGraphView takes WMR rows plus depth/expansion state and returns render-ready nodes/edges, with no React or DOM dependencies - buildChainMaps preprocesses rows once into three Maps: nodeById (metadata), chainParentsByChild (chain-only adjacency), and depthById (BFS hops from the queried object) - findPrimaryBottleneck picks the chain node with the largest self-delay (own lag − max parent lag) for the red highlight; classifyNode applies the 2s healthy threshold first so acceptable-lag nodes never render red - Added unit tests covering linear chain walk, depth gating, primary marker, healthy probe, no-chain probe, off-path counts, and expansion - Mounted the DAG below the freshness chart in ObjectFreshness, hiding it for sources (no Materialize-internal upstream chain)
- Added a freshness breakdown chip (FreshnessBreakdownStrip + computeFreshnessBreakdown) splitting output lag into max-upstream + self-delay, with a noise floor to suppress trivial breakdowns; unit tested - Mounted the chip in ObjectFreshness above the critical path DAG to label the dominant upstream contribution and the queried object's own self-delay
- Added an UpstreamDependenciesTable showing the queried object's direct upstream inputs (name, type, cluster, lag) via UniversalTable + TanStack - Sourced from the same useCriticalPath query as the DAG through the CriticalPathData.directInputs slice — one round-trip serves both views - Object cells render the database/schema namespace plus a router link to the parent's Object detail page (or its parentSourceId for subsources), with a tooltip exposing the fully-qualified name - Lag column sorts by milliseconds and shows a tooltip on null lag explaining the object may not yet be hydrated - Mounted the table below the freshness card on the Object detail page, hidden for sources (no Materialize-internal upstream chain)
- Fixed a bug where only a node would be marked as a bottleneck if it is in the visible chain so fixed it so that check is done on the whole chain. - Fixed a bug for the nodes being saturated in dark mode
728c26d to
8f35911
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.
Motivation
Freshness graphs for maintained objects that show the critical path of lag from upstream dependencies on that object. Critical path is shown as a DAG. Fixes CNS-52
Description
A user can pick the a point in time in Freshness graph to see the critical path of objects and their respective lag and a table of immediate upstream dependencies. The lookback window on table corresponds to the lookback window in the freshness graph as well to let the user look at freshness few hours back or few minutes back. In that window, they can look at the critical path at a point in time on freshness graph. Design for the DAG: https://dependency-timeline-mz.lovable.app/
I didn't follow this pixel perfect but used the color schemes for the nodes. Since it's really hard to pinpoint to one particular object that it is causing the delay.
Different UI scenarios
object_freshness_2sec.mov
source_delay_4s.mov
Tips For Reviewer
Freshness Chartcommit. I have broken down most changes by commit so they can be reviewed on their own.The most review intensive commits are:
CriticalPathQuery:This is a recursive sql query to trace the chain for the object's backward to determine "what makes the object slow", returning every edge along the chain plus the immediate off-path siblings of each chain node so the UI can show both the spine and what else feeds into it.
Critical path DAG:This commit deals with transforming the results from the query into a renderable DAG. I would review the files in this order:
criticalPathRenderable.tshas a helper functionbuildGraphView(at the bottom of the file, would recommend reading from here) that takes all the other helpers to return the nodes and edges needed for the graph. Here is the flow how buildGraphView worksFreshness breakdown chip: If there is a self lag of an object then it highlights that on the graph