Dashboards
Build dashboards from saved queries, share them, and refresh them on a schedule.
On this page
A dashboard is a grid of tiles. Each tile is a saved query with a visualisation. Dashboards are versioned, so you can see who changed what and roll back.
Queries
Queries can be built in the visual editor or written in SQL. Every module's events are available as tables named after their module, plus an events view across all of them.
SELECT
date_trunc('day', b.at) AS day,
b.data->>'site' AS site,
percentile_cont(0.5) WITHIN GROUP (ORDER BY c.at - b.at) AS median_time_to_close
FROM robotics.events b
JOIN events c
ON c.type = 'workorder.closed'
AND b.entity = ANY(c.links)
WHERE b.type = 'telemetry.threshold_breached'
AND b.at > now() - interval '30 days'
GROUP BY 1, 2
ORDER BY 1;
SQL is read-only and runs with the row-level security of the person viewing the dashboard.
Visualisations
Tiles can be a number with delta, a line or area chart, a bar chart, a table, a funnel or a cohort grid. Charts use the same colours across every dashboard: amber for the primary series, neutrals for comparisons, and green and red only for gains and losses.
Sharing
Share a dashboard with members of the workspace or with a signed link that expires. Signed links render a read-only view with no access to the underlying queries. Embedding in your own app uses the same signed links with ?embed=1.
Refresh
Tiles refresh when opened, using cached results if they are newer than five minutes. Schedule a refresh to keep a dashboard warm and to send it as a PDF by email:
await cl.analytics.dashboards.schedule('dash_fleet_health', {
cron: '0 7 * * 1-5',
timezone: 'Europe/Berlin',
email: ['ops-leads@northwind.example'],
});
Alerts
Any number tile can have an alert: when its value crosses a threshold, an analytics.alert_fired event is emitted. Agents can be triggered by it like any other event.