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

Merged
MX
1mo ago
+675-116

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.