Repository navigation
feat(dashboard): period-aware latency charts, monitor pause/resume, and get_workspace MCP tool - #2980
Conversation
- 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
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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(), |
There was a problem hiding this comment.
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} |
There was a problem hiding this comment.
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>
|
@claude review |
|
Claude finished @mxkaske's task in 38s —— View job Review of #2980The 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 2. Interval is clamped against the URL period, not the effective period ( 3. Unparseable dates silently produce empty charts ( 4. 5. Lock and selected-check icons can overlap ( 6. No tests for Smaller notes
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.
There was a problem hiding this comment.
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
The 130px slot only fits icon and title; resume/edit stay in the page header.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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) => { |
There was a problem hiding this comment.
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()); |
There was a problem hiding this comment.
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>
| 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.
There was a problem hiding this comment.
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
Summary
Latency charts follow the selected period and resolution
interval, but neither the client binding nor the router declared it.ORDER BY h DESC.Axis labels adapt to the range
2:00 PM), with the short date at a midnight bucket.Oct 18, 6 AM.Oct 18.October 22 at 2:00 PMlabel. Mapped chart data now carries raw timestamps instead of preformatted strings.Free plan window
Pause and resume from the quick actions menu
MCP:
get_workspacewhoamiendpoint.Wording
Notes
scripts/screenshot.mjswaits for document load and fonts only, so chart screenshots can capture before Tinybird answers.status-page-floating.pngin the configure-status-page guide still shows the old labels and needs a retake.