Definitions
Dashboards
defineDashboard lays out widgets from SQL on a 12-column grid.
definitions/dashboards/acme.ts
import { defineDashboard } from 'vigie/sdk'
export const shop = defineDashboard({
id: 'shop',
title: 'Shop overview',
widgets: [
{ type: 'stat', title: 'Orders today', span: 3, sql: `SELECT count() AS v FROM logs WHERE $__timeFilter(Timestamp) AND Environment = $__env AND Route = '/orders/:id/checkout' AND Status < 400` },
{ type: 'lines', title: 'Checkout p95', span: 9, unit: 'ms', sql: `SELECT $__bucket(Timestamp) AS t, quantile(0.95)(DurationMs) AS p95 FROM logs WHERE $__timeFilter(Timestamp) AND Environment = $__env AND Route = '/orders/:id/checkout' GROUP BY t ORDER BY t` },
],
})
Widget types: stat, series, bars, lines, table, list, events, pie, sparkline. Each takes title, sql, and optionally span (out of 12), height, unit, format (number, ms, percent), tone and legend.
Dashboards made in the app can be edited there, or by an agent over MCP. Dashboards in code are read-only in the app: change the file.