Skip to content

feat(dashboard): period-aware latency charts, monitor pause/resume, and get_workspace MCP tool - #2980

Merged
mxkaske merged 10 commits into
mainfrom
fix/latency-chart-order-and-downtime-wording
Oct 24, 2026
Merged

mxkaske merged 10 commits into
mainfrom
fix/latency-chart-order-and-downtime-wording

Conversation

@mxkaske

@mxkaske mxkaske commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Summary

Latency charts follow the selected period and resolution

  • Both latency endpoints now trim rows to the selected window. The fixed-window Tinybird pipes read whole materialized views and ignored the dates, so "Last day" showed 14 days on HTTP monitors and 14 days showed 30 on the others. Trimming happens in the tRPC router, no pipe redeploy needed.
  • The resolution dropdown now reaches the non-HTTP latency pipes. The pipes already accepted interval, but neither the client binding nor the router declared it.
  • Resolution is capped per period on client and server. A 1-day window tops out at 4-hour buckets; a too-coarse value in the URL snaps down the way too-fine values already snapped up.
  • Non-HTTP latency series are sorted oldest → newest client-side since most latency pipes return ORDER BY h DESC.
  • The degraded reference line is no longer silently dropped when the threshold sits above the plotted percentile. The y-axis extends to the threshold when it is within 2× of the data max; far-away thresholds (30s default on a 200ms endpoint) stay hidden so charts aren't flattened.
  • The from-date is computed per render, so a tab left open past midnight keeps a sliding window.

Axis labels adapt to the range

  • Last day: time only (2:00 PM), with the short date at a midnight bucket.
  • Multi-day with sub-daily buckets: Oct 18, 6 AM.
  • Daily buckets: Oct 18.
  • Tooltips keep the full October 22 at 2:00 PM label. Mapped chart data now carries raw timestamps instead of preformatted strings.

Free plan window

  • Free workspaces are limited to 7 days. 14, 30 and 90 days are locked in the period dropdown behind the upgrade dialog and rejected server-side. Paid periods in the URL snap back to 7 days with a toast.
  • The lock icon in the period dropdown sits in the indicator column and yields to the check mark on the selected value.

Pause and resume from the quick actions menu

  • The monitor header, sidebar list and table row menus gain a Pause or Resume item, whichever applies. A paused monitor can be restarted without opening settings.
  • The paused Uptime chart slot shows only the pause icon and title; the 130px box could not hold the previous action buttons.

MCP: get_workspace

  • New read-only tool across MCP, dashboard chat and the Slack agent. Returns workspace id, slug, name, plan, trial end and usage counts (monitors, status pages, components, notification channels, status reports).
  • Plan limits and billing identifiers are not exposed, matching the public whoami endpoint.
  • Listed in the MCP docs reference and the dashboard MCP page; the Slack agent routes plan/usage questions to it; the tool-selection eval offers it.

Wording

  • Deleting, acknowledging or resolving a monitor downtime says "downtime" instead of "incident".
  • The status-page floating configuration panel uses the dashboard wording: "Status source" (Monitor checks / Reports only) and "Card shows" (Time per status / Number of checks). A stored absolute source with a manual value keeps a readable disabled label.

Notes

  • The free plan config still advertises "14 days" of data retention, which feeds the pricing page and upgrade dialog. Left unchanged; retention and viewing window are separate claims, but worth aligning.
  • scripts/screenshot.mjs waits for document load and fonts only, so chart screenshots can capture before Tinybird answers.
  • The docs screenshot status-page-floating.png in the configure-status-page guide still shows the old labels and needs a retake.

- sort non-http latency series oldest to newest; most tinybird latency
  pipes return rows newest first so the chart read right to left
- extend the latency y-axis to the degraded threshold when it is within
  2x of the data max so the reference line is no longer silently dropped
- downtime delete/acknowledge/resolve dialogs say "downtime", not "incident"
- status-page floating config panel uses the dashboard wording
  (Status source / Card shows) instead of Bar Type / Card Type
@vercel

vercel Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
openstatus-dashboard Ready Ready Preview Oct 23, 2026 8:05pm UTC
2 Skipped Deployments
Project Deployment Actions Updated
openstatus-status-page Skipped Skipped Oct 23, 2026 8:05pm UTC
openstatus-web Skipped Skipped Oct 23, 2026 8:05pm UTC

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 6 files

Reply with feedback, questions, or to request a fix.

View guided diff | Re-trigger cubic

…lan window

- latency endpoints trim rows to the selected period; the fixed-window
  pipes ignored the dates so 1d/14d showed 14 or 30 days
- resolution now reaches the non-http latency pipes and is capped per
  period on client and server (1d tops out at 4h)
- x-axis ticks adapt to the range (time only on 1d, short date + hour on
  multi-day, date only on daily buckets); tooltips keep the full date
- free workspaces are limited to 7 days; 14d+ locked in the dropdown and
  rejected server-side
- lock icon in the period dropdown sits in the indicator column
@mxkaske mxkaske changed the title fix(dashboard): latency chart order, degraded line, and downtime wording feat(dashboard): period-aware latency charts, axis labels, and free-plan window Oct 23, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 12 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/dashboard/src/app/(dashboard)/monitors/[id]/overview/client.tsx">

<violation number="1" location="apps/dashboard/src/app/(dashboard)/monitors/[id]/overview/client.tsx:311">
P3: `interval` is clamped against the blocked URL period, not the `effectivePeriod` the chart actually queries. A free workspace that snaps from 30d/90d to 7d keeps the coarse resolution (daily buckets on 7d) as its URL value. Clamp against `effectivePeriod`, or have `DropdownInterval` read the effective period.</violation>
</file>

<file name="packages/tinybird/src/client.ts">

<violation number="1" location="packages/tinybird/src/client.ts:1784">
P2: The new `fromDate`/`toDate` params on most of these latency getters do nothing. The matching `.pipe` files never reference them, so Tinybird ignores them and the rows are not trimmed to the selected period. Either add the date filters to those pipes or drop this from the PR claim.</violation>
</file>

Reply with feedback, questions, or to request a fix.

View guided diff | Re-trigger cubic

parameters: z.object({
monitorId: z.string(),
regions: z.array(z.enum(monitorRegions).or(z.string())).optional(),
interval: z.int().optional(),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The new fromDate/toDate params on most of these latency getters do nothing. The matching .pipe files never reference them, so Tinybird ignores them and the rows are not trimmed to the selected period. Either add the date filters to those pipes or drop this from the PR claim.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At packages/tinybird/src/client.ts, line 1784:

<comment>The new `fromDate`/`toDate` params on most of these latency getters do nothing. The matching `.pipe` files never reference them, so Tinybird ignores them and the rows are not trimmed to the selected period. Either add the date filters to those pipes or drop this from the PR claim.</comment>

<file context>
@@ -1781,6 +1781,7 @@ export class OSTinybird {
       parameters: z.object({
         monitorId: z.string(),
         regions: z.array(z.enum(monitorRegions).or(z.string())).optional(),
+        interval: z.int().optional(),
         fromDate: z.string().optional(),
         toDate: z.string().optional(),
</file context>

degradedAfter={monitor.degradedAfter}
type={monitor.jobType as "http" | "tcp" | "dns" | "icmp" | "grpc"}
period={effectivePeriod}
interval={interval}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: interval is clamped against the blocked URL period, not the effectivePeriod the chart actually queries. A free workspace that snaps from 30d/90d to 7d keeps the coarse resolution (daily buckets on 7d) as its URL value. Clamp against effectivePeriod, or have DropdownInterval read the effective period.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At apps/dashboard/src/app/(dashboard)/monitors/[id]/overview/client.tsx, line 311:

<comment>`interval` is clamped against the blocked URL period, not the `effectivePeriod` the chart actually queries. A free workspace that snaps from 30d/90d to 7d keeps the coarse resolution (daily buckets on 7d) as its URL value. Clamp against `effectivePeriod`, or have `DropdownInterval` read the effective period.</comment>

<file context>
@@ -309,6 +308,7 @@ export function Client() {
             degradedAfter={monitor.degradedAfter}
             type={monitor.jobType as "http" | "tcp" | "dns" | "icmp" | "grpc"}
             period={effectivePeriod}
+            interval={interval}
             regions={selectedRegions}
           />
</file context>

Comment thread apps/dashboard/src/lib/formatter.ts Resolved
@mxkaske

mxkaske commented Oct 23, 2026

Copy link
Copy Markdown
Member Author

@claude review

@claude

claude Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Claude finished @mxkaske's task in 38s —— View job


Review of #2980

The approach is sound. Trimming in the router avoids a pipe redeploy. The period and interval clamps are mirrored on the client and server. Switching the mapped chart data to raw timestamps is the right call. I read the diff but did not run tests or the app. Findings, most important first:

1. Cubic's P2 on client.ts is not a bug. The .pipe files ignoring fromDate/toDate is the reason trimToWindow exists. The comment at packages/api/src/router/tinybird/index.ts:59 already says so. I'd resolve that thread with that explanation. One caveat: the interval param only has an effect on pipes that declare it. The PR description says all non-HTTP latency pipes accept it, but I didn't check each .pipe file.

2. Interval is clamped against the URL period, not the effective period (monitors/[id]/overview/client.tsx, around line 311). I agree with Cubic. A free user landing on ?period=30d&interval=1440 is snapped to 7d. DropdownInterval reads the URL period, so it leaves 1440 in place. The chart then shows daily buckets over 7 days. The server clamp is per period, so it won't catch this. Either pass effectivePeriod into the dropdown or clamp interval against effectivePeriod before using it.

3. Unparseable dates silently produce empty charts (packages/api/src/router/tinybird/index.ts, trimToWindow). new Date("garbage").getTime() is NaN, every comparison is false, and every row is filtered out. Validate fromDate and toDate as ISO datetimes in the zod schema (e.g. z.iso.datetime()). If other callers send a different format, add an isNaN guard instead.

4. periodToFromDate is computed once at module load (apps/dashboard/src/data/metrics.client.ts:349). This already existed in chart-area-latency.tsx, and the PR now repeats it in the timing-phases chart. With the new server-side trim it matters more, because a tab left open past midnight keeps an old window and an unchanged query key. Computing startOfDay(subDays(new Date(), n)) at render time fixes that.

5. Lock and selected-check icons can overlap (dropdown-period.tsx:88). Both use the right-2 slot. This happens during the brief window when a free user's URL still holds a paid period. Cubic's suggestion of locked && period !== value is reasonable.

6. No tests for formatAxisTick. It has four branches: 1d at midnight, 1d intraday, multi-day hourly, and daily buckets. These depend on local time, so tests should pin the timezone or build dates with new Date(y, m, d, h). The existing isPaidPeriod test was updated, which is good.

Smaller notes

  • dropdown-interval.tsx: the comment "or 1d carried into 1d" looks like a typo. Probably "1440 carried into 1d".
  • chart-area-latency.tsx and chart-area-timing-phases.tsx: the y-axis max uses degradedAfter <= dataMax * 2. The 2× heuristic is fine. With a dataMin lower bound, a degraded line at, say, 1.9× max compresses the series to about half height. That is the intended tradeoff, but a one-line note in the PR would help.
  • Free-plan 14d now returns FORBIDDEN on four endpoints that call assertPaidPeriod (lines 472, 513, 620, 671). The get endpoint is hardcoded to "14d" and isn't gated, which looks intentional. I found no other "14d" callers in the dashboard or API code that a free workspace would hit.
  • The "14 days" retention claim on the free plan config is still left unaligned, as you noted.

Nothing here looks blocking. I'd fix 2 and 3 before merging. 4 to 6 can be follow-ups.

…ge cases

- derive the from-date at query time so long-lived tabs do not pin stale windows
- drop rows with invalid timestamps before trimming to the selected window
- stop the lock icon overlapping the check mark on the selected period
- add axis tick formatting tests
Exposes workspace id, slug, name, plan, trial end and usage counts
(monitors, status pages, components, channels, reports) across MCP,
dashboard chat and the Slack agent. Plan limits and billing ids stay
private, matching the public whoami endpoint.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 20 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Re-trigger cubic

- offer the tool in the tool-selection eval so the new case can pass
- assert exact usage counts, including that soft-deleted monitors are excluded
- update the docs tool counts
@vercel
vercel Bot temporarily deployed to Preview – openstatus-status-page October 23, 2026 18:59 Inactive
@vercel
vercel Bot temporarily deployed to Preview – openstatus-dashboard October 23, 2026 18:59 Inactive
The 130px slot only fits icon and title; resume/edit stay in the page header.
@vercel
vercel Bot temporarily deployed to Preview – openstatus-web October 23, 2026 19:09 Inactive

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 1 file (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Re-trigger cubic

Header, sidebar and table row menus show the one that applies, so a paused
monitor can be restarted without opening settings.
@vercel
vercel Bot temporarily deployed to Preview – openstatus-web October 23, 2026 19:29 Inactive
@vercel
vercel Bot temporarily deployed to Preview – openstatus-status-page October 23, 2026 19:29 Inactive
@mxkaske mxkaske changed the title feat(dashboard): period-aware latency charts, axis labels, and free-plan window feat(dashboard): period-aware latency charts, monitor pause/resume, and get_workspace MCP tool Oct 23, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 4 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/dashboard/src/components/nav/nav-monitors.tsx">

<violation number="1" location="apps/dashboard/src/components/nav/nav-monitors.tsx:146">
P2: This pause/resume logic is now copy-pasted into three components (this file, `monitors/[id]/nav-actions.tsx`, and `data-table/monitors/data-table-row-actions.tsx`). Extract it into one hook, such as `useSetMonitorActive(id)`, that owns the mutation, invalidation, and toast handling. The copies already diverge: this file invalidates `trpc.monitor.pathKey()`, while the row-actions copy invalidates `trpc.monitor.list.queryOptions()`.</violation>
</file>

<file name="apps/dashboard/src/components/data-table/monitors/data-table-row-actions.tsx">

<violation number="1" location="apps/dashboard/src/components/data-table/monitors/data-table-row-actions.tsx:36">
P2: This mutation invalidates only `monitor.list`, but the sibling pause/resume handlers invalidate `trpc.monitor.pathKey()`. Cached `monitor.get` data keeps the old `active` value, so the detail header can show the wrong Pause/Resume action. Invalidate the whole monitor path instead.</violation>
</file>

Reply with feedback, questions, or to request a fix.

View guided diff | Re-trigger cubic

// curl only speaks HTTP — the action is hidden for tcp/dns monitors
const isHttp = item.jobType === "http";
const hiddenAction = item.active ? "resume" : "pause";
const setActive = (active: boolean) => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: This pause/resume logic is now copy-pasted into three components (this file, monitors/[id]/nav-actions.tsx, and data-table/monitors/data-table-row-actions.tsx). Extract it into one hook, such as useSetMonitorActive(id), that owns the mutation, invalidation, and toast handling. The copies already diverge: this file invalidates trpc.monitor.pathKey(), while the row-actions copy invalidates trpc.monitor.list.queryOptions().

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At apps/dashboard/src/components/nav/nav-monitors.tsx, line 146:

<comment>This pause/resume logic is now copy-pasted into three components (this file, `monitors/[id]/nav-actions.tsx`, and `data-table/monitors/data-table-row-actions.tsx`). Extract it into one hook, such as `useSetMonitorActive(id)`, that owns the mutation, invalidation, and toast handling. The copies already diverge: this file invalidates `trpc.monitor.pathKey()`, while the row-actions copy invalidates `trpc.monitor.list.queryOptions()`.</comment>

<file context>
@@ -135,8 +142,29 @@ export function NavMonitors() {
             // curl only speaks HTTP — the action is hidden for tcp/dns monitors
             const isHttp = item.jobType === "http";
+            const hiddenAction = item.active ? "resume" : "pause";
+            const setActive = (active: boolean) => {
+              const promise = updateMonitorsMutation.mutateAsync({
+                ids: [item.id],
</file context>

const updateMonitorsMutation = useMutation(
trpc.monitor.updateMonitors.mutationOptions({
onSuccess: () => {
queryClient.invalidateQueries(trpc.monitor.list.queryOptions());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: This mutation invalidates only monitor.list, but the sibling pause/resume handlers invalidate trpc.monitor.pathKey(). Cached monitor.get data keeps the old active value, so the detail header can show the wrong Pause/Resume action. Invalidate the whole monitor path instead.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At apps/dashboard/src/components/data-table/monitors/data-table-row-actions.tsx, line 36:

<comment>This mutation invalidates only `monitor.list`, but the sibling pause/resume handlers invalidate `trpc.monitor.pathKey()`. Cached `monitor.get` data keeps the old `active` value, so the detail header can show the wrong Pause/Resume action. Invalidate the whole monitor path instead.</comment>

<file context>
@@ -29,11 +30,38 @@ export function DataTableRowActions({ row }: DataTableRowActionsProps) {
+  const updateMonitorsMutation = useMutation(
+    trpc.monitor.updateMonitors.mutationOptions({
+      onSuccess: () => {
+        queryClient.invalidateQueries(trpc.monitor.list.queryOptions());
+      },
+    }),
</file context>
Suggested change
queryClient.invalidateQueries(trpc.monitor.list.queryOptions());
queryClient.invalidateQueries({ queryKey: trpc.monitor.pathKey() });

Matches the managed incidents table: linked titles, severity and status
badges instead of raw enum text.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 2 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Re-trigger cubic

@vercel
vercel Bot temporarily deployed to Preview – openstatus-status-page October 23, 2026 20:04 Inactive
@vercel
vercel Bot temporarily deployed to Preview – openstatus-web October 23, 2026 20:04 Inactive
@mxkaske
mxkaske merged commit 6dd5c05 into main Oct 24, 2026
20 checks passed
@mxkaske
mxkaske deleted the fix/latency-chart-order-and-downtime-wording branch October 24, 2026 09:49

This branch was successfully deployed

1 active and 2 inactive deployments
Preview – openstatus-dashboard — 8be3e7c8 Deployed Oct 23, 2026 by vercel[bot]
Preview – openstatus-web — 8be3e7c8 Deployed Oct 23, 2026 by vercel[bot]
Preview – openstatus-status-page — 8be3e7c8 Deployed Oct 23, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant