Add 14d time window to surface full free plan data - #25
Merged
maquchizi merged 9 commits intoJul 27, 2026
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Member
|
@claude review |
Member
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a94503473c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-authored-by: Clemence Kyara <kilemensi@users.noreply.github.com>
maquchizi
force-pushed
the
add-14d-time-window-to-surface-full-free-plan-data
branch
from
July 27, 2026 12:11
1301d52 to
ac7a971
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.
What & why
On the free Grafana Cloud plan (
METRICS_RETENTION_DAYS=14), the largest window with an honest summary figure was7d—30d/1ycorrectly render—. That left the retained 8–14 day slice with no headline figure anywhere, even though the per-site charts already plot it.This PR adds a
14dwindow so the full free-plan retention gets a properly-labeled summary, and makes both the overview and detail pages open on the largest window retention actually covers (14d on the free plan, 30d when retention is unlimited). Along the way it centralizes the window definitions and hardens the detail-route window parsing.Builds on the
METRICS_RETENTION_DAYSwork (#13) — the clamping that makes14dshow real data already existed infetchSiteHistory.Closes #18
Key changes:
14dwindow ({ key: "14d", label: "14 days", seconds: 1_209_600 }, 84 × 4h buckets) added to the singleWINDOWSsource. Everything window-generic (query fan-out, coverage clamp, mock data) flows through it with no special-casing. Per-site uptime grid widened tosm:grid-cols-5.defaultWindow(retentionDays)inlib/types.ts, reused by bothOverviewand the detail page so the two stay in step (no more hardcoded"7d").WINDOWSnow carriesbarCount(removing the parallelBAR_COUNTmap inlib/buckets.ts),WindowKeyis derived from it, and newisWindowKey/windowFromParamhelpers own URL?window=resolution.generateMetadataand the page now resolve the window once via the shared helper (so metadata fetches the correct window instead of always7d), handle repeated?window=params safely, and setaria-current="page"on the active tab.<title>(mixed text + expression children compiled to a 4-element array) into a single template string, clearing a React runtime warning.docs/configuration.mdandREADME.mddescribe14dalongside the retention section.Type of change
Checklist
[AGENTS.md](https://claude.ai/AGENTS.md)and[CONTRIBUTING.md](https://claude.ai/CONTRIBUTING.md)pnpm checkpassespnpm testpassespnpm test:typespassespnpm buildsucceedsdocs/) if behaviour or configuration changedNEXT_PUBLIC_prefixNotes for reviewers
coveredWindows(),windowWithinRetention(), the query fan-out, and mock data all iterateWINDOWS, so14dneeded no branching. Worth confirming that assumption still holds.defaultWindowreturns30dwhen covered, else the largest covered window — so the overview default under unlimited retention is unchanged; only capped-retention plans shift to14d.METRICS_RETENTION_DAYS=14: overview and detail both open on14d, the uptime grid shows14 days = 100%with30d/1yas—, and the detail chart plots the full ~14-day span. Grid lays out cleanly at 5 columns (desktop) and wraps 2+2+1 on mobile.