Skip to content

warn on rollup/base query coverage mismatch#9729

Open
pjain1 wants to merge 1 commit into
mainfrom
parag/rollup-serving-table-metadata
Open

warn on rollup/base query coverage mismatch#9729
pjain1 wants to merge 1 commit into
mainfrom
parag/rollup-serving-table-metadata

Conversation

@pjain1

@pjain1 pjain1 commented Jul 22, 2026

Copy link
Copy Markdown
Member

This is to solve cases when dimensions are served from different tables example one from a rollup another from base because may be that dimension was not present in the rollup or some other criteria. So add a warning in such cases, we return the serving table along with response, UI already know the rollup and base coverage so it can do mismatch check with time coverage of serving table.

Backend changes

Expose which physical table served a metrics query, plus per-rollup time coverage, so the frontend can detect when widgets on one dashboard are served from tables with different retention:

  • serving_table added to MetricsViewAggregationResponse, MetricsViewTimeSeriesResponse, and MetricsViewComparisonResponse: the rollup table the query was routed to, empty when served from the base table.
  • rollup_time_ranges (map<table, TimeRangeSummary>) added to MetricsViewTimeRange and MetricsViewTimeRanges responses.
  • Keys are physical table names throughout matching rollup.Table and ts.Rollups

Frontend warning logic

Each dashboard gets a RollupCoverageStore (on StateManagers) holding per-table time coverage from MetricsViewTimeRange (timeRangeSummary + new rollupTimeRanges) and a registry of which table served each mounted widget (from the new servingTable field on query responses; leaderboards, big numbers, charts, and the dimension table register).

A widget shows the warning if its serving table's coverage starts later than both the requested range start (primary or comparison, whichever is earlier) and the widest coverage among all tables currently in use on the dashboard:

served.min > max(requestedStart, widestInUse.min) + oneGrainBucket(widestTable)

The grain-bucket tolerance suppresses false positives from rollup min timestamps being truncated to bucket starts. Consequences: only widgets actually missing requested data warn; if all widgets route to the same table (e.g. a filter forces everything to base), the dashboard is internally consistent and nothing warns; ranges fully covered by the serving table never warn regardless of table mismatch.

Screenshot 2026-07-22 at 9 53 29 PM

Checklist:

  • Covered by tests
  • Ran it and it works as intended
  • Reviewed the diff before requesting a review
  • Checked for unhandled edge cases
  • Linked the issues it closes
  • Checked if the docs need to be updated. If so, create a separate Linear DOCS issue
  • Intend to cherry-pick into the release branch
  • I'm proud of this work!

@pjain1
pjain1 marked this pull request as draft July 22, 2026 16:24
@nishantmonu51 nishantmonu51 added Type:Feature New feature request Area:Dashboard Size:XL Very large change: 2,000+ lines labels Jul 23, 2026
@pjain1
pjain1 marked this pull request as ready for review July 24, 2026 05:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area:Dashboard Size:XL Very large change: 2,000+ lines Type:Feature New feature request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants