Skip to content

Open-source status page, incident response and uptime monitoring

chore: mcp monitor tools extended (#2154)

Maximilian Kaske6033cd878973
diff --git a/apps/dashboard/src/components/chat/chat-suggestions.tsx b/apps/dashboard/src/components/chat/chat-suggestions.tsx
index 2cb8382b9..55b62adc2 100644
--- a/apps/dashboard/src/components/chat/chat-suggestions.tsx
+++ b/apps/dashboard/src/components/chat/chat-suggestions.tsx
@@ -9,8 +9,8 @@ import {
import { Badge } from "@openstatus/ui/components/ui/badge";
const SUGGESTIONS = [
- "Show me my status pages",
- "What status reports are open?",
+ "List all my monitors",
+ "Are any status reports unresolved?",
"Draft a status report",
"Schedule a maintenance window",
];
@@ -25,10 +25,10 @@ export function ChatSuggestions({ onSelect }: Props) {
<SectionHeader className="max-w-2xl text-center">
<SectionTitle>openstatus assistant</SectionTitle>
<SectionDescription>
- Ask about your workspace, draft status reports, or schedule
- maintenance windows.{" "}
+ Ask about your workspace, draft status reports, or debug your failing
+ monitors.{" "}
<span className="text-muted-foreground/80">
- Status pages only - more tools soon.
+ Test it out and share your feedback.
</span>{" "}
<Badge variant="secondary" className="bg-info/10 text-info">
BETA
diff --git a/apps/dashboard/src/components/chat/chat-tool-part.tsx b/apps/dashboard/src/components/chat/chat-tool-part.tsx
index 8455efebf..caa18c914 100644
--- a/apps/dashboard/src/components/chat/chat-tool-part.tsx
+++ b/apps/dashboard/src/components/chat/chat-tool-part.tsx
@@ -167,46 +167,64 @@ function ToolDisclosure({
onOpenChange={setOpen}
className="not-prose group w-full rounded-xl border"
>
- <div className="flex items-center gap-2 p-3 text-sm">
- <CollapsibleTrigger className="flex flex-1 items-center gap-2 rounded text-left">
+ <CollapsibleTrigger asChild>
+ <div
+ role="button"
+ tabIndex={0}
+ onKeyDown={(e) => {
+ if (e.target !== e.currentTarget) return;
+ if (e.key === "Enter" || e.key === " ") {
+ e.preventDefault();
+ setOpen((o) => !o);
+ }
+ }}
+ className="flex w-full cursor-pointer items-center gap-2 rounded-xl p-3 text-left text-sm"
+ >
<ToolStateDot state={state} />
<span className="font-commit-mono font-medium">{toolName}</span>
- {summary ? (
- <span className="text-muted-foreground">· {summary}</span>
- ) : null}
- </CollapsibleTrigger>
- {open && rich !== undefined ? (
- <Tabs
- value={view}
- onValueChange={(v) => setView(v as "rich" | "raw")}
- >
- <TabsList className="h-6 p-[2px]">
- <TabsTrigger
- value="rich"
- aria-label="Rich view"
- className="h-[18px] px-1 [&_svg:not([class*='size-'])]:size-3"
- >
- <TableIcon />
- </TabsTrigger>
- <TabsTrigger
- value="raw"
- aria-label="Raw view"
- className="h-[18px] px-1 [&_svg:not([class*='size-'])]:size-3"
+ <span className="flex-1 truncate text-muted-foreground">
+ {summary ? `· ${summary}` : null}
+ </span>
+ {rich !== undefined ? (
+ <div
+ onClick={(e) => e.stopPropagation()}
+ onKeyDown={(e) => e.stopPropagation()}
+ className={cn(!open && "invisible")}
+ aria-hidden={!open}
+ >
+ <Tabs
+ value={view}
+ onValueChange={(v) => setView(v as "rich" | "raw")}
>
- <BracesIcon />
- </TabsTrigger>
- </TabsList>
- </Tabs>
- ) : null}
- <CollapsibleTrigger
- aria-label={open ? "Collapse" : "Expand"}
- className="inline-flex size-6 items-center justify-center rounded text-muted-foreground hover:text-foreground"
- >
+ <TabsList className="h-6 p-[2px]">
+ <TabsTrigger
+ value="rich"
+ aria-label="Rich view"
+ tabIndex={open ? 0 : -1}
+ className="h-[18px] px-1 [&_svg:not([class*='size-'])]:size-3"
+ >
+ <TableIcon />
+ </TabsTrigger>
+ <TabsTrigger
+ value="raw"
+ aria-label="Raw view"
+ tabIndex={open ? 0 : -1}
+ className="h-[18px] px-1 [&_svg:not([class*='size-'])]:size-3"
+ >
+ <BracesIcon />
+ </TabsTrigger>
+ </TabsList>
+ </Tabs>
+ </div>
+ ) : null}
<ChevronDownIcon
- className={cn("size-4 transition-transform", open && "rotate-180")}
+ className={cn(
+ "size-4 shrink-0 text-muted-foreground transition-transform",
+ open && "rotate-180",
+ )}
/>
- </CollapsibleTrigger>
- </div>
+ </div>
+ </CollapsibleTrigger>
<CollapsibleContent
data-animate={mounted}
className={cn(
diff --git a/apps/dashboard/src/components/chat/tool-renderers/details-table.tsx b/apps/dashboard/src/components/chat/tool-renderers/details-table.tsx
new file mode 100644
index 000000000..354d6192d
--- /dev/null
+++ b/apps/dashboard/src/components/chat/tool-renderers/details-table.tsx
@@ -0,0 +1,64 @@
+import {
+ Table,
+ TableBody,
+ TableCell,
+ TableHead,
+ TableRow,
+} from "@openstatus/ui/components/ui/table";
+import { Fragment, type ReactNode } from "react";
+
+export type DetailsRow = {
+ label: string;
+ value: ReactNode;
+};
+
+export type DetailsSection = {
+ title?: string;
+ rows: DetailsRow[];
+};
+
+export type DetailsTableData = {
+ sections: DetailsSection[];
+ empty?: string;
+};
+
+export function DetailsTable({ sections, empty }: DetailsTableData) {
+ const total = sections.reduce((acc, s) => acc + s.rows.length, 0);
+ if (total === 0) {
+ return (
+ <div className="rounded-md border bg-background p-3 text-muted-foreground text-sm">
+ {empty ?? "No details to show."}
+ </div>
+ );
+ }
+ return (
+ <div className="overflow-hidden rounded-md border bg-background">
+ <Table>
+ <TableBody>
+ {sections.map((section, sIdx) => (
+ <Fragment key={section.title ?? sIdx}>
+ {section.title ? (
+ <TableRow className="hover:bg-transparent">
+ <TableHead colSpan={2}>{section.title}</TableHead>
+ </TableRow>
+ ) : null}
+ {section.rows.map((row) => (
+ <TableRow
+ key={`${sIdx}-${row.label}`}
+ className="hover:bg-transparent"
+ >
+ <TableHead className="w-1/3 border-r bg-muted/40 font-mono text-muted-foreground">
+ {row.label}
+ </TableHead>
+ <TableCell className="whitespace-normal break-words font-mono">
+ {row.value}
+ </TableCell>
+ </TableRow>
+ ))}
+ </Fragment>
+ ))}
+ </TableBody>
+ </Table>
+ </div>
+ );
+}
diff --git a/apps/dashboard/src/components/chat/tool-renderers/get-monitor-status.tsx b/apps/dashboard/src/components/chat/tool-renderers/get-monitor-status.tsx
new file mode 100644
index 000000000..5328f87e5
--- /dev/null
+++ b/apps/dashboard/src/components/chat/tool-renderers/get-monitor-status.tsx
@@ -0,0 +1,37 @@
+import type { AgentToolOutput } from "@openstatus/services/agent-tools";
+import { cn } from "@openstatus/ui/lib/utils";
+
+import { TableCellRegion } from "@/components/data-table/table-cell-region";
+
+import type { ResultTableData } from "./result-table";
+
+type Output = AgentToolOutput<"get_monitor_status">;
+
+const statusColor: Record<Output["regions"][number]["status"], string> = {
+ active: "text-success",
+ degraded: "text-warning",
+ error: "text-destructive",
+};
+
+export function getMonitorStatusTable(
+ output: Output,
+): ResultTableData<"region" | "status"> {
+ return {
+ empty: "No regions reporting yet.",
+ columns: [
+ { key: "region", header: "Region" },
+ { key: "status", header: "Status" },
+ ],
+ rows: output.regions.map((r) => ({
+ id: r.region,
+ cells: {
+ region: <TableCellRegion value={r.region} className="font-mono" />,
+ status: (
+ <div className={cn("font-mono", statusColor[r.status])}>
+ {r.status}
+ </div>
+ ),
+ },
+ })),
+ };
+}
diff --git a/apps/dashboard/src/components/chat/tool-renderers/get-monitor-summary.tsx b/apps/dashboard/src/components/chat/tool-renderers/get-monitor-summary.tsx
new file mode 100644
index 000000000..597bbe6c2
--- /dev/null
+++ b/apps/dashboard/src/components/chat/tool-renderers/get-monitor-summary.tsx
@@ -0,0 +1,95 @@
+import type {
+ AgentToolInput,
+ AgentToolOutput,
+} from "@openstatus/services/agent-tools";
+
+import { TableCellDate } from "@/components/data-table/table-cell-date";
+import { TableCellNumber } from "@/components/data-table/table-cell-number";
+import { TableCellText } from "@/components/data-table/table-cell-text";
+
+import type { DetailsTableData } from "./details-table";
+
+type Input = AgentToolInput<"get_monitor_summary">;
+type Output = AgentToolOutput<"get_monitor_summary">;
+
+export function getMonitorSummaryDetails(
+ input: Input,
+ output: Output,
+): DetailsTableData {
+ const lastPingDate = output.lastPingAt ? new Date(output.lastPingAt) : null;
+ return {
+ sections: [
+ {
+ title: "Monitor",
+ rows: [
+ {
+ label: "ID",
+ value: <TableCellNumber value={output.monitorId} />,
+ },
+ { label: "Window", value: <TableCellText value={input.timeRange} /> },
+ {
+ label: "Last check",
+ value: <TableCellDate value={lastPingDate} />,
+ },
+ ],
+ },
+ {
+ title: "Checks",
+ rows: [
+ {
+ label: "Successful",
+ value: (
+ <TableCellNumber
+ value={output.totalSuccessful}
+ className="text-success"
+ />
+ ),
+ },
+ {
+ label: "Degraded",
+ value: (
+ <TableCellNumber
+ value={output.totalDegraded}
+ className="text-warning"
+ />
+ ),
+ },
+ {
+ label: "Failed",
+ value: (
+ <TableCellNumber
+ value={output.totalFailed}
+ className="text-destructive"
+ />
+ ),
+ },
+ ],
+ },
+ {
+ title: "Latency",
+ rows: [
+ {
+ label: "p50",
+ value: <TableCellNumber value={output.p50} unit="ms" />,
+ },
+ {
+ label: "p75",
+ value: <TableCellNumber value={output.p75} unit="ms" />,
+ },
+ {
+ label: "p90",
+ value: <TableCellNumber value={output.p90} unit="ms" />,
+ },
+ {
+ label: "p95",
+ value: <TableCellNumber value={output.p95} unit="ms" />,
+ },
+ {
+ label: "p99",
+ value: <TableCellNumber value={output.p99} unit="ms" />,
+ },
+ ],
+ },
+ ],
+ };
+}
diff --git a/apps/dashboard/src/components/chat/tool-renderers/get-monitor.tsx b/apps/dashboard/src/components/chat/tool-renderers/get-monitor.tsx
new file mode 100644
index 000000000..4e5846154
--- /dev/null
+++ b/apps/dashboard/src/components/chat/tool-renderers/get-monitor.tsx
@@ -0,0 +1,108 @@
+import type {
+ AgentToolInput,
+ AgentToolOutput,
+} from "@openstatus/services/agent-tools";
+
+import { TableCellBoolean } from "@/components/data-table/table-cell-boolean";
+import { TableCellNumber } from "@/components/data-table/table-cell-number";
+import { TableCellText } from "@/components/data-table/table-cell-text";
+
+import type {
+ DetailsRow,
+ DetailsSection,
+ DetailsTableData,
+} from "./details-table";
+
+type Input = AgentToolInput<"get_monitor">;
+type Output = AgentToolOutput<"get_monitor">;
+
+export function getMonitorDetails(
+ _input: Input,
+ output: Output,
+): DetailsTableData {
+ const identity: DetailsRow[] = [
+ { label: "ID", value: <TableCellNumber value={output.id} /> },
+ { label: "Name", value: <TableCellText value={output.name} /> },
+ { label: "URL", value: <TableCellText value={output.url} /> },
+ {
+ label: "Type",
+ value: <TableCellText value={output.jobType.toUpperCase()} />,
+ },
+ ];
+ if (output.method) {
+ identity.push({
+ label: "Method",
+ value: <TableCellText value={output.method} />,
+ });
+ }
+ identity.push({
+ label: "Active",
+ value: <TableCellBoolean value={output.active} />,
+ });
+
+ const behavior: DetailsRow[] = [
+ {
+ label: "Periodicity",
+ value: <TableCellText value={output.periodicity} />,
+ },
+ {
+ label: "Regions",
+ value: <TableCellText value={output.regions.join(", ")} />,
+ },
+ {
+ label: "Timeout",
+ value: <TableCellNumber value={output.timeout} unit="ms" />,
+ },
+ ];
+ if (output.degradedAfter !== null) {
+ behavior.push({
+ label: "Degraded after",
+ value: <TableCellNumber value={output.degradedAfter} unit="ms" />,
+ });
+ }
+ behavior.push(
+ { label: "Retry", value: <TableCellNumber value={output.retry} /> },
+ {
+ label: "Follow redirects",
+ value: <TableCellBoolean value={output.followRedirects} />,
+ },
+ );
+
+ const visibility: DetailsRow[] = [
+ { label: "Public", value: <TableCellBoolean value={output.public} /> },
+ {
+ label: "Tags",
+ value: (
+ <TableCellText value={output.tags.map((t) => t.name).join(", ")} />
+ ),
+ },
+ {
+ label: "Notifications",
+ value: (
+ <TableCellText
+ value={output.notifications
+ .map((n) => `${n.name} (${n.provider})`)
+ .join(", ")}
+ />
+ ),
+ },
+ ];
+
+ const sections: DetailsSection[] = [
+ { title: "Monitor", rows: identity },
+ { title: "Behavior", rows: behavior },
+ { title: "Visibility", rows: visibility },
+ ];
+ if (output.privateLocationIds.length > 0) {
+ sections.push({
+ title: "Private locations",
+ rows: [
+ {
+ label: "IDs",
+ value: <TableCellText value={output.privateLocationIds.join(", ")} />,
+ },
+ ],
+ });
+ }
+ return { sections };
+}
diff --git a/apps/dashboard/src/components/chat/tool-renderers/get-response-log.tsx b/apps/dashboard/src/components/chat/tool-renderers/get-response-log.tsx
new file mode 100644
index 000000000..68ad5a15a
--- /dev/null
+++ b/apps/dashboard/src/components/chat/tool-renderers/get-response-log.tsx
@@ -0,0 +1,121 @@
+import type {
+ AgentToolInput,
+ AgentToolOutput,
+} from "@openstatus/services/agent-tools";
+
+import { TableCellBoolean } from "@/components/data-table/table-cell-boolean";
+import { TableCellDate } from "@/components/data-table/table-cell-date";
+import { TableCellNumber } from "@/components/data-table/table-cell-number";
+import { TableCellRegion } from "@/components/data-table/table-cell-region";
+import { TableCellText } from "@/components/data-table/table-cell-text";
+
+import type {
+ DetailsRow,
+ DetailsSection,
+ DetailsTableData,
+} from "./details-table";
+
+type Input = AgentToolInput<"get_response_log">;
+type Output = AgentToolOutput<"get_response_log">;
+type Timing = NonNullable<Output["timing"]>;
+
+export function getResponseLogDetails(
+ _input: Input,
+ output: Output,
+): DetailsTableData {
+ const request: DetailsRow[] = [
+ { label: "Log ID", value: <TableCellText value={output.id} /> },
+ { label: "Monitor", value: <TableCellText value={output.monitorId} /> },
+ { label: "Region", value: <TableCellRegion value={output.region} /> },
+ { label: "URL", value: <TableCellText value={output.url} /> },
+ {
+ label: "Status",
+ value: <TableCellText value={output.requestStatus} />,
+ },
+ {
+ label: "Status code",
+ value: <TableCellNumber value={output.statusCode} />,
+ },
+ {
+ label: "Latency",
+ value: <TableCellNumber value={output.latency} unit="ms" />,
+ },
+ {
+ label: "Timestamp",
+ value: <TableCellDate value={new Date(output.timestamp)} />,
+ },
+ { label: "Trigger", value: <TableCellText value={output.trigger} /> },
+ { label: "Error", value: <TableCellBoolean value={output.error} /> },
+ ];
+
+ const sections: DetailsSection[] = [{ rows: request }];
+
+ if (Object.keys(output.headers).length > 0) {
+ sections.push({
+ rows: [
+ {
+ label: "Headers",
+ value: (
+ <pre className="whitespace-pre-wrap break-all text-foreground">
+ {JSON.stringify(output.headers, null, 2)}
+ </pre>
+ ),
+ },
+ ],
+ });
+ }
+
+ if (output.timing) {
+ sections.push({
+ rows: timingRows(output.timing, output.latency),
+ });
+ }
+
+ if (output.message) {
+ sections.push({
+ rows: [
+ { label: "Message", value: <TableCellText value={output.message} /> },
+ ],
+ });
+ }
+
+ if (output.assertions) {
+ sections.push({
+ rows: [
+ {
+ label: "Assertions",
+ value: <TableCellText value={output.assertions} />,
+ },
+ ],
+ });
+ }
+
+ return { sections };
+}
+
+function timingRows(timing: Timing, latency: number): DetailsRow[] {
+ const denom = latency || 1;
+ return Object.entries(timing).map(([key, value], index) => ({
+ label: key.toUpperCase(),
+ value: (
+ <div className="flex items-center justify-between gap-3">
+ <span className="text-muted-foreground">
+ {new Intl.NumberFormat("en-US", { maximumFractionDigits: 2 }).format(
+ (value / denom) * 100,
+ )}
+ %
+ </span>
+ <div className="flex flex-1 items-center justify-end gap-1">
+ <span className="text-nowrap text-muted-foreground">{value} ms</span>
+ <div
+ className="h-3"
+ style={{
+ width: `${(value / denom) * 100}%`,
+ backgroundColor: `var(--chart-${index + 1})`,
+ }}
+ />
+ </div>
+ </div>
+ ),
+ }));
+}
diff --git a/apps/dashboard/src/components/chat/tool-renderers/index.tsx b/apps/dashboard/src/components/chat/tool-renderers/index.tsx
index 1e42271cc..802d9c32d 100644
--- a/apps/dashboard/src/components/chat/tool-renderers/index.tsx
+++ b/apps/dashboard/src/components/chat/tool-renderers/index.tsx
@@ -13,7 +13,15 @@ import {
import { addStatusReportUpdateChanges } from "./add-status-report-update";
import { createMaintenanceChanges } from "./create-maintenance";
import { createStatusReportChanges } from "./create-status-report";
+import { DetailsTable } from "./details-table";
+import { getMonitorDetails } from "./get-monitor";
+import { getMonitorStatusTable } from "./get-monitor-status";
+import { getMonitorSummaryDetails } from "./get-monitor-summary";
+import { getResponseLogDetails } from "./get-response-log";
import { listMaintenancesTable } from "./list-maintenances";
+import { listMonitorsTable } from "./list-monitors";
+import { listNotificationsTable } from "./list-notifications";
+import { listResponseLogsTable } from "./list-response-logs";
import { listStatusPagesTable } from "./list-status-pages";
import { listStatusReportsTable } from "./list-status-reports";
import { resolveStatusReportChanges } from "./resolve-status-report";
@@ -121,6 +129,51 @@ export const toolRenderers: ToolRendererRegistry = {
),
summary: (o) => `ID ${o.id}`,
},
+ list_monitors: {
+ renderResult: ({ output }) => (
+ <ResultTable {...listMonitorsTable(output)} />
+ ),
+ summary: (o) => itemsCountSummary(o.items),
+ },
+ list_notifications: {
+ renderResult: ({ output }) => (
+ <ResultTable {...listNotificationsTable(output)} />
+ ),
+ summary: (o) => itemsCountSummary(o.items),
+ },
+ list_response_logs: {
+ renderResult: ({ output }) => (
+ <ResultTable {...listResponseLogsTable(output)} />
+ ),
+ summary: (o) =>
+ `${o.logs.length} log${o.logs.length === 1 ? "" : "s"}${o.hasMore ? " (more available)" : ""}`,
+ },
+ get_monitor: {
+ renderResult: ({ input, output }) => (
+ <DetailsTable {...getMonitorDetails(input, output)} />
+ ),
+ summary: (o) => `ID ${o.id}`,
+ },
+ get_monitor_status: {
+ renderResult: ({ output }) => (
+ <ResultTable {...getMonitorStatusTable(output)} />
+ ),
+ summary: (o) =>
+ `${o.regions.length} region${o.regions.length === 1 ? "" : "s"}`,
+ },
+ get_monitor_summary: {
+ renderResult: ({ input, output }) => (
+ <DetailsTable {...getMonitorSummaryDetails(input, output)} />
+ ),
+ summary: (o) =>
+ `${o.totalSuccessful + o.totalDegraded + o.totalFailed} checks · p95 ${o.p95}ms`,
+ },
+ get_response_log: {
+ renderResult: ({ input, output }) => (
+ <DetailsTable {...getResponseLogDetails(input, output)} />
+ ),
+ summary: (o) => (o.id ? `log ${o.id}` : undefined),
+ },
};
function itemsCountSummary(items: unknown[] | undefined): string | undefined {
diff --git a/apps/dashboard/src/components/chat/tool-renderers/list-monitors.tsx b/apps/dashboard/src/components/chat/tool-renderers/list-monitors.tsx
new file mode 100644
index 000000000..ca3da48cc
--- /dev/null
+++ b/apps/dashboard/src/components/chat/tool-renderers/list-monitors.tsx
@@ -0,0 +1,57 @@
+import type { AgentToolOutput } from "@openstatus/services/agent-tools";
+
+import { TableCellBoolean } from "@/components/data-table/table-cell-boolean";
+import { TableCellLink } from "@/components/data-table/table-cell-link";
+import { TableCellNumber } from "@/components/data-table/table-cell-number";
+import { TableCellText } from "@/components/data-table/table-cell-text";
+
+import type { ResultTableData } from "./result-table";
+
+type Output = AgentToolOutput<"list_monitors">;
+
+export function listMonitorsTable(
+ output: Output,
+): ResultTableData<
+ "name" | "jobType" | "periodicity" | "regions" | "active" | "id"
+> {
+ const items = output?.items ?? [];
+ return {
+ empty: "No monitors.",
+ columns: [
+ { key: "name", header: "Name" },
+ { key: "jobType", header: "Type" },
+ { key: "periodicity", header: "Periodicity" },
+ { key: "regions", header: "Regions" },
+ { key: "active", header: "Active" },
+ { key: "id", header: "ID" },
+ ],
+ rows: items.map((m) => ({
+ id: m.id,
+ cells: {
+ name: (
+ <TableCellLink href={`/monitors/${m.id}/overview`} value={m.name} />
+ ),
+ jobType: (
+ <TableCellText
+ value={m.jobType.toUpperCase()}
+ className="font-mono text-muted-foreground"
+ />
+ ),
+ periodicity: (
+ <TableCellText
+ value={m.periodicity}
+ className="font-mono text-muted-foreground"
+ />
+ ),
+ regions: (
+ <TableCellText
+ value={m.regions.join(", ") || "—"}
+ className="font-mono text-muted-foreground"
+ />
+ ),
+ active: <TableCellBoolean value={m.active} />,
+ id: <TableCellNumber value={m.id} />,
+ },
+ })),
+ };
+}
diff --git a/apps/dashboard/src/components/chat/tool-renderers/list-notifications.tsx b/apps/dashboard/src/components/chat/tool-renderers/list-notifications.tsx
new file mode 100644
index 000000000..5139c7320
--- /dev/null
+++ b/apps/dashboard/src/components/chat/tool-renderers/list-notifications.tsx
@@ -0,0 +1,47 @@
+import type { AgentToolOutput } from "@openstatus/services/agent-tools";
+
+import { TableCellLink } from "@/components/data-table/table-cell-link";
+import { TableCellNumber } from "@/components/data-table/table-cell-number";
+import { TableCellText } from "@/components/data-table/table-cell-text";
+
+import type { ResultTableData } from "./result-table";
+
+type Output = AgentToolOutput<"list_notifications">;
+
+export function listNotificationsTable(
+ output: Output,
+): ResultTableData<"name" | "provider" | "monitors" | "id"> {
+ const items = output?.items ?? [];
+ return {
+ empty: "No notification channels.",
+ columns: [
+ { key: "name", header: "Name" },
+ { key: "provider", header: "Provider" },
+ { key: "monitors", header: "Monitors" },
+ { key: "id", header: "ID" },
+ ],
+ rows: items.map((n) => ({
+ id: n.id,
+ cells: {
+ name: <TableCellLink href={`/notifications/${n.id}`} value={n.name} />,
+ provider: (
+ <TableCellText
+ value={n.provider}
+ className="font-mono text-muted-foreground"
+ />
+ ),
+ monitors: (
+ <TableCellText
+ value={
+ n.monitorIds.length === 0
+ ? "none"
+ : `${n.monitorIds.length} (${n.monitorIds.join(", ")})`
+ }
+ className="font-mono text-muted-foreground"
+ />
+ ),
+ id: <TableCellNumber value={n.id} />,
+ },
+ })),
+ };
+}
diff --git a/apps/dashboard/src/components/chat/tool-renderers/list-response-logs.tsx b/apps/dashboard/src/components/chat/tool-renderers/list-response-logs.tsx
new file mode 100644
index 000000000..10e8d8fa9
--- /dev/null
+++ b/apps/dashboard/src/components/chat/tool-renderers/list-response-logs.tsx
@@ -0,0 +1,83 @@
+import type { AgentToolOutput } from "@openstatus/services/agent-tools";
+import { cn } from "@openstatus/ui/lib/utils";
+
+import { HoverCardTiming } from "@/components/common/hover-card-timing";
+import { TableCellDate } from "@/components/data-table/table-cell-date";
+import { TableCellNumber } from "@/components/data-table/table-cell-number";
+import { TableCellRegion } from "@/components/data-table/table-cell-region";
+import { TableCellText } from "@/components/data-table/table-cell-text";
+import { getStatusCodeVariant, textColors } from "@/data/status-codes";
+
+import type { ResultTableData } from "./result-table";
+
+type Output = AgentToolOutput<"list_response_logs">;
+type Status = NonNullable<Output["logs"][number]["requestStatus"]>;
+
+const statusColor: Record<Status, string> = {
+ success: "bg-success",
+ degraded: "bg-warning",
+ error: "bg-destructive",
+};
+
+export function listResponseLogsTable(
+ output: Output,
+): ResultTableData<
+ "indicator" | "timestamp" | "region" | "status" | "latency" | "timing" | "id"
+> {
+ const logs = output?.logs ?? [];
+ return {
+ empty: "No response logs in this window.",
+ columns: [
+ { key: "indicator", header: "" },
+ { key: "timestamp", header: "Timestamp" },
+ { key: "region", header: "Region" },
+ { key: "status", header: "Status" },
+ { key: "latency", header: "Latency" },
+ { key: "timing", header: "Timing" },
+ { key: "id", header: "ID" },
+ ],
+ rows: logs.map((log, idx) => ({
+ id: log.id ?? `row-${idx}`,
+ cells: {
+ indicator: log.requestStatus ? (
+ <div
+ className={cn(
+ "h-2.5 w-2.5 rounded-[2px]",
+ statusColor[log.requestStatus],
+ )}
+ />
+ ) : (
+ <div className="text-muted-foreground">-</div>
+ ),
+ timestamp: (
+ <TableCellDate
+ value={new Date(log.timestamp)}
+ className="font-mono text-foreground"
+ />
+ ),
+ region: <TableCellRegion value={log.region} className="font-mono" />,
+ status:
+ log.statusCode != null ? (
+ <TableCellNumber
+ value={log.statusCode}
+ className={textColors[getStatusCodeVariant(log.statusCode)]}
+ />
+ ) : (
+ <TableCellText value="—" />
+ ),
+ latency: <TableCellNumber value={log.latency} unit="ms" />,
+ timing: log.timing ? (
+ <HoverCardTiming timing={log.timing} latency={log.latency} />
+ ) : (
+ <div className="text-muted-foreground">-</div>
+ ),
+ id: (
+ <TableCellText
+ value={log.id ?? "—"}
+ className="font-mono text-muted-foreground"
+ />
+ ),
+ },
+ })),
+ };
+}
diff --git a/apps/dashboard/src/components/common/hover-card-timing.tsx b/apps/dashboard/src/components/common/hover-card-timing.tsx
new file mode 100644
index 000000000..4039a0a18
--- /dev/null
+++ b/apps/dashboard/src/components/common/hover-card-timing.tsx
@@ -0,0 +1,90 @@
+import {
+ HoverCard,
+ HoverCardContent,
+ HoverCardTrigger,
+} from "@openstatus/ui/components/ui/hover-card";
+import { cn } from "@openstatus/ui/lib/utils";
+
+export type Timing = {
+ dns: number;
+ connect: number;
+ tls: number;
+ ttfb: number;
+ transfer: number;
+};
+
+export function HoverCardTiming({
+ timing,
+ latency,
+}: {
+ timing: Timing;
+ latency: number;
+}) {
+ const phasesTotal =
+ Object.values(timing).reduce((acc, v) => acc + v, 0) || latency || 1;
+ return (
+ <HoverCard openDelay={50} closeDelay={50}>
+ <HoverCardTrigger
+ className="opacity-70 hover:opacity-100 data-[state=open]:opacity-100"
+ asChild
+ >
+ <div className="flex">
+ {Object.entries(timing).map(([key, value], index) => (
+ <div
+ key={key}
+ className={cn("h-4")}
+ style={{
+ width: `${(value / phasesTotal) * 100}%`,
+ backgroundColor: `var(--chart-${index + 1})`,
+ }}
+ />
+ ))}
+ </div>
+ </HoverCardTrigger>
+ <HoverCardContent side="bottom" align="end" className="z-10 w-auto p-2">
+ <HoverCardTimingContent timing={timing} latency={latency} />
+ </HoverCardContent>
+ </HoverCard>
+ );
+}
+
+export function HoverCardTimingContent({
+ timing,
+ latency,
+}: {
+ timing: Timing;
+ latency: number;
+}) {
+ return (
+ <div className="flex flex-col gap-1">
+ {Object.entries(timing).map(([key, value], index) => {
+ return (
+ <div key={key} className="grid grid-cols-2 gap-4 text-xs">
+ <div className="flex items-center gap-2">
+ <div
+ className={cn("h-2 w-2 rounded-full")}
+ style={{ backgroundColor: `var(--chart-${index + 1})` }}
+ />
+ <div className="font-mono text-accent-foreground uppercase">
+ {key}
+ </div>
+ </div>
+ <div className="flex items-center justify-between gap-4">
+ <div className="font-mono text-muted-foreground">
+ {`${new Intl.NumberFormat("en-US", {
+ maximumFractionDigits: 2,
+ }).format((value / (latency || 1)) * 100)}%`}
+ </div>
+ <div className="font-mono">
+ {new Intl.NumberFormat("en-US", {
+ maximumFractionDigits: 3,
+ }).format(value)}
+ <span className="text-muted-foreground">ms</span>
+ </div>
+ </div>
+ </div>
+ );
+ })}
+ </div>
+ );
+}
diff --git a/apps/dashboard/src/components/data-table/response-logs/columns.tsx b/apps/dashboard/src/components/data-table/response-logs/columns.tsx
index 3d1614e10..29f85de37 100644
--- a/apps/dashboard/src/components/data-table/response-logs/columns.tsx
+++ b/apps/dashboard/src/components/data-table/response-logs/columns.tsx
@@ -1,24 +1,19 @@
"use client";
import { HoverCardTimestamp } from "@/components/common/hover-card-timestamp";
+import { HoverCardTiming } from "@/components/common/hover-card-timing";
import { TableCellDate } from "@/components/data-table/table-cell-date";
import { TableCellNumber } from "@/components/data-table/table-cell-number";
+import { TableCellRegion } from "@/components/data-table/table-cell-region";
import { getStatusCodeVariant, textColors } from "@/data/status-codes";
import type { RouterOutputs } from "@openstatus/api";
import type { PrivateLocation } from "@openstatus/db/src/schema";
-import { getRegionInfo } from "@openstatus/regions";
-import {
- HoverCard,
- HoverCardContent,
- HoverCardTrigger,
-} from "@openstatus/ui/components/ui/hover-card";
import {
Tooltip,
TooltipContent,
TooltipProvider,
TooltipTrigger,
} from "@openstatus/ui/components/ui/tooltip";
-import { cn } from "@openstatus/ui/lib/utils";
import type { ColumnDef } from "@tanstack/react-table";
import { Clock, Workflow } from "lucide-react";
@@ -94,28 +89,12 @@ export function getColumns(
{
accessorKey: "region",
header: "Region",
- cell: ({ row }) => {
- const value = row.getValue("region");
-
- if (typeof value !== "string") {
- return <div className="text-muted-foreground">-</div>;
- }
-
- const regionConfig = getRegionInfo(value, {
- location: privateLocations.find(
- (location) => String(location.id) === String(value),
- )?.name,
- });
-
- return (
- <div>
- {regionConfig.location}{" "}
- <span className="text-muted-foreground/70 text-xs">
- ({regionConfig.provider})
- </span>
- </div>
- );
- },
+ cell: ({ row }) => (
+ <TableCellRegion
+ value={row.getValue("region")}
+ privateLocations={privateLocations}
+ />
+ ),
enableSorting: false,
enableHiding: false,
filterFn: "arrIncludesSome",
@@ -168,79 +147,3 @@ export function getColumns(
},
];
}
-
-function HoverCardTiming({
- timing,
- latency,
-}: {
- timing: NonNullable<Extract<ResponseLog, { type: "http" }>["timing"]>;
- latency: number;
-}) {
- const phasesTotal =
- Object.values(timing).reduce((acc, v) => acc + v, 0) || latency;
- return (
- <HoverCard openDelay={50} closeDelay={50}>
- <HoverCardTrigger
- className="opacity-70 hover:opacity-100 data-[state=open]:opacity-100"
- asChild
- >
- <div className="flex">
- {Object.entries(timing).map(([key, value], index) => (
- <div
- key={key}
- className={cn("h-4")}
- style={{
- width: `${(value / phasesTotal) * 100}%`,
- backgroundColor: `var(--chart-${index + 1})`,
- }}
- />
- ))}
- </div>
- </HoverCardTrigger>
- <HoverCardContent side="bottom" align="end" className="z-10 w-auto p-2">
- <HoverCardTimingContent {...{ latency, timing }} />
- </HoverCardContent>
- </HoverCard>
- );
-}
-
-function HoverCardTimingContent({
- timing,
- latency,
-}: {
- timing: NonNullable<Extract<ResponseLog, { type: "http" }>["timing"]>;
- latency: number;
-}) {
- return (
- <div className="flex flex-col gap-1">
- {Object.entries(timing).map(([key, value], index) => {
- return (
- <div key={key} className="grid grid-cols-2 gap-4 text-xs">
- <div className="flex items-center gap-2">
- <div
- className={cn("h-2 w-2 rounded-full")}
- style={{ backgroundColor: `var(--chart-${index + 1})` }}
- />
- <div className="font-mono text-accent-foreground uppercase">
- {key}
- </div>
- </div>
- <div className="flex items-center justify-between gap-4">
- <div className="font-mono text-muted-foreground">
- {`${new Intl.NumberFormat("en-US", {
- maximumFractionDigits: 2,
- }).format((value / latency) * 100)}%`}
- </div>
- <div className="font-mono">
- {new Intl.NumberFormat("en-US", {
- maximumFractionDigits: 3,
- }).format(value)}
- <span className="text-muted-foreground">ms</span>
- </div>
- </div>
- </div>
- );
- })}
- </div>
- );
-}
diff --git a/apps/dashboard/src/components/data-table/table-cell-region.tsx b/apps/dashboard/src/components/data-table/table-cell-region.tsx
new file mode 100644
index 000000000..9996e7a10
--- /dev/null
+++ b/apps/dashboard/src/components/data-table/table-cell-region.tsx
@@ -0,0 +1,34 @@
+import type { PrivateLocation } from "@openstatus/db/src/schema";
+import { getRegionInfo } from "@openstatus/regions";
+
+import { cn } from "@/lib/utils";
+
+export function TableCellRegion({
+ value,
+ privateLocations,
+ className,
+ ...props
+}: React.ComponentProps<"div"> & {
+ value: unknown;
+ privateLocations?: PrivateLocation[];
+}) {
+ if (typeof value !== "string" || value.length === 0) {
+ return (
+ <div className={cn("text-muted-foreground", className)} {...props}>
+ -
+ </div>
+ );
+ }
+ const info = getRegionInfo(value, {
+ location: privateLocations?.find((loc) => String(loc.id) === String(value))
+ ?.name,
+ });
+ return (
+ <div className={cn(className)} {...props}>
+ {info.location}{" "}
+ <span className="text-muted-foreground/70 text-xs">
+ ({info.provider})
+ </span>
+ </div>
+ );
+}
diff --git a/apps/dashboard/src/components/nav/nav-breadcrumb.tsx b/apps/dashboard/src/components/nav/nav-breadcrumb.tsx
index dbb8b74a0..150f94eab 100644
--- a/apps/dashboard/src/components/nav/nav-breadcrumb.tsx
+++ b/apps/dashboard/src/components/nav/nav-breadcrumb.tsx
@@ -57,8 +57,8 @@ export function NavBreadcrumb({ items }: NavBreadcrumbProps) {
</BreadcrumbLink>
) : null}
{item.type === "page" ? (
- <BreadcrumbPage className=" hidden max-w-[120px] truncate font-commit-mono tracking-tight md:block lg:max-w-[200px] ">
- <span className="flex items-center gap-1.5">
+ <BreadcrumbPage className=" hidden max-w-[120px] font-commit-mono tracking-tight md:block lg:max-w-[200px] ">
+ <span className="flex min-w-0 items-center gap-1.5">
{item.icon && (
<item.icon
size={16}
@@ -66,8 +66,7 @@ export function NavBreadcrumb({ items }: NavBreadcrumbProps) {
className="shrink-0"
/>
)}
-
- {item.label}
+ <span className="truncate">{item.label}</span>
</span>
</BreadcrumbPage>
) : null}
diff --git a/apps/server/src/routes/mcp/evals/cases.ts b/apps/server/src/routes/mcp/evals/cases.ts
index f2432a9d2..6f2e7948b 100644
--- a/apps/server/src/routes/mcp/evals/cases.ts
+++ b/apps/server/src/routes/mcp/evals/cases.ts
@@ -108,4 +108,46 @@ export const cases: EvalCase[] = [
'Edit the title of status report 7 to "Investigating slow queries" — do not post a new public update.',
expectedTool: "update_status_report",
},
+
+ {
+ id: "antiguess.monitor_by_name",
+ prompt: "How healthy is our checkout monitor?",
+ expectedTool: "list_monitors",
+ },
+ {
+ id: "antiguess.notification_by_name",
+ prompt: "Is the PagerDuty channel still wired up?",
+ expectedTool: "list_notifications",
+ },
+ {
+ id: "compose.status_before_report",
+ prompt:
+ "Monitor 12 looks degraded — draft a status report saying our API is slow in EU.",
+ expectedTool: "get_monitor_status",
+ requiredArgs: ["monitorId"],
+ },
+ {
+ id: "select.monitor_status_by_id",
+ prompt: "Which regions is monitor 17 failing in right now?",
+ expectedTool: "get_monitor_status",
+ requiredArgs: ["monitorId"],
+ },
+ {
+ id: "default.summary_1d",
+ prompt: "What's the p95 latency on monitor 17 right now?",
+ expectedTool: "get_monitor_summary",
+ requiredArgs: ["monitorId"],
+ },
+ {
+ id: "select.response_logs",
+ prompt: "Show me the failing checks for monitor 17 in the last hour.",
+ expectedTool: "list_response_logs",
+ requiredArgs: ["monitorId"],
+ },
+ {
+ id: "select.list_notifications",
+ prompt:
+ "What alerting channels do we have configured? Will anyone get paged if monitor 17 goes down?",
+ expectedTool: "list_notifications",
+ },
];
diff --git a/apps/server/src/routes/mcp/handler.test.ts b/apps/server/src/routes/mcp/handler.test.ts
index d1890bf8b..c7feabd80 100644
--- a/apps/server/src/routes/mcp/handler.test.ts
+++ b/apps/server/src/routes/mcp/handler.test.ts
@@ -3,7 +3,7 @@ import { sentry } from "@hono/sentry";
import { Hono } from "hono";
import { requestId } from "hono/request-id";
-import { db, eq } from "@openstatus/db";
+import { db, desc, eq } from "@openstatus/db";
import { auditLog, page, statusReport } from "@openstatus/db/src/schema";
import { SEEDED_WORKSPACE_TEAM_ID } from "@openstatus/services/test/fixtures";
@@ -76,7 +76,7 @@ describe("MCP transport", () => {
expect(res.status).toBe(401);
});
- test("tools/list returns the 8 registered tools", async () => {
+ test("tools/list returns the 15 registered tools", async () => {
const app = makeApp();
const res = await app.fetch(jsonRpc({ method: "tools/list" }));
expect(res.status).toBe(200);
@@ -87,7 +87,14 @@ describe("MCP transport", () => {
"add_status_report_update",
"create_maintenance",
"create_status_report",
+ "get_monitor",
+ "get_monitor_status",
+ "get_monitor_summary",
+ "get_response_log",
"list_maintenances",
+ "list_monitors",
+ "list_notifications",
+ "list_response_logs",
"list_status_pages",
"list_status_reports",
"resolve_status_report",
@@ -176,7 +183,7 @@ describe("MCP transport", () => {
}[];
}
).tools;
- expect(tools).toHaveLength(8);
+ expect(tools).toHaveLength(15);
for (const tool of tools) {
expect(tool.description?.length ?? 0).toBeGreaterThan(40);
expect(tool.inputSchema).toBeDefined();
@@ -274,6 +281,7 @@ describe("MCP transport — audit stamping", () => {
.select()
.from(auditLog)
.where(eq(auditLog.entityId, String(reportId)))
+ .orderBy(desc(auditLog.id))
.all();
const createRow = rows.find((r) => r.action === "status_report.create");
expect(createRow).toBeDefined();
diff --git a/apps/server/src/routes/mcp/server.ts b/apps/server/src/routes/mcp/server.ts
index 25dccecbd..a0e3634b1 100644
--- a/apps/server/src/routes/mcp/server.ts
+++ b/apps/server/src/routes/mcp/server.ts
@@ -3,6 +3,8 @@ import type { ServiceContext } from "@openstatus/services";
import packageJson from "../../../package.json" with { type: "json" };
import { registerMaintenanceTools } from "./tools/maintenance";
+import { registerMonitorTools } from "./tools/monitor";
+import { registerNotificationTools } from "./tools/notification";
import { registerPageTools } from "./tools/page";
import { registerStatusReportTools } from "./tools/status-report";
@@ -24,5 +26,7 @@ export function createMcpServer(ctx: ServiceContext): McpServer {
registerPageTools(server, ctx);
registerStatusReportTools(server, ctx);
registerMaintenanceTools(server, ctx);
+ registerMonitorTools(server, ctx);
+ registerNotificationTools(server, ctx);
return server;
}
diff --git a/apps/server/src/routes/mcp/tools/monitor.ts b/apps/server/src/routes/mcp/tools/monitor.ts
new file mode 100644
index 000000000..fb32d8b30
--- /dev/null
+++ b/apps/server/src/routes/mcp/tools/monitor.ts
@@ -0,0 +1,29 @@
+import type {
+ McpServer,
+ RegisteredTool,
+} from "@modelcontextprotocol/sdk/server/mcp.js";
+import type { ServiceContext } from "@openstatus/services";
+import {
+ getMonitorStatusTool,
+ getMonitorSummaryTool,
+ getMonitorTool,
+ getResponseLogTool,
+ listMonitorsTool,
+ listResponseLogsTool,
+} from "@openstatus/services/agent-tools";
+
+import { registerRegistryTools } from "./registry-adapter";
+
+export function registerMonitorTools(
+ server: McpServer,
+ ctx: ServiceContext,
+): Map<string, RegisteredTool> {
+ return registerRegistryTools(server, ctx, [
+ listMonitorsTool,
+ getMonitorTool,
+ getMonitorStatusTool,
+ getMonitorSummaryTool,
+ listResponseLogsTool,
+ getResponseLogTool,
+ ]);
+}
diff --git a/apps/server/src/routes/mcp/tools/notification.ts b/apps/server/src/routes/mcp/tools/notification.ts
new file mode 100644
index 000000000..fa4576feb
--- /dev/null
+++ b/apps/server/src/routes/mcp/tools/notification.ts
@@ -0,0 +1,15 @@
+import type {
+ McpServer,
+ RegisteredTool,
+} from "@modelcontextprotocol/sdk/server/mcp.js";
+import type { ServiceContext } from "@openstatus/services";
+import { listNotificationsTool } from "@openstatus/services/agent-tools";
+
+import { registerRegistryTools } from "./registry-adapter";
+
+export function registerNotificationTools(
+ server: McpServer,
+ ctx: ServiceContext,
+): Map<string, RegisteredTool> {
+ return registerRegistryTools(server, ctx, [listNotificationsTool]);
+}
diff --git a/apps/server/src/routes/rpc/handlers/monitor/index.ts b/apps/server/src/routes/rpc/handlers/monitor/index.ts
index f6c66631b..01a5c7cbb 100644
--- a/apps/server/src/routes/rpc/handlers/monitor/index.ts
+++ b/apps/server/src/routes/rpc/handlers/monitor/index.ts
@@ -1,8 +1,7 @@
import { env } from "@/env";
import { getCheckerPayload, getCheckerUrl } from "@/libs/checker";
-import { tb } from "@/libs/clients";
import type { ServiceImpl } from "@connectrpc/connect";
-import { and, db, eq, gte, inArray, isNull, sql } from "@openstatus/db";
+import { and, db, eq, gte, isNull, sql } from "@openstatus/db";
import { monitor, monitorRun } from "@openstatus/db/src/schema";
import { monitorStatusTable } from "@openstatus/db/src/schema/monitor_status/monitor_status";
import { selectMonitorSchema } from "@openstatus/db/src/schema/monitors/validation";
@@ -19,14 +18,24 @@ import type {
TCPMonitor,
} from "@openstatus/proto/monitor/v1";
import { TimeRange } from "@openstatus/proto/monitor/v1";
-import { NotFoundError } from "@openstatus/services";
-import { deleteMonitor } from "@openstatus/services/monitor";
+import {
+ ForbiddenError,
+ NotFoundError,
+ ValidationError,
+} from "@openstatus/services";
+import {
+ type MonitorTimeRange,
+ deleteMonitor,
+ getMonitorStatus,
+ getMonitorSummary,
+ getResponseLog,
+ listResponseLogs,
+} from "@openstatus/services/monitor";
import { toConnectError, toServiceCtx } from "../../adapter";
import { getRpcContext } from "../../interceptors";
import {
MONITOR_DEFAULTS,
- type TimeRangeKey,
dbMonitorToDnsProto,
dbMonitorToHttpProto,
dbMonitorToTcpProto,
@@ -648,43 +657,23 @@ export const monitorServiceImpl: ServiceImpl<typeof MonitorService> = {
async getMonitorStatus(req, ctx) {
const rpcCtx = getRpcContext(ctx);
- const workspaceId = rpcCtx.workspace.id;
-
- // Get the monitor
- const dbMon = await getMonitorById(Number(req.id), workspaceId);
- if (!dbMon) {
- throw monitorNotFoundError(req.id);
- }
-
- // Parse monitor to get configured regions
- const parsed = selectMonitorSchema.safeParse(dbMon);
- if (!parsed.success) {
- throw monitorParseFailedError(req.id);
+ try {
+ const result = await getMonitorStatus({
+ ctx: toServiceCtx(rpcCtx),
+ input: { monitorId: Number(req.id) },
+ });
+ const regions: RegionStatus[] = result.regions.map((s) => ({
+ $typeName: "openstatus.monitor.v1.RegionStatus" as const,
+ region: stringToRegion(s.region),
+ status: stringToMonitorStatus(s.status),
+ }));
+ return { id: String(result.id), regions };
+ } catch (err) {
+ if (err instanceof NotFoundError) {
+ throw monitorNotFoundError(req.id);
+ }
+ toConnectError(err);
}
-
- // Get monitor status only for configured regions
- const monitorStatuses = await db
- .select()
- .from(monitorStatusTable)
- .where(
- and(
- eq(monitorStatusTable.monitorId, dbMon.id),
- inArray(monitorStatusTable.region, parsed.data.regions),
- ),
- )
- .all();
-
- // Map to proto format
- const regions: RegionStatus[] = monitorStatuses.map((s) => ({
- $typeName: "openstatus.monitor.v1.RegionStatus" as const,
- region: stringToRegion(s.region),
- status: stringToMonitorStatus(s.status),
- }));
-
- return {
- id: String(dbMon.id),
- regions,
- };
},
async getMonitor(req, ctx) {
@@ -727,14 +716,12 @@ export const monitorServiceImpl: ServiceImpl<typeof MonitorService> = {
config: { case: "dns", value: dbMonitorToDnsProto(monitorData) },
};
break;
- default: {
- const _exhaustive: never = monitorData.jobType;
+ default:
throw monitorTypeMismatchError(
req.id,
"http, tcp, or dns",
monitorData.jobType,
);
- }
}
return {
@@ -745,210 +732,126 @@ export const monitorServiceImpl: ServiceImpl<typeof MonitorService> = {
async getMonitorSummary(req, ctx) {
const rpcCtx = getRpcContext(ctx);
- const workspaceId = rpcCtx.workspace.id;
-
- // Get the monitor
- const dbMon = await getMonitorById(Number(req.id), workspaceId);
- if (!dbMon) {
- throw monitorNotFoundError(req.id);
- }
-
- // Parse monitor data
- const parsed = selectMonitorSchema.safeParse(dbMon);
- if (!parsed.success) {
- throw monitorParseFailedError(req.id);
- }
-
- const monitorData = parsed.data;
- const timeRangeKey = timeRangeToKey(req.timeRange);
const effectiveTimeRange =
req.timeRange === TimeRange.TIME_RANGE_UNSPECIFIED
? TimeRange.TIME_RANGE_1D
: req.timeRange;
+ const timeRangeKey: MonitorTimeRange = timeRangeToKey(req.timeRange);
+ const requestedRegions = regionsToStrings(req.regions);
- // Get regions to filter by (use request regions or monitor's configured regions)
- const regionStrings =
- req.regions.length > 0
- ? regionsToStrings(req.regions)
- : monitorData.regions;
-
- // Build Tinybird query parameters
- const queryParams = {
- monitorId: req.id,
- regions: regionStrings.length > 0 ? regionStrings : undefined,
- };
-
- // Call appropriate Tinybird method based on monitor type and time range
- const metricsResult = await getMetricsByTypeAndRange(
- monitorData.jobType,
- timeRangeKey,
- queryParams,
- );
-
- if (!metricsResult || metricsResult.data.length === 0) {
- // Return empty response if no data
+ try {
+ const result = await getMonitorSummary({
+ ctx: toServiceCtx(rpcCtx),
+ input: {
+ monitorId: Number(req.id),
+ timeRange: timeRangeKey,
+ regions: requestedRegions.length > 0 ? requestedRegions : undefined,
+ },
+ });
return {
$typeName: "openstatus.monitor.v1.GetMonitorSummaryResponse" as const,
id: req.id,
- lastPingAt: "",
- totalSuccessful: BigInt(0),
- totalDegraded: BigInt(0),
- totalFailed: BigInt(0),
- p50: BigInt(0),
- p75: BigInt(0),
- p90: BigInt(0),
- p95: BigInt(0),
- p99: BigInt(0),
+ lastPingAt: result.lastPingAt,
+ totalSuccessful: BigInt(result.totalSuccessful),
+ totalDegraded: BigInt(result.totalDegraded),
+ totalFailed: BigInt(result.totalFailed),
+ p50: BigInt(result.p50),
+ p75: BigInt(result.p75),
+ p90: BigInt(result.p90),
+ p95: BigInt(result.p95),
+ p99: BigInt(result.p99),
timeRange: effectiveTimeRange,
- regions: stringsToRegions(regionStrings),
+ regions: stringsToRegions(result.regions),
} satisfies GetMonitorSummaryResponse;
+ } catch (err) {
+ if (err instanceof NotFoundError) {
+ throw monitorNotFoundError(req.id);
+ }
+ if (err instanceof ValidationError) {
+ throw monitorTypeMismatchError(req.id, "http, tcp, or dns", "other");
+ }
+ toConnectError(err);
}
-
- const metrics = metricsResult.data[0];
-
- // Format last timestamp to RFC 3339
- const lastPingAt = metrics.lastTimestamp
- ? new Date(metrics.lastTimestamp).toISOString()
- : "";
-
- return {
- $typeName: "openstatus.monitor.v1.GetMonitorSummaryResponse" as const,
- id: req.id,
- lastPingAt,
- totalSuccessful: BigInt(metrics.success ?? 0),
- totalDegraded: BigInt(metrics.degraded ?? 0),
- totalFailed: BigInt(metrics.error ?? 0),
- p50: BigInt(Math.round(metrics.p50Latency ?? 0)),
- p75: BigInt(Math.round(metrics.p75Latency ?? 0)),
- p90: BigInt(Math.round(metrics.p90Latency ?? 0)),
- p95: BigInt(Math.round(metrics.p95Latency ?? 0)),
- p99: BigInt(Math.round(metrics.p99Latency ?? 0)),
- timeRange: effectiveTimeRange,
- regions: stringsToRegions(regionStrings),
- } satisfies GetMonitorSummaryResponse;
},
async listMonitorHTTPResponseLogs(req, ctx) {
const rpcCtx = getRpcContext(ctx);
- const workspaceId = rpcCtx.workspace.id;
-
- if (!rpcCtx.workspace.limits["response-logs"]) {
- throw responseLogsNotEnabledError();
- }
-
- const dbMon = await getMonitorById(Number(req.id), workspaceId);
- if (!dbMon) {
- throw monitorNotFoundError(req.id);
- }
-
- if (dbMon.jobType !== "http") {
- throw monitorTypeMismatchError(req.id, "http", dbMon.jobType);
- }
-
const limit = Math.min(Math.max(req.limit ?? 25, 1), 100);
const offset = Math.max(req.offset ?? 0, 0);
- // Fetch one extra row so the response can report whether another page exists.
- const result = await tb.httpListBiweekly({
- monitorId: req.id,
- fromDate: req.fromTimestamp ? Number(req.fromTimestamp) : undefined,
- toDate: req.toTimestamp ? Number(req.toTimestamp) : undefined,
- limit: limit + 1,
- offset,
- });
- const logs = result.data.slice(0, limit).map(toHTTPResponseLogListItem);
- const hasMore = result.data.length > limit;
-
- const pagination: HTTPResponseLogPagination = {
- $typeName: "openstatus.monitor.v1.HTTPResponseLogPagination",
- limit,
- offset,
- hasMore,
- nextOffset: hasMore ? offset + limit : undefined,
- };
-
- return {
- $typeName:
- "openstatus.monitor.v1.ListMonitorHTTPResponseLogsResponse" as const,
- logs,
- pagination,
- } satisfies ListMonitorHTTPResponseLogsResponse;
+ try {
+ const result = await listResponseLogs({
+ ctx: toServiceCtx(rpcCtx),
+ input: {
+ monitorId: Number(req.id),
+ fromTimestamp: req.fromTimestamp
+ ? Number(req.fromTimestamp)
+ : undefined,
+ toTimestamp: req.toTimestamp ? Number(req.toTimestamp) : undefined,
+ limit,
+ offset,
+ },
+ });
+ const logs = result.logs.map(toHTTPResponseLogListItem);
+ const pagination: HTTPResponseLogPagination = {
+ $typeName: "openstatus.monitor.v1.HTTPResponseLogPagination",
+ limit: result.limit,
+ offset: result.offset,
+ hasMore: result.hasMore,
+ nextOffset: result.nextOffset,
+ };
+ return {
+ $typeName:
+ "openstatus.monitor.v1.ListMonitorHTTPResponseLogsResponse" as const,
+ logs,
+ pagination,
+ } satisfies ListMonitorHTTPResponseLogsResponse;
+ } catch (err) {
+ if (err instanceof NotFoundError) {
+ throw monitorNotFoundError(req.id);
+ }
+ if (err instanceof ForbiddenError) {
+ throw responseLogsNotEnabledError();
+ }
+ if (err instanceof ValidationError) {
+ const jobType =
+ (await getMonitorById(Number(req.id), rpcCtx.workspace.id))
+ ?.jobType ?? "unknown";
+ throw monitorTypeMismatchError(req.id, "http", jobType);
+ }
+ toConnectError(err);
+ }
},
async getMonitorHTTPResponseLog(req, ctx) {
const rpcCtx = getRpcContext(ctx);
- const workspaceId = rpcCtx.workspace.id;
-
- if (!rpcCtx.workspace.limits["response-logs"]) {
- throw responseLogsNotEnabledError();
- }
-
- const dbMon = await getMonitorById(Number(req.id), workspaceId);
- if (!dbMon) {
- throw monitorNotFoundError(req.id);
- }
-
- if (dbMon.jobType !== "http") {
- throw monitorTypeMismatchError(req.id, "http", dbMon.jobType);
- }
-
- const result = await tb.httpGetBiweekly({
- id: req.logId,
- monitorId: req.id,
- });
- const log = result.data[0];
-
- if (!log) {
- throw responseLogNotFoundError(req.id, req.logId);
- }
-
- return {
- $typeName:
- "openstatus.monitor.v1.GetMonitorHTTPResponseLogResponse" as const,
- log: toHTTPResponseLogDetail(log),
- };
- },
-};
-
-/**
- * Get metrics from Tinybird based on monitor type and time range.
- */
-async function getMetricsByTypeAndRange(
- jobType: string,
- timeRange: TimeRangeKey,
- params: { monitorId: string; regions?: string[] },
-) {
- switch (jobType) {
- case "http":
- switch (timeRange) {
- case "1d":
- return tb.httpMetricsDaily(params);
- case "7d":
- return tb.httpMetricsWeekly(params);
- case "14d":
- return tb.httpMetricsBiweekly(params);
+ try {
+ const log = await getResponseLog({
+ ctx: toServiceCtx(rpcCtx),
+ input: { monitorId: Number(req.id), logId: req.logId },
+ });
+ return {
+ $typeName:
+ "openstatus.monitor.v1.GetMonitorHTTPResponseLogResponse" as const,
+ log: toHTTPResponseLogDetail(log),
+ };
+ } catch (err) {
+ if (err instanceof NotFoundError) {
+ if (err.entity === "response_log") {
+ throw responseLogNotFoundError(req.id, req.logId);
+ }
+ throw monitorNotFoundError(req.id);
}
- break;
- case "tcp":
- switch (timeRange) {
- case "1d":
- return tb.tcpMetricsDaily(params);
- case "7d":
- return tb.tcpMetricsWeekly(params);
- case "14d":
- return tb.tcpMetricsBiweekly(params);
+ if (err instanceof ForbiddenError) {
+ throw responseLogsNotEnabledError();
}
- break;
- case "dns":
- switch (timeRange) {
- case "1d":
- return tb.dnsMetricsDaily(params);
- case "7d":
- return tb.dnsMetricsWeekly(params);
- case "14d":
- return tb.dnsMetricsBiweekly(params);
+ if (err instanceof ValidationError) {
+ const jobType =
+ (await getMonitorById(Number(req.id), rpcCtx.workspace.id))
+ ?.jobType ?? "unknown";
+ throw monitorTypeMismatchError(req.id, "http", jobType);
}
- break;
- }
- return null;
-}
+ toConnectError(err);
+ }
+ },
+};
diff --git a/apps/server/src/routes/rpc/handlers/monitor/response-logs.test.ts b/apps/server/src/routes/rpc/handlers/monitor/response-logs.test.ts
index b7312a9cf..575dc685c 100644
--- a/apps/server/src/routes/rpc/handlers/monitor/response-logs.test.ts
+++ b/apps/server/src/routes/rpc/handlers/monitor/response-logs.test.ts
@@ -1,6 +1,6 @@
import { expect, test } from "bun:test";
-import { redactSensitiveHeaders } from "./response-logs";
+import { redactSensitiveHeaders } from "@openstatus/services/monitor";
test("redactSensitiveHeaders returns an empty object when headers are missing", () => {
expect(redactSensitiveHeaders(null)).toEqual({});
diff --git a/apps/server/src/routes/rpc/handlers/monitor/response-logs.ts b/apps/server/src/routes/rpc/handlers/monitor/response-logs.ts
index 70ac92616..90a4b3268 100644
--- a/apps/server/src/routes/rpc/handlers/monitor/response-logs.ts
+++ b/apps/server/src/routes/rpc/handlers/monitor/response-logs.ts
@@ -7,25 +7,6 @@ import {
} from "@openstatus/proto/monitor/v1";
import { stringToRegion } from "./converters";
-const REDACTED = "[redacted]";
-const SENSITIVE_HEADER_NAMES = new Set([
- "authorization",
- "cookie",
- "set-cookie",
- "proxy-authorization",
- "x-api-key",
- "x-auth-token",
-]);
-const SENSITIVE_HEADER_PARTS = [
- "auth",
- "cookie",
- "credential",
- "key",
- "secret",
- "session",
- "token",
-];
-
type TinybirdTiming = {
dns: number;
connect: number;
@@ -51,29 +32,11 @@ type TinybirdHTTPResponseLogDetail = TinybirdHTTPResponseLogListItem & {
url: string;
error: boolean;
message: string | null;
- headers: Record<string, string> | null;
+ /** Already redacted by the service layer. */
+ headers: Record<string, string>;
assertions: string | null;
};
-function isSensitiveHeader(name: string) {
- const normalized = name.toLowerCase();
- return (
- SENSITIVE_HEADER_NAMES.has(normalized) ||
- SENSITIVE_HEADER_PARTS.some((part) => normalized.includes(part))
- );
-}
-
-export function redactSensitiveHeaders(headers: Record<string, string> | null) {
- if (!headers) return {};
-
- return Object.fromEntries(
- Object.entries(headers).map(([name, value]) => [
- name,
- isSensitiveHeader(name) ? REDACTED : value,
- ]),
- );
-}
-
function toHTTPResponseLogRequestStatus(
status: TinybirdHTTPResponseLogListItem["requestStatus"],
) {
@@ -144,7 +107,7 @@ export function toHTTPResponseLogDetail(
url: log.url,
error: log.error,
message: log.message ?? undefined,
- headers: redactSensitiveHeaders(log.headers),
+ headers: log.headers,
assertions: log.assertions ?? undefined,
};
}
diff --git a/packages/services/package.json b/packages/services/package.json
index a7f80405e..4345604df 100644
--- a/packages/services/package.json
+++ b/packages/services/package.json
@@ -114,6 +114,7 @@
"@openstatus/regions": "workspace:*",
"@openstatus/subscriptions": "workspace:*",
"@openstatus/theme-store": "workspace:*",
+ "@openstatus/tinybird": "workspace:*",
"@openstatus/utils": "workspace:*",
"zod": "4.1.13"
},
diff --git a/packages/services/src/agent-tools/__tests__/shape-equivalence.test.ts b/packages/services/src/agent-tools/__tests__/shape-equivalence.test.ts
new file mode 100644
index 000000000..3236f3e3c
--- /dev/null
+++ b/packages/services/src/agent-tools/__tests__/shape-equivalence.test.ts
@@ -0,0 +1,113 @@
+import { beforeAll, describe, expect, test } from "bun:test";
+
+import { SEEDED_WORKSPACE_TEAM_ID } from "../../../test/fixtures";
+import { loadSeededWorkspace, makeUserCtx } from "../../../test/helpers";
+import type { ServiceContext } from "../../context";
+import { agentTools } from "../index";
+
+let teamCtx: ServiceContext;
+
+beforeAll(async () => {
+ const team = await loadSeededWorkspace(SEEDED_WORKSPACE_TEAM_ID);
+ teamCtx = makeUserCtx(team, { userId: 1 });
+});
+
+describe("agent-tool shape equivalence", () => {
+ test("list_status_pages output matches schema", async () => {
+ const tool = agentTools.list_status_pages;
+ const result = await tool.run({ ctx: teamCtx, input: {} });
+ const parsed = tool.outputSchema.safeParse(result);
+ expect(parsed.success, parsed.error?.message).toBe(true);
+ });
+
+ test("list_status_reports output matches schema", async () => {
+ const tool = agentTools.list_status_reports;
+ const result = await tool.run({
+ ctx: teamCtx,
+ input: { filter: "all", page: 1, perPage: 5 },
+ });
+ const parsed = tool.outputSchema.safeParse(result);
+ expect(parsed.success, parsed.error?.message).toBe(true);
+ });
+
+ test("list_maintenances output matches schema", async () => {
+ const tool = agentTools.list_maintenances;
+ const result = await tool.run({
+ ctx: teamCtx,
+ input: { page: 1, perPage: 5 },
+ });
+ const parsed = tool.outputSchema.safeParse(result);
+ expect(parsed.success, parsed.error?.message).toBe(true);
+ });
+
+ test("list_monitors output matches schema", async () => {
+ const tool = agentTools.list_monitors;
+ const result = await tool.run({
+ ctx: teamCtx,
+ input: { page: 1, perPage: 5 },
+ });
+ const parsed = tool.outputSchema.safeParse(result);
+ expect(parsed.success, parsed.error?.message).toBe(true);
+ });
+
+ test("list_notifications output matches schema", async () => {
+ const tool = agentTools.list_notifications;
+ const result = await tool.run({
+ ctx: teamCtx,
+ input: { page: 1, perPage: 5 },
+ });
+ const parsed = tool.outputSchema.safeParse(result);
+ expect(parsed.success, parsed.error?.message).toBe(true);
+ });
+
+ // Monitor-bound reads need an actual monitor id. The seeded team
+ // workspace has monitor #1 (`OpenStatus`) — see packages/db/src/seed.mts.
+ const SEEDED_TEAM_MONITOR_ID = 1;
+
+ test("get_monitor output matches schema", async () => {
+ const tool = agentTools.get_monitor;
+ const result = await tool.run({
+ ctx: teamCtx,
+ input: { monitorId: SEEDED_TEAM_MONITOR_ID },
+ });
+ const parsed = tool.outputSchema.safeParse(result);
+ expect(parsed.success, parsed.error?.message).toBe(true);
+ });
+
+ test("get_monitor_status output matches schema", async () => {
+ const tool = agentTools.get_monitor_status;
+ const result = await tool.run({
+ ctx: teamCtx,
+ input: { monitorId: SEEDED_TEAM_MONITOR_ID },
+ });
+ const parsed = tool.outputSchema.safeParse(result);
+ expect(parsed.success, parsed.error?.message).toBe(true);
+ });
+
+ test("get_monitor_summary output matches schema", async () => {
+ const tool = agentTools.get_monitor_summary;
+ const result = await tool.run({
+ ctx: teamCtx,
+ input: { monitorId: SEEDED_TEAM_MONITOR_ID, timeRange: "1d" },
+ });
+ const parsed = tool.outputSchema.safeParse(result);
+ expect(parsed.success, parsed.error?.message).toBe(true);
+ });
+
+ test("list_response_logs output matches schema", async () => {
+ const tool = agentTools.list_response_logs;
+ const result = await tool.run({
+ ctx: teamCtx,
+ input: {
+ monitorId: SEEDED_TEAM_MONITOR_ID,
+ timeRange: "1d",
+ limit: 10,
+ offset: 0,
+ },
+ });
+ const parsed = tool.outputSchema.safeParse(result);
+ expect(parsed.success, parsed.error?.message).toBe(true);
+ });
+
+ // get_response_log requires a Tinybird row; covered by RPC handler tests.
+});
diff --git a/packages/services/src/agent-tools/index.ts b/packages/services/src/agent-tools/index.ts
index 622e183fa..899f8e77f 100644
--- a/packages/services/src/agent-tools/index.ts
+++ b/packages/services/src/agent-tools/index.ts
@@ -1,6 +1,15 @@
import type { z } from "zod";
import { createMaintenanceTool, listMaintenancesTool } from "./maintenance";
+import {
+ getMonitorStatusTool,
+ getMonitorSummaryTool,
+ getMonitorTool,
+ getResponseLogTool,
+ listMonitorsTool,
+ listResponseLogsTool,
+} from "./monitor";
+import { listNotificationsTool } from "./notification";
import { listStatusPagesTool } from "./page";
import {
addStatusReportUpdateTool,
@@ -15,6 +24,15 @@ export {
createMaintenanceTool,
listMaintenancesTool,
} from "./maintenance";
+export {
+ getMonitorStatusTool,
+ getMonitorSummaryTool,
+ getMonitorTool,
+ getResponseLogTool,
+ listMonitorsTool,
+ listResponseLogsTool,
+} from "./monitor";
+export { listNotificationsTool } from "./notification";
export { listStatusPagesTool } from "./page";
export {
addStatusReportUpdateTool,
@@ -54,6 +72,13 @@ export const agentTools = {
resolve_status_report: resolveStatusReportTool,
list_maintenances: listMaintenancesTool,
create_maintenance: createMaintenanceTool,
+ list_monitors: listMonitorsTool,
+ get_monitor: getMonitorTool,
+ get_monitor_status: getMonitorStatusTool,
+ get_monitor_summary: getMonitorSummaryTool,
+ list_response_logs: listResponseLogsTool,
+ get_response_log: getResponseLogTool,
+ list_notifications: listNotificationsTool,
} satisfies Record<string, AnyAgentTool>;
/**
diff --git a/packages/services/src/agent-tools/monitor.ts b/packages/services/src/agent-tools/monitor.ts
new file mode 100644
index 000000000..0752bd25d
--- /dev/null
+++ b/packages/services/src/agent-tools/monitor.ts
@@ -0,0 +1,447 @@
+import { monitorStatusSchema } from "@openstatus/db/src/schema";
+import { z } from "zod";
+
+import {
+ type MonitorTimeRange,
+ getMonitor,
+ getMonitorStatus,
+ getMonitorSummary,
+ getResponseLog,
+ listMonitors,
+ listResponseLogs,
+ monitorTimeRange,
+} from "../monitor";
+import type { AgentTool } from "./types";
+
+const LIST_PER_PAGE_DEFAULT = 25;
+const LIST_PER_PAGE_MAX = 50;
+
+const LIST_RESPONSE_LOGS_LIMIT_DEFAULT = 25;
+const LIST_RESPONSE_LOGS_LIMIT_MAX = 100;
+
+const ListMonitorsInputShape = z.object({
+ page: z
+ .number()
+ .int()
+ .min(1)
+ .default(1)
+ .describe("1-indexed page number (default 1)."),
+ perPage: z
+ .number()
+ .int()
+ .min(1)
+ .max(LIST_PER_PAGE_MAX)
+ .default(LIST_PER_PAGE_DEFAULT)
+ .describe(
+ `Items per page (default ${LIST_PER_PAGE_DEFAULT}, max ${LIST_PER_PAGE_MAX}).`,
+ ),
+});
+
+const ListMonitorsOutput = z.object({
+ items: z.array(
+ z.object({
+ id: z.number().int(),
+ name: z.string(),
+ url: z.string(),
+ jobType: z.string(),
+ active: z.boolean(),
+ periodicity: z.string(),
+ regions: z.array(z.string()),
+ tags: z.array(z.string()),
+ activeIncidentCount: z.number().int(),
+ }),
+ ),
+ pagination: z.object({
+ page: z.number().int(),
+ perPage: z.number().int(),
+ totalSize: z.number().int(),
+ totalPages: z.number().int(),
+ }),
+});
+
+export const listMonitorsTool: AgentTool<
+ z.infer<typeof ListMonitorsInputShape>,
+ z.infer<typeof ListMonitorsOutput>
+> = {
+ name: "list_monitors",
+ description:
+ "List monitors in this workspace, newest first. Use to discover the numeric monitorId required by get_monitor, get_monitor_status, get_monitor_summary, list_response_logs. Paginated via `page` (1-indexed) and `perPage`.",
+ scope: "read",
+ destructive: false,
+ inputSchema: ListMonitorsInputShape,
+ outputSchema: ListMonitorsOutput,
+ async run({ ctx, input }) {
+ const { page, perPage } = input;
+ const result = await listMonitors({
+ ctx,
+ input: {
+ limit: perPage,
+ offset: (page - 1) * perPage,
+ order: "desc",
+ },
+ });
+ return {
+ items: result.items.map((m) => ({
+ id: m.id,
+ name: m.name,
+ url: m.url,
+ jobType: m.jobType,
+ active: m.active ?? false,
+ periodicity: m.periodicity,
+ regions: m.regions,
+ tags: m.tags.map((t) => t.name),
+ activeIncidentCount: m.incidents.filter((i) => i.resolvedAt === null)
+ .length,
+ })),
+ pagination: {
+ page,
+ perPage,
+ totalSize: result.totalSize,
+ totalPages: Math.max(1, Math.ceil(result.totalSize / perPage)),
+ },
+ };
+ },
+};
+
+const GetMonitorInputShape = z.object({
+ monitorId: z
+ .number()
+ .int()
+ .describe("Monitor id (numeric). Resolve via list_monitors — never guess."),
+});
+
+const GetMonitorOutput = z.object({
+ id: z.number().int(),
+ name: z.string(),
+ url: z.string(),
+ jobType: z.string(),
+ method: z.string().nullable(),
+ active: z.boolean(),
+ periodicity: z.string(),
+ regions: z.array(z.string()),
+ timeout: z.number().int(),
+ degradedAfter: z.number().int().nullable(),
+ retry: z.number().int(),
+ followRedirects: z.boolean(),
+ public: z.boolean(),
+ tags: z.array(z.object({ id: z.number().int(), name: z.string() })),
+ notifications: z.array(
+ z.object({
+ id: z.number().int(),
+ name: z.string(),
+ provider: z.string(),
+ }),
+ ),
+ privateLocationIds: z.array(z.number().int()),
+});
+
+export const getMonitorTool: AgentTool<
+ z.infer<typeof GetMonitorInputShape>,
+ z.infer<typeof GetMonitorOutput>
+> = {
+ name: "get_monitor",
+ description:
+ "Get the full configuration for a single monitor: URL, regions, periodicity, retry/timeout, notification channels, tags. Use after list_monitors when the user asks for detail on a specific monitor. Does NOT return latency or status — use get_monitor_summary or get_monitor_status for that.",
+ scope: "read",
+ destructive: false,
+ inputSchema: GetMonitorInputShape,
+ outputSchema: GetMonitorOutput,
+ async run({ ctx, input }) {
+ const m = await getMonitor({ ctx, input: { id: input.monitorId } });
+ return {
+ id: m.id,
+ name: m.name,
+ url: m.url,
+ jobType: m.jobType,
+ method: m.method ?? null,
+ active: m.active ?? false,
+ periodicity: m.periodicity,
+ regions: m.regions,
+ timeout: m.timeout,
+ degradedAfter: m.degradedAfter ?? null,
+ retry: m.retry,
+ followRedirects: m.followRedirects ?? false,
+ public: m.public ?? false,
+ tags: m.tags.map((t) => ({ id: t.id, name: t.name })),
+ notifications: m.notifications.map((n) => ({
+ id: n.id,
+ name: n.name,
+ provider: n.provider,
+ })),
+ privateLocationIds: m.privateLocations.map((p) => p.id),
+ };
+ },
+};
+
+const GetMonitorStatusInputShape = z.object({
+ monitorId: z
+ .number()
+ .int()
+ .describe("Monitor id (numeric). Resolve via list_monitors — never guess."),
+});
+
+const GetMonitorStatusOutput = z.object({
+ monitorId: z.number().int(),
+ regions: z.array(
+ z.object({
+ region: z.string(),
+ status: monitorStatusSchema,
+ }),
+ ),
+});
+
+export const getMonitorStatusTool: AgentTool<
+ z.infer<typeof GetMonitorStatusInputShape>,
+ z.infer<typeof GetMonitorStatusOutput>
+> = {
+ name: "get_monitor_status",
+ description:
+ "Per-region health for a monitor (one row per configured region: active/degraded/error). Report at the worst region's level — DO NOT invent a composite 'overall' label. Use before drafting a status report so the public message reflects the actual blast radius.",
+ scope: "read",
+ destructive: false,
+ inputSchema: GetMonitorStatusInputShape,
+ outputSchema: GetMonitorStatusOutput,
+ async run({ ctx, input }) {
+ const result = await getMonitorStatus({
+ ctx,
+ input: { monitorId: input.monitorId },
+ });
+ return {
+ monitorId: result.id,
+ regions: result.regions.map((r) => ({
+ region: r.region,
+ status: r.status,
+ })),
+ };
+ },
+};
+
+const GetMonitorSummaryInputShape = z.object({
+ monitorId: z
+ .number()
+ .int()
+ .describe("Monitor id (numeric). Resolve via list_monitors — never guess."),
+ timeRange: z
+ .enum(monitorTimeRange)
+ .default("1d")
+ .describe("Aggregation window: 1d (default), 7d, 14d."),
+ regions: z
+ .array(z.string())
+ .optional()
+ .describe(
+ "Optional region filter. Defaults to the monitor's currently configured regions.",
+ ),
+});
+
+const GetMonitorSummaryOutput = z.object({
+ monitorId: z.number().int(),
+ timeRange: z.enum(monitorTimeRange),
+ regions: z.array(z.string()),
+ totalSuccessful: z.number().int(),
+ totalDegraded: z.number().int(),
+ totalFailed: z.number().int(),
+ p50: z.number().int(),
+ p75: z.number().int(),
+ p90: z.number().int(),
+ p95: z.number().int(),
+ p99: z.number().int(),
+ lastPingAt: z.string(),
+});
+
+export const getMonitorSummaryTool: AgentTool<
+ z.infer<typeof GetMonitorSummaryInputShape>,
+ z.infer<typeof GetMonitorSummaryOutput>
+> = {
+ name: "get_monitor_summary",
+ description:
+ "Aggregate health metrics for a monitor over a time window: success/degraded/error counts and p50–p99 latency. Default 1d. Pair with get_monitor_status for per-region detail.",
+ scope: "read",
+ destructive: false,
+ inputSchema: GetMonitorSummaryInputShape,
+ outputSchema: GetMonitorSummaryOutput,
+ async run({ ctx, input }) {
+ const result = await getMonitorSummary({
+ ctx,
+ input: {
+ monitorId: input.monitorId,
+ timeRange: input.timeRange,
+ regions: input.regions,
+ },
+ });
+ return {
+ monitorId: result.monitorId,
+ timeRange: input.timeRange,
+ regions: result.regions,
+ totalSuccessful: result.totalSuccessful,
+ totalDegraded: result.totalDegraded,
+ totalFailed: result.totalFailed,
+ p50: result.p50,
+ p75: result.p75,
+ p90: result.p90,
+ p95: result.p95,
+ p99: result.p99,
+ lastPingAt: result.lastPingAt,
+ };
+ },
+};
+
+const ListResponseLogsInputShape = z.object({
+ monitorId: z
+ .number()
+ .int()
+ .describe("Monitor id (numeric). Resolve via list_monitors — never guess."),
+ timeRange: z
+ .enum(monitorTimeRange)
+ .default("1d")
+ .describe("Lookback window: 1d (default), 7d, 14d. Anchored at now."),
+ limit: z
+ .number()
+ .int()
+ .min(1)
+ .max(LIST_RESPONSE_LOGS_LIMIT_MAX)
+ .default(LIST_RESPONSE_LOGS_LIMIT_DEFAULT)
+ .describe(
+ `Items per page (default ${LIST_RESPONSE_LOGS_LIMIT_DEFAULT}, max ${LIST_RESPONSE_LOGS_LIMIT_MAX}).`,
+ ),
+ offset: z.number().int().min(0).default(0),
+});
+
+const ResponseLogTimingSchema = z
+ .object({
+ dns: z.number(),
+ connect: z.number(),
+ tls: z.number(),
+ ttfb: z.number(),
+ transfer: z.number(),
+ })
+ .nullable();
+
+const ResponseLogListItemSchema = z.object({
+ id: z.string().nullable(),
+ monitorId: z.string(),
+ region: z.string(),
+ requestStatus: z.enum(["success", "error", "degraded"]).nullable(),
+ trigger: z.enum(["cron", "api"]).nullable(),
+ statusCode: z.number().int().nullable(),
+ latency: z.number(),
+ cronTimestamp: z.number(),
+ timestamp: z.number(),
+ timing: ResponseLogTimingSchema,
+});
+
+const ListResponseLogsOutput = z.object({
+ logs: z.array(ResponseLogListItemSchema),
+ limit: z.number().int(),
+ offset: z.number().int(),
+ hasMore: z.boolean(),
+ nextOffset: z.number().int().optional(),
+});
+
+export const listResponseLogsTool: AgentTool<
+ z.infer<typeof ListResponseLogsInputShape>,
+ z.infer<typeof ListResponseLogsOutput>
+> = {
+ name: "list_response_logs",
+ description:
+ "Recent HTTP check results for a monitor (per-region, with status code, latency, and request status). Use to diagnose 'what's failing?' over the last 1d (default), 7d, or 14d. HTTP monitors only. Pair with get_response_log for the full detail of a specific check.",
+ scope: "read",
+ destructive: false,
+ inputSchema: ListResponseLogsInputShape,
+ outputSchema: ListResponseLogsOutput,
+ async run({ ctx, input }) {
+ const { from, to } = agentTimeRangeToTimestampWindow(input.timeRange);
+ const result = await listResponseLogs({
+ ctx,
+ input: {
+ monitorId: input.monitorId,
+ fromTimestamp: from,
+ toTimestamp: to,
+ limit: input.limit,
+ offset: input.offset,
+ },
+ });
+ return {
+ logs: result.logs.map((log) => ({
+ id: log.id,
+ monitorId: log.monitorId,
+ region: log.region,
+ requestStatus: log.requestStatus,
+ trigger: log.trigger,
+ statusCode: log.statusCode,
+ latency: log.latency,
+ cronTimestamp: log.cronTimestamp,
+ timestamp: log.timestamp,
+ timing: log.timing,
+ })),
+ limit: result.limit,
+ offset: result.offset,
+ hasMore: result.hasMore,
+ nextOffset: result.nextOffset,
+ };
+ },
+};
+
+const GetResponseLogInputShape = z.object({
+ monitorId: z
+ .number()
+ .int()
+ .describe("Monitor id (numeric). Resolve via list_monitors — never guess."),
+ logId: z
+ .string()
+ .min(1)
+ .describe("Response log id (string). Resolve via list_response_logs."),
+});
+
+const GetResponseLogOutput = ResponseLogListItemSchema.extend({
+ url: z.string(),
+ error: z.boolean(),
+ message: z.string().nullable(),
+ headers: z.record(z.string(), z.string()),
+ assertions: z.string().nullable(),
+});
+
+export const getResponseLogTool: AgentTool<
+ z.infer<typeof GetResponseLogInputShape>,
+ z.infer<typeof GetResponseLogOutput>
+> = {
+ name: "get_response_log",
+ description:
+ "Full detail of a single HTTP response log: URL, response headers (sensitive values redacted), error message, assertion results. Use after list_response_logs to drill into one specific failure. Body content is intentionally not exposed.",
+ scope: "read",
+ destructive: false,
+ inputSchema: GetResponseLogInputShape,
+ outputSchema: GetResponseLogOutput,
+ async run({ ctx, input }) {
+ const log = await getResponseLog({
+ ctx,
+ input: { monitorId: input.monitorId, logId: input.logId },
+ });
+ return {
+ id: log.id,
+ monitorId: log.monitorId,
+ region: log.region,
+ requestStatus: log.requestStatus,
+ trigger: log.trigger,
+ statusCode: log.statusCode,
+ latency: log.latency,
+ cronTimestamp: log.cronTimestamp,
+ timestamp: log.timestamp,
+ timing: log.timing,
+ url: log.url,
+ error: log.error,
+ message: log.message,
+ headers: log.headers,
+ assertions: log.assertions,
+ };
+ },
+};
+
+function agentTimeRangeToTimestampWindow(value: MonitorTimeRange): {
+ from: number;
+ to: number;
+} {
+ const day = 24 * 60 * 60_000;
+ const to = Date.now();
+ const ms = value === "1d" ? day : value === "7d" ? 7 * day : 14 * day;
+ return { from: to - ms, to };
+}
diff --git a/packages/services/src/agent-tools/notification.ts b/packages/services/src/agent-tools/notification.ts
new file mode 100644
index 000000000..15e9adf44
--- /dev/null
+++ b/packages/services/src/agent-tools/notification.ts
@@ -0,0 +1,85 @@
+import { z } from "zod";
+
+import { listNotifications } from "../notification";
+import type { AgentTool } from "./types";
+
+const PER_PAGE_DEFAULT = 50;
+const PER_PAGE_MAX = 200;
+
+const ListNotificationsInputShape = z.object({
+ page: z
+ .number()
+ .int()
+ .min(1)
+ .default(1)
+ .describe("1-indexed page number (default 1)."),
+ perPage: z
+ .number()
+ .int()
+ .min(1)
+ .max(PER_PAGE_MAX)
+ .default(PER_PAGE_DEFAULT)
+ .describe(
+ `Items per page (default ${PER_PAGE_DEFAULT}, max ${PER_PAGE_MAX}).`,
+ ),
+});
+
+// `data` (channel-config) is omitted — it holds tokens, webhook URLs, phone numbers.
+const ListNotificationsOutput = z.object({
+ items: z.array(
+ z.object({
+ id: z.number().int(),
+ name: z.string(),
+ provider: z.string(),
+ monitorIds: z.array(z.number().int()),
+ createdAt: z.string().nullable(),
+ updatedAt: z.string().nullable(),
+ }),
+ ),
+ pagination: z.object({
+ page: z.number().int(),
+ perPage: z.number().int(),
+ totalSize: z.number().int(),
+ totalPages: z.number().int(),
+ }),
+});
+
+export const listNotificationsTool: AgentTool<
+ z.infer<typeof ListNotificationsInputShape>,
+ z.infer<typeof ListNotificationsOutput>
+> = {
+ name: "list_notifications",
+ description:
+ "List notification channels (email/Slack/Discord/PagerDuty/Webhook/etc.) configured in this workspace, with the monitors each one is wired to. Read-only — channel credentials/data are NOT exposed. Use to advise whether alerts will fire for a given monitor.",
+ scope: "read",
+ destructive: false,
+ inputSchema: ListNotificationsInputShape,
+ outputSchema: ListNotificationsOutput,
+ async run({ ctx, input }) {
+ const { page, perPage } = input;
+ const result = await listNotifications({
+ ctx,
+ input: {
+ limit: perPage,
+ offset: (page - 1) * perPage,
+ order: "desc",
+ },
+ });
+ return {
+ items: result.items.map((n) => ({
+ id: n.id,
+ name: n.name,
+ provider: n.provider,
+ monitorIds: n.monitors.map((m) => m.id),
+ createdAt: n.createdAt?.toISOString() ?? null,
+ updatedAt: n.updatedAt?.toISOString() ?? null,
+ })),
+ pagination: {
+ page,
+ perPage,
+ totalSize: result.totalSize,
+ totalPages: Math.max(1, Math.ceil(result.totalSize / perPage)),
+ },
+ };
+ },
+};
diff --git a/packages/services/src/agent-tools/prompt.ts b/packages/services/src/agent-tools/prompt.ts
index 01abd6a0a..5de8a8531 100644
--- a/packages/services/src/agent-tools/prompt.ts
+++ b/packages/services/src/agent-tools/prompt.ts
@@ -31,8 +31,9 @@ export function buildAgentSystemPrompt(opts: AgentSystemPromptOptions): string {
opts.surface === "dashboard"
? `\n\nAfter a tool returns, the dashboard already renders a structured view of the result:
- Write tools (create_*, update_*, resolve_*, add_*) render a diff card with every input/output field (id, status, message, dates, notify outcome).
-- List tools (list_status_pages, list_status_reports, list_maintenances) render a table with one row per result, showing title, slug/status/window, page id, and id.
-DO NOT restate that data in your reply — no markdown tables, no bullet recaps of the rows, no field-by-field summaries. A one-line acknowledgement ("You have 4 status reports — 3 active." / "Incident resolved." / "Maintenance window scheduled.") plus an optional next step is enough.`
+- List tools (list_status_pages, list_status_reports, list_maintenances, list_monitors, list_notifications, list_response_logs) render a table with one row per result.
+- Detail tools (get_monitor, get_monitor_status, get_monitor_summary, get_response_log) render a structured detail card.
+DO NOT restate that data in your reply — no markdown tables, no bullet recaps of the rows, no field-by-field summaries. A one-line acknowledgement ("You have 4 status reports — 3 active." / "Monitor 12 is healthy in 5/7 regions; failing in gru, fra." / "Incident resolved.") plus an optional next step is enough.`
: "";
const preamble = opts.preamble ? `${opts.preamble}\n\n` : "";
@@ -49,15 +50,25 @@ DO NOT restate that data in your reply — no markdown tables, no bullet recaps
The current date and time is ${now} (UTC). Default timezone for any date you produce is UTC unless the user specifies otherwise — mention that you defaulted to UTC when relevant.
${surfaceLine}${dashboardPostToolRule}
-You help teams manage status pages, status reports, and maintenance windows.
+You help teams manage status pages, status reports, and maintenance windows, and answer SRE / on-call questions ("what's broken right now?") against monitors, response logs, and notification channels.
Anti-guess rules — these are absolute:
-- You have NO knowledge of this workspace's data. NEVER invent or guess IDs (page id, status report id, maintenance id, page component id).
+- You have NO knowledge of this workspace's data. NEVER invent or guess IDs (page id, status report id, maintenance id, page component id, monitor id, notification id, response log id).
- Before referencing a status page: call list_status_pages.
- Before referencing a status report: call list_status_reports.
- Before referencing a maintenance window: call list_maintenances.
+- Before referencing a monitor (including by name like "the API monitor"): call list_monitors.
+- Before referencing a notification channel: call list_notifications.
- pageId on create_status_report and create_maintenance MUST come from list_status_pages. Guessing will cause a NOT_FOUND error.
+Monitor diagnostics:
+- get_monitor_status returns one row per configured region (active/degraded/error). Report at the worst region's level: "Healthy in 5/7 regions; failing in gru, fra." Do NOT invent a composite "overall: degraded" label — the per-region facts ARE the answer.
+- Default to the last 1 day for diagnostic queries (get_monitor_summary, list_response_logs); use 7d or 14d if the user asks for a longer window.
+- Before drafting a status report that names a monitor as degraded/down, call get_monitor_status to confirm the per-region state — don't trust the user's framing alone.
+
+Notification channels:
+- list_notifications shows what's configured, including which monitors each channel is wired to. Use it to advise the user ("PagerDuty is attached to monitor 17, so on-call will page"). The agent has NO send-notification tool — actually triggering an alert happens outside chat.
+
Lifecycle:
- Status reports flow: create_status_report once → add_status_report_update repeatedly → resolve_status_report.
- "provide an update", "we found the cause", "still investigating" → add_status_report_update.
diff --git a/packages/services/src/context.ts b/packages/services/src/context.ts
index 39d15f357..1f77bfb11 100644
--- a/packages/services/src/context.ts
+++ b/packages/services/src/context.ts
@@ -1,5 +1,6 @@
import { SQLiteTransaction, db as defaultDb, is } from "@openstatus/db";
import type { Scope, Workspace } from "@openstatus/db/src/schema";
+import { OSTinybird } from "@openstatus/tinybird";
// `@openstatus/db` does not export named DrizzleClient / DrizzleTx types today,
// so we derive them from the db export and re-export from here.
@@ -24,8 +25,11 @@ export type ServiceContext = {
requestId?: string;
span?: unknown;
db?: DB;
+ tb?: OSTinybird;
};
+export const defaultTb = new OSTinybird(process.env.TINY_BIRD_API_KEY ?? "");
+
// drizzle's `is()` helper is identity-safe across module copies (uses a
// symbol-based entityKind), which `instanceof` is not under pnpm when multiple
// resolution paths exist.
diff --git a/packages/services/src/errors.ts b/packages/services/src/errors.ts
index 1c904422e..3f560230f 100644
--- a/packages/services/src/errors.ts
+++ b/packages/services/src/errors.ts
@@ -20,7 +20,10 @@ export class ServiceError extends Error {
}
export class NotFoundError extends ServiceError {
- constructor(entity: string, id?: string | number) {
+ constructor(
+ public entity: string,
+ id?: string | number,
+ ) {
super(
"NOT_FOUND",
id !== undefined ? `${entity} ${id} not found` : `${entity} not found`,
diff --git a/packages/services/src/index.ts b/packages/services/src/index.ts
index a9c0655c2..df9582d4e 100644
--- a/packages/services/src/index.ts
+++ b/packages/services/src/index.ts
@@ -4,6 +4,7 @@ export {
type DrizzleClient,
type DrizzleTx,
type ServiceContext,
+ defaultTb,
extractActorId,
isTx,
tryGetActorUserId,
diff --git a/packages/services/src/monitor/__tests__/reads.test.ts b/packages/services/src/monitor/__tests__/reads.test.ts
new file mode 100644
index 000000000..797d0f75b
--- /dev/null
+++ b/packages/services/src/monitor/__tests__/reads.test.ts
@@ -0,0 +1,273 @@
+import { beforeAll, describe, expect, test } from "bun:test";
+import { monitorStatusTable } from "@openstatus/db/src/schema";
+
+import {
+ SEEDED_WORKSPACE_FREE_ID,
+ SEEDED_WORKSPACE_TEAM_ID,
+} from "../../../test/fixtures";
+import {
+ loadSeededWorkspace,
+ makeUserCtx,
+ withTestTransaction,
+} from "../../../test/helpers";
+import type { ServiceContext } from "../../context";
+import { ForbiddenError, NotFoundError, ValidationError } from "../../errors";
+import { createMonitor } from "../create";
+import { getMonitorStatus } from "../get-monitor-status";
+import { getMonitorSummary } from "../get-monitor-summary";
+import { getResponseLog } from "../get-response-log";
+import { listResponseLogs } from "../list-response-logs";
+
+const TEST_PREFIX = "svc-monitor-reads-test";
+
+let teamCtx: ServiceContext;
+let freeCtx: ServiceContext;
+
+beforeAll(async () => {
+ const team = await loadSeededWorkspace(SEEDED_WORKSPACE_TEAM_ID);
+ const free = await loadSeededWorkspace(SEEDED_WORKSPACE_FREE_ID);
+ teamCtx = makeUserCtx(team, { userId: 1 });
+ freeCtx = makeUserCtx(free, { userId: 2 });
+});
+
+describe("getMonitorStatus", () => {
+ test("throws NotFoundError for cross-workspace monitorId", async () => {
+ await withTestTransaction(async (tx) => {
+ const row = await createMonitor({
+ ctx: { ...teamCtx, db: tx },
+ input: {
+ name: `${TEST_PREFIX}-cross-ws-status`,
+ jobType: "http",
+ url: "https://example.com",
+ method: "GET",
+ headers: [],
+ assertions: [],
+ active: false,
+ regions: ["ams"],
+ },
+ });
+ await expect(
+ getMonitorStatus({
+ ctx: { ...freeCtx, db: tx },
+ input: { monitorId: row.id },
+ }),
+ ).rejects.toBeInstanceOf(NotFoundError);
+ });
+ });
+
+ test("returns empty regions when monitor has no configured regions", async () => {
+ await withTestTransaction(async (tx) => {
+ const row = await createMonitor({
+ ctx: { ...teamCtx, db: tx },
+ input: {
+ name: `${TEST_PREFIX}-empty-regions`,
+ jobType: "http",
+ url: "https://example.com",
+ method: "GET",
+ headers: [],
+ assertions: [],
+ active: false,
+ regions: [],
+ },
+ });
+ const result = await getMonitorStatus({
+ ctx: { ...teamCtx, db: tx },
+ input: { monitorId: row.id },
+ });
+ expect(result).toEqual({ id: row.id, regions: [] });
+ });
+ });
+
+ test("returns one row per configured region (filtered to monitor.regions)", async () => {
+ await withTestTransaction(async (tx) => {
+ const row = await createMonitor({
+ ctx: { ...teamCtx, db: tx },
+ input: {
+ name: `${TEST_PREFIX}-region-rows`,
+ jobType: "http",
+ url: "https://example.com",
+ method: "GET",
+ headers: [],
+ assertions: [],
+ active: true,
+ regions: ["ams", "iad"],
+ },
+ });
+ // Seed status rows: two configured + one stale (gru) that should be ignored.
+ await tx.insert(monitorStatusTable).values([
+ { monitorId: row.id, region: "ams", status: "active" },
+ { monitorId: row.id, region: "iad", status: "error" },
+ { monitorId: row.id, region: "gru", status: "degraded" },
+ ]);
+
+ const result = await getMonitorStatus({
+ ctx: { ...teamCtx, db: tx },
+ input: { monitorId: row.id },
+ });
+ expect(result.id).toBe(row.id);
+ const sorted = [...result.regions].sort((a, b) =>
+ a.region.localeCompare(b.region),
+ );
+ expect(sorted).toEqual([
+ { region: "ams", status: "active" },
+ { region: "iad", status: "error" },
+ ]);
+ });
+ });
+});
+
+describe("getMonitorSummary", () => {
+ test("throws NotFoundError for cross-workspace monitorId", async () => {
+ await withTestTransaction(async (tx) => {
+ const row = await createMonitor({
+ ctx: { ...teamCtx, db: tx },
+ input: {
+ name: `${TEST_PREFIX}-cross-ws-summary`,
+ jobType: "http",
+ url: "https://example.com",
+ method: "GET",
+ headers: [],
+ assertions: [],
+ active: false,
+ regions: ["ams"],
+ },
+ });
+ await expect(
+ getMonitorSummary({
+ ctx: { ...freeCtx, db: tx },
+ input: { monitorId: row.id, timeRange: "1d" },
+ }),
+ ).rejects.toBeInstanceOf(NotFoundError);
+ });
+ });
+
+ test("throws ValidationError for unsupported jobType (icmp)", async () => {
+ await withTestTransaction(async (tx) => {
+ const row = await createMonitor({
+ ctx: { ...teamCtx, db: tx },
+ input: {
+ name: `${TEST_PREFIX}-icmp-summary`,
+ jobType: "icmp",
+ url: "1.1.1.1",
+ method: "GET",
+ headers: [],
+ assertions: [],
+ active: false,
+ regions: ["ams"],
+ },
+ });
+ await expect(
+ getMonitorSummary({
+ ctx: { ...teamCtx, db: tx },
+ input: { monitorId: row.id, timeRange: "1d" },
+ }),
+ ).rejects.toBeInstanceOf(ValidationError);
+ });
+ });
+});
+
+describe("getResponseLog", () => {
+ test("throws ForbiddenError when plan disables response-logs", async () => {
+ await withTestTransaction(async (tx) => {
+ // Free plan: limits["response-logs"] === false. Guard fires before
+ // any monitor lookup, so a fake id is fine.
+ await expect(
+ getResponseLog({
+ ctx: { ...freeCtx, db: tx },
+ input: { monitorId: 999_999, logId: "noop" },
+ }),
+ ).rejects.toBeInstanceOf(ForbiddenError);
+ });
+ });
+
+ test("throws ValidationError for non-http monitor", async () => {
+ await withTestTransaction(async (tx) => {
+ const row = await createMonitor({
+ ctx: { ...teamCtx, db: tx },
+ input: {
+ name: `${TEST_PREFIX}-tcp-detail`,
+ jobType: "tcp",
+ url: "example.com:443",
+ method: "GET",
+ headers: [],
+ assertions: [],
+ active: false,
+ regions: ["ams"],
+ },
+ });
+ await expect(
+ getResponseLog({
+ ctx: { ...teamCtx, db: tx },
+ input: { monitorId: row.id, logId: "noop" },
+ }),
+ ).rejects.toBeInstanceOf(ValidationError);
+ });
+ });
+
+ test("throws NotFoundError for unknown monitorId in own workspace", async () => {
+ await withTestTransaction(async (tx) => {
+ await expect(
+ getResponseLog({
+ ctx: { ...teamCtx, db: tx },
+ input: { monitorId: 999_999_999, logId: "noop" },
+ }),
+ ).rejects.toBeInstanceOf(NotFoundError);
+ });
+ });
+});
+
+describe("listResponseLogs", () => {
+ test("throws ForbiddenError when plan disables response-logs", async () => {
+ await withTestTransaction(async (tx) => {
+ await expect(
+ listResponseLogs({
+ ctx: { ...freeCtx, db: tx },
+ input: { monitorId: 999_999, limit: 10, offset: 0 },
+ }),
+ ).rejects.toBeInstanceOf(ForbiddenError);
+ });
+ });
+
+ test("throws ValidationError for non-http monitor", async () => {
+ await withTestTransaction(async (tx) => {
+ const row = await createMonitor({
+ ctx: { ...teamCtx, db: tx },
+ input: {
+ name: `${TEST_PREFIX}-dns-list`,
+ jobType: "dns",
+ url: "example.com",
+ method: "GET",
+ headers: [],
+ assertions: [
+ {
+ version: "v1",
+ type: "dnsRecord",
+ key: "A",
+ compare: "eq",
+ target: "1.1.1.1",
+ },
+ ],
+ active: false,
+ regions: ["ams"],
+ },
+ });
+ await expect(
+ listResponseLogs({
+ ctx: { ...teamCtx, db: tx },
+ input: { monitorId: row.id, limit: 10, offset: 0 },
+ }),
+ ).rejects.toBeInstanceOf(ValidationError);
+ });
+ });
+
+ test("throws NotFoundError for unknown monitorId in own workspace", async () => {
+ await withTestTransaction(async (tx) => {
+ await expect(
+ listResponseLogs({
+ ctx: { ...teamCtx, db: tx },
+ input: { monitorId: 999_999_999, limit: 10, offset: 0 },
+ }),
+ ).rejects.toBeInstanceOf(NotFoundError);
+ });
+ });
+});
diff --git a/packages/services/src/monitor/get-monitor-status.ts b/packages/services/src/monitor/get-monitor-status.ts
new file mode 100644
index 000000000..233ae540b
--- /dev/null
+++ b/packages/services/src/monitor/get-monitor-status.ts
@@ -0,0 +1,56 @@
+import { and, db as defaultDb, eq, inArray } from "@openstatus/db";
+import {
+ type MonitorStatus,
+ selectMonitorSchema,
+} from "@openstatus/db/src/schema";
+import { monitorStatusTable } from "@openstatus/db/src/schema/monitor_status/monitor_status";
+
+import type { ServiceContext } from "../context";
+import { getMonitorInWorkspace } from "./internal";
+import { GetMonitorStatusInput } from "./schemas";
+
+export type MonitorRegionStatus = {
+ region: string;
+ status: MonitorStatus;
+};
+
+export type GetMonitorStatusResult = {
+ id: number;
+ regions: MonitorRegionStatus[];
+};
+
+export async function getMonitorStatus(args: {
+ ctx: ServiceContext;
+ input: GetMonitorStatusInput;
+}): Promise<GetMonitorStatusResult> {
+ const { ctx } = args;
+ const input = GetMonitorStatusInput.parse(args.input);
+ const db = ctx.db ?? defaultDb;
+
+ const record = await getMonitorInWorkspace({
+ tx: db,
+ id: input.monitorId,
+ workspaceId: ctx.workspace.id,
+ });
+ const parsed = selectMonitorSchema.parse(record);
+
+ if (parsed.regions.length === 0) {
+ return { id: record.id, regions: [] };
+ }
+
+ const rows = await db
+ .select()
+ .from(monitorStatusTable)
+ .where(
+ and(
+ eq(monitorStatusTable.monitorId, record.id),
+ inArray(monitorStatusTable.region, parsed.regions),
+ ),
+ )
+ .all();
+
+ return {
+ id: record.id,
+ regions: rows.map((r) => ({ region: r.region, status: r.status })),
+ };
+}
diff --git a/packages/services/src/monitor/get-monitor-summary.ts b/packages/services/src/monitor/get-monitor-summary.ts
new file mode 100644
index 000000000..bef9fe3c8
--- /dev/null
+++ b/packages/services/src/monitor/get-monitor-summary.ts
@@ -0,0 +1,137 @@
+import { db as defaultDb } from "@openstatus/db";
+import { selectMonitorSchema } from "@openstatus/db/src/schema";
+
+import { type ServiceContext, defaultTb } from "../context";
+import { ValidationError } from "../errors";
+import { getMonitorInWorkspace } from "./internal";
+import { GetMonitorSummaryInput, type MonitorTimeRange } from "./schemas";
+
+export type GetMonitorSummaryResult = {
+ monitorId: number;
+ timeRange: MonitorTimeRange;
+ regions: string[];
+ totalSuccessful: number;
+ totalDegraded: number;
+ totalFailed: number;
+ p50: number;
+ p75: number;
+ p90: number;
+ p95: number;
+ p99: number;
+ lastPingAt: string;
+};
+
+type MetricsRow = {
+ p50Latency: number | null;
+ p75Latency: number | null;
+ p90Latency: number | null;
+ p95Latency: number | null;
+ p99Latency: number | null;
+ count: number;
+ success: number;
+ degraded: number;
+ error: number;
+ lastTimestamp: number | null;
+};
+
+type SupportedJobType = "http" | "tcp" | "dns";
+
+function fetchMetrics(
+ tb: NonNullable<ServiceContext["tb"]>,
+ jobType: SupportedJobType,
+ timeRange: MonitorTimeRange,
+ params: { monitorId: string; regions?: string[] },
+): Promise<{ data: MetricsRow[] }> {
+ const pipe = {
+ http: {
+ "1d": tb.httpMetricsDaily,
+ "7d": tb.httpMetricsWeekly,
+ "14d": tb.httpMetricsBiweekly,
+ },
+ tcp: {
+ "1d": tb.tcpMetricsDaily,
+ "7d": tb.tcpMetricsWeekly,
+ "14d": tb.tcpMetricsBiweekly,
+ },
+ dns: {
+ "1d": tb.dnsMetricsDaily,
+ "7d": tb.dnsMetricsWeekly,
+ "14d": tb.dnsMetricsBiweekly,
+ },
+ }[jobType][timeRange];
+ return pipe(params);
+}
+
+export async function getMonitorSummary(args: {
+ ctx: ServiceContext;
+ input: GetMonitorSummaryInput;
+}): Promise<GetMonitorSummaryResult> {
+ const { ctx } = args;
+ const input = GetMonitorSummaryInput.parse(args.input);
+ const db = ctx.db ?? defaultDb;
+
+ const record = await getMonitorInWorkspace({
+ tx: db,
+ id: input.monitorId,
+ workspaceId: ctx.workspace.id,
+ });
+ const parsed = selectMonitorSchema.parse(record);
+
+ if (
+ parsed.jobType !== "http" &&
+ parsed.jobType !== "tcp" &&
+ parsed.jobType !== "dns"
+ ) {
+ throw new ValidationError(
+ `getMonitorSummary does not support jobType '${parsed.jobType}'`,
+ );
+ }
+
+ const regions =
+ input.regions && input.regions.length > 0 ? input.regions : parsed.regions;
+
+ const result = await fetchMetrics(
+ ctx.tb ?? defaultTb,
+ parsed.jobType,
+ input.timeRange,
+ {
+ monitorId: String(record.id),
+ regions: regions.length > 0 ? regions : undefined,
+ },
+ );
+
+ const row = result.data[0];
+ if (!row) {
+ return {
+ monitorId: record.id,
+ timeRange: input.timeRange,
+ regions,
+ totalSuccessful: 0,
+ totalDegraded: 0,
+ totalFailed: 0,
+ p50: 0,
+ p75: 0,
+ p90: 0,
+ p95: 0,
+ p99: 0,
+ lastPingAt: "",
+ };
+ }
+
+ return {
+ monitorId: record.id,
+ timeRange: input.timeRange,
+ regions,
+ totalSuccessful: row.success ?? 0,
+ totalDegraded: row.degraded ?? 0,
+ totalFailed: row.error ?? 0,
+ p50: Math.round(row.p50Latency ?? 0),
+ p75: Math.round(row.p75Latency ?? 0),
+ p90: Math.round(row.p90Latency ?? 0),
+ p95: Math.round(row.p95Latency ?? 0),
+ p99: Math.round(row.p99Latency ?? 0),
+ lastPingAt: row.lastTimestamp
+ ? new Date(row.lastTimestamp).toISOString()
+ : "",
+ };
+}
diff --git a/packages/services/src/monitor/get-response-log.ts b/packages/services/src/monitor/get-response-log.ts
new file mode 100644
index 000000000..c5316a29f
--- /dev/null
+++ b/packages/services/src/monitor/get-response-log.ts
@@ -0,0 +1,73 @@
+import { db as defaultDb } from "@openstatus/db";
+
+import { type ServiceContext, defaultTb } from "../context";
+import { ForbiddenError, NotFoundError, ValidationError } from "../errors";
+import { getMonitorInWorkspace } from "./internal";
+import type { ResponseLogListItem } from "./list-response-logs";
+import { redactSensitiveHeaders } from "./response-logs-internal";
+import { GetResponseLogInput } from "./schemas";
+
+export type ResponseLogDetail = ResponseLogListItem & {
+ url: string;
+ error: boolean;
+ message: string | null;
+ /** Already redacted at the service boundary. */
+ headers: Record<string, string>;
+ assertions: string | null;
+};
+
+export async function getResponseLog(args: {
+ ctx: ServiceContext;
+ input: GetResponseLogInput;
+}): Promise<ResponseLogDetail> {
+ const { ctx } = args;
+ const input = GetResponseLogInput.parse(args.input);
+ if (!ctx.workspace.limits["response-logs"]) {
+ throw new ForbiddenError("Response logs are not enabled on this plan.");
+ }
+ const db = ctx.db ?? defaultDb;
+
+ const record = await getMonitorInWorkspace({
+ tx: db,
+ id: input.monitorId,
+ workspaceId: ctx.workspace.id,
+ });
+ if (record.jobType !== "http") {
+ throw new ValidationError(
+ `getResponseLog only supports HTTP monitors (got '${record.jobType}').`,
+ );
+ }
+
+ const result = await (ctx.tb ?? defaultTb).httpGetBiweekly({
+ id: input.logId,
+ monitorId: String(record.id),
+ });
+ const log = result.data[0];
+ if (!log) throw new NotFoundError("response_log", input.logId);
+
+ return {
+ id: log.id ?? null,
+ monitorId: log.monitorId,
+ region: log.region,
+ requestStatus: log.requestStatus ?? null,
+ trigger: log.trigger ?? null,
+ statusCode: log.statusCode ?? null,
+ latency: log.latency,
+ cronTimestamp: log.cronTimestamp,
+ timestamp: log.timestamp,
+ timing: log.timing
+ ? {
+ dns: log.timing.dns,
+ connect: log.timing.connect,
+ tls: log.timing.tls,
+ ttfb: log.timing.ttfb,
+ transfer: log.timing.transfer,
+ }
+ : null,
+ url: log.url,
+ error: log.error,
+ message: log.message ?? null,
+ headers: redactSensitiveHeaders(log.headers),
+ assertions: log.assertions ?? null,
+ };
+}
diff --git a/packages/services/src/monitor/index.ts b/packages/services/src/monitor/index.ts
index 1c03a79cf..0ae15bf53 100644
--- a/packages/services/src/monitor/index.ts
+++ b/packages/services/src/monitor/index.ts
@@ -1,6 +1,24 @@
export { cloneMonitor } from "./clone";
export { createMonitor } from "./create";
export { deleteMonitor, deleteMonitors } from "./delete";
+export {
+ getMonitorStatus,
+ type GetMonitorStatusResult,
+ type MonitorRegionStatus,
+} from "./get-monitor-status";
+export {
+ getMonitorSummary,
+ type GetMonitorSummaryResult,
+} from "./get-monitor-summary";
+export {
+ getResponseLog,
+ type ResponseLogDetail,
+} from "./get-response-log";
+export {
+ listResponseLogs,
+ type ListResponseLogsResult,
+ type ResponseLogListItem,
+} from "./list-response-logs";
export {
getMonitor,
type ListMonitorsResult,
@@ -13,6 +31,7 @@ export {
updateMonitorSchedulingRegions,
updateMonitorTags,
} from "./relations";
+export { redactSensitiveHeaders } from "./response-logs-internal";
export {
type CheckResult,
type CheckResultError,
@@ -37,10 +56,16 @@ export {
DeleteMonitorInput,
DeleteMonitorsInput,
GetMonitorInput,
+ GetMonitorStatusInput,
+ GetMonitorSummaryInput,
+ GetResponseLogInput,
ListMonitorsInput,
+ ListResponseLogsInput,
monitorJobTypes,
monitorMethods,
monitorPeriodicity,
+ type MonitorTimeRange,
+ monitorTimeRange,
UpdateMonitorFollowRedirectsInput,
UpdateMonitorGeneralInput,
UpdateMonitorNotifiersInput,
diff --git a/packages/services/src/monitor/list-response-logs.ts b/packages/services/src/monitor/list-response-logs.ts
new file mode 100644
index 000000000..37783d5c4
--- /dev/null
+++ b/packages/services/src/monitor/list-response-logs.ts
@@ -0,0 +1,96 @@
+import { db as defaultDb } from "@openstatus/db";
+
+import { type ServiceContext, defaultTb } from "../context";
+import { ForbiddenError, ValidationError } from "../errors";
+import { getMonitorInWorkspace } from "./internal";
+import { ListResponseLogsInput } from "./schemas";
+
+export type ResponseLogListItem = {
+ id: string | null;
+ monitorId: string;
+ region: string;
+ requestStatus: "success" | "error" | "degraded" | null;
+ trigger: "cron" | "api" | null;
+ statusCode: number | null;
+ latency: number;
+ cronTimestamp: number;
+ timestamp: number;
+ timing: {
+ dns: number;
+ connect: number;
+ tls: number;
+ ttfb: number;
+ transfer: number;
+ } | null;
+};
+
+export type ListResponseLogsResult = {
+ logs: ResponseLogListItem[];
+ limit: number;
+ offset: number;
+ hasMore: boolean;
+ nextOffset?: number;
+};
+
+export async function listResponseLogs(args: {
+ ctx: ServiceContext;
+ input: ListResponseLogsInput;
+}): Promise<ListResponseLogsResult> {
+ const { ctx } = args;
+ const input = ListResponseLogsInput.parse(args.input);
+ if (!ctx.workspace.limits["response-logs"]) {
+ throw new ForbiddenError("Response logs are not enabled on this plan.");
+ }
+ const db = ctx.db ?? defaultDb;
+
+ const record = await getMonitorInWorkspace({
+ tx: db,
+ id: input.monitorId,
+ workspaceId: ctx.workspace.id,
+ });
+ if (record.jobType !== "http") {
+ throw new ValidationError(
+ `listResponseLogs only supports HTTP monitors (got '${record.jobType}').`,
+ );
+ }
+
+ // Fetch one extra row so the response can report whether another page exists.
+ const result = await (ctx.tb ?? defaultTb).httpListBiweekly({
+ monitorId: String(record.id),
+ fromDate: input.fromTimestamp,
+ toDate: input.toTimestamp,
+ limit: input.limit + 1,
+ offset: input.offset,
+ });
+ const hasMore = result.data.length > input.limit;
+ const logs: ResponseLogListItem[] = result.data
+ .slice(0, input.limit)
+ .map((log) => ({
+ id: log.id ?? null,
+ monitorId: log.monitorId,
+ region: log.region,
+ requestStatus: log.requestStatus ?? null,
+ trigger: log.trigger ?? null,
+ statusCode: log.statusCode ?? null,
+ latency: log.latency,
+ cronTimestamp: log.cronTimestamp,
+ timestamp: log.timestamp,
+ timing: log.timing
+ ? {
+ dns: log.timing.dns,
+ connect: log.timing.connect,
+ tls: log.timing.tls,
+ ttfb: log.timing.ttfb,
+ transfer: log.timing.transfer,
+ }
+ : null,
+ }));
+
+ return {
+ logs,
+ limit: input.limit,
+ offset: input.offset,
+ hasMore,
+ nextOffset: hasMore ? input.offset + input.limit : undefined,
+ };
+}
diff --git a/packages/services/src/monitor/response-logs-internal.ts b/packages/services/src/monitor/response-logs-internal.ts
new file mode 100644
index 000000000..df6e37d56
--- /dev/null
+++ b/packages/services/src/monitor/response-logs-internal.ts
@@ -0,0 +1,40 @@
+const REDACTED = "[redacted]";
+
+const SENSITIVE_HEADER_NAMES = new Set([
+ "authorization",
+ "cookie",
+ "set-cookie",
+ "proxy-authorization",
+ "x-api-key",
+ "x-auth-token",
+]);
+
+const SENSITIVE_HEADER_PARTS = [
+ "auth",
+ "cookie",
+ "credential",
+ "key",
+ "secret",
+ "session",
+ "token",
+];
+
+function isSensitiveHeader(name: string) {
+ const normalized = name.toLowerCase();
+ return (
+ SENSITIVE_HEADER_NAMES.has(normalized) ||
+ SENSITIVE_HEADER_PARTS.some((part) => normalized.includes(part))
+ );
+}
+
+export function redactSensitiveHeaders(
+ headers: Record<string, string> | null,
+): Record<string, string> {
+ if (!headers) return {};
+ return Object.fromEntries(
+ Object.entries(headers).map(([name, value]) => [
+ name,
+ isSensitiveHeader(name) ? REDACTED : value,
+ ]),
+ );
+}
diff --git a/packages/services/src/monitor/schemas.ts b/packages/services/src/monitor/schemas.ts
index 7fb76d394..c6ac70d77 100644
--- a/packages/services/src/monitor/schemas.ts
+++ b/packages/services/src/monitor/schemas.ts
@@ -148,3 +148,33 @@ export const ListMonitorsInput = z.object({
order: z.enum(["asc", "desc"]).default("desc"),
});
export type ListMonitorsInput = z.infer<typeof ListMonitorsInput>;
+
+export const monitorTimeRange = ["1d", "7d", "14d"] as const;
+export type MonitorTimeRange = (typeof monitorTimeRange)[number];
+
+export const GetMonitorStatusInput = z.object({
+ monitorId: z.number().int(),
+});
+export type GetMonitorStatusInput = z.infer<typeof GetMonitorStatusInput>;
+
+export const GetMonitorSummaryInput = z.object({
+ monitorId: z.number().int(),
+ timeRange: z.enum(monitorTimeRange).default("1d"),
+ regions: z.array(z.string()).optional(),
+});
+export type GetMonitorSummaryInput = z.infer<typeof GetMonitorSummaryInput>;
+
+export const ListResponseLogsInput = z.object({
+ monitorId: z.number().int(),
+ fromTimestamp: z.number().int().optional(),
+ toTimestamp: z.number().int().optional(),
+ limit: z.number().int().min(1).max(100).default(25),
+ offset: z.number().int().min(0).default(0),
+});
+export type ListResponseLogsInput = z.infer<typeof ListResponseLogsInput>;
+
+export const GetResponseLogInput = z.object({
+ monitorId: z.number().int(),
+ logId: z.string().min(1),
+});
+export type GetResponseLogInput = z.infer<typeof GetResponseLogInput>;
diff --git a/packages/tinybird/src/client.ts b/packages/tinybird/src/client.ts
index 3aedfee16..b53df0b8c 100644
--- a/packages/tinybird/src/client.ts
+++ b/packages/tinybird/src/client.ts
@@ -17,15 +17,16 @@ export class OSTinybird {
constructor(token: string) {
const tinybirdUrl = process.env.TINYBIRD_URL;
+ // Empty token → noop unconditionally; pipes resolve empty rather than
+ // failing authn. Dev/test without a TINYBIRD_URL also gets a noop.
if (
- (process.env.NODE_ENV === "development" ||
+ !token ||
+ ((process.env.NODE_ENV === "development" ||
process.env.NODE_ENV === "test") &&
- !tinybirdUrl
+ !tinybirdUrl)
) {
this.tb = new NoopTinybird();
} else {
- // Use local Tinybird container if available (Docker/self-hosted)
- // https://www.tinybird.co/docs/api-reference
this.tb = new Client({
token,
baseUrl: tinybirdUrl || "https://api.tinybird.co",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index a2cb45a57..717151c70 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -76,7 +76,7 @@ importers:
version: 0.15.15
'@openpanel/nextjs':
specifier: 1.2.0
'@openstatus/analytics':
specifier: workspace:*
version: link:../../packages/analytics
@@ -193,7 +193,7 @@ importers:
'@sentry/nextjs':
specifier: 10.31.0
'@stripe/stripe-js':
specifier: 2.1.6
version: 2.1.6
@@ -208,7 +208,7 @@ importers:
'@trpc/next':
specifier: 11.4.4
'@trpc/react-query':
specifier: 11.4.4
@@ -244,13 +244,13 @@ importers:
next-auth:
specifier: 5.0.0-beta.29
next-themes:
specifier: 0.4.6
nuqs:
specifier: 2.8.5
random-word-slugs:
specifier: 0.1.7
version: 0.1.7
@@ -647,7 +647,7 @@ importers:
version: 0.15.15
'@openpanel/nextjs':
specifier: 1.2.0
'@openstatus/analytics':
specifier: workspace:*
version: link:../../packages/analytics
@@ -692,7 +692,7 @@ importers:
'@sentry/nextjs':
specifier: 10.31.0
'@stripe/stripe-js':
specifier: 2.1.6
version: 2.1.6
@@ -707,7 +707,7 @@ importers:
'@trpc/next':
specifier: 11.4.4
'@trpc/react-query':
specifier: 11.4.4
@@ -743,19 +743,19 @@ importers:
next-auth:
specifier: 5.0.0-beta.29
next-intl:
specifier: ^4.8.3
next-plausible:
specifier: 3.12.5
next-themes:
specifier: 0.4.6
nuqs:
specifier: 2.8.5
react:
specifier: 19.2.3
version: 19.2.3
@@ -852,7 +852,7 @@ importers:
version: 0.15.15
'@openpanel/nextjs':
specifier: 1.2.0
'@openstatus/analytics':
specifier: workspace:*
version: link:../../packages/analytics
@@ -924,7 +924,7 @@ importers:
version: link:../../packages/utils
'@sentry/nextjs':
specifier: 10.31.0
'@stripe/stripe-js':
specifier: 2.1.6
version: 2.1.6
@@ -951,7 +951,7 @@ importers:
'@trpc/next':
specifier: 11.4.4
'@trpc/react-query':
specifier: 11.4.4
@@ -1002,19 +1002,19 @@ importers:
next-auth:
specifier: 5.0.0-beta.29
next-mdx-remote:
specifier: 6.0.0
version: 6.0.0(@types/[email protected])([email protected])
next-plausible:
specifier: 3.12.5
next-themes:
specifier: 0.4.6
nuqs:
specifier: 2.8.5
random-word-slugs:
specifier: 0.1.7
version: 0.1.7
@@ -1449,7 +1449,7 @@ importers:
version: 0.31.4
next-auth:
specifier: 5.0.0-beta.29
typescript:
specifier: 5.9.3
version: 5.9.3
@@ -2096,6 +2096,9 @@ importers:
'@openstatus/theme-store':
specifier: workspace:*
version: link:../theme-store
+ '@openstatus/tinybird':
+ specifier: workspace:*
+ version: link:../tinybird
'@openstatus/utils':
specifier: workspace:*
version: link:../utils
@@ -15006,7 +15009,7 @@ snapshots:
'@openpanel/web': 1.0.1
dependencies:
'@openpanel/web': 1.1.0
@@ -17343,7 +17346,7 @@ snapshots:
'@sentry/types': 8.9.2
'@sentry/utils': 8.9.2
dependencies:
'@opentelemetry/api': 1.9.0
'@opentelemetry/semantic-conventions': 1.38.0
@@ -18123,7 +18126,7 @@ snapshots:
'@trpc/server': 11.4.4([email protected])
typescript: 5.9.3
dependencies:
'@trpc/server': 11.4.4([email protected])
@@ -21792,7 +21795,7 @@ snapshots:
dependencies:
'@auth/core': 0.40.0
@@ -21831,7 +21834,7 @@ snapshots:
- '@types/react'
- supports-color
dependencies:
react: 19.2.3
@@ -21953,7 +21956,7 @@ snapshots:
dependencies:
boolbase: 1.0.0
dependencies:
'@standard-schema/spec': 1.0.0
react: 19.2.3