Skip to main content
Use dashboards as code when you want a repeatable, reviewable way to create metric dashboards from scripts, repos, or agent workflows. The same definition shape works across:

Dashboard workflow

The dashboard library is for saved views with one clear operating purpose. Start from a focused template or a blank dashboard. A dashboard opens in view mode; select Edit dashboard before you rename it, add or duplicate widgets, or move and resize the grid. The time range plus supported environment and service filters apply to all widgets and stay in the URL. Relative ranges can auto-refresh. Absolute from and to ranges keep a fixed evidence window and disable auto-refresh. Use Share only when live widget data can be visible to anyone with the link; disabling sharing revokes that link. From the dashboard library, Use with agent provides Prompt, CLI, REST API, MCP, and JSON views of one versioned handoff. The dashboard handoff is read-only: it lists the supported definition read and snapshot operations, copies no credentials or raw widget telemetry, and asks the agent to propose a change instead of applying one.

Definition format

Dashboard definitions are versioned JSON manifests.

Valid widget query sources

Every widget’s query.source field must be one of: traces is the right choice when the underlying service already records the span (via the Squasher edge SDK or any OTLP client) and you don’t want to also emit a duplicate duration metric. Span attributes are queryable via group_by and filters (service, status, or any custom span attribute name).

API

Apply a definition in one request:
Example request body:
If you want to update an existing dashboard instead of creating a new one, include dashboard_id beside definition.

CLI

List dashboards:
List templates:
Create from a template:
Execute a dashboard query directly:
Use --from and --to for absolute query windows:
Filter log/error dashboard queries with search syntax:
Apply a definition from a file:
To update an existing dashboard in place:

MCP

The hosted MCP server exposes the same workflows through Code Mode. Agents should call search for the operation they need, then execute the generated squasher.request(...) example. Useful searches:
  • search("dashboards.list")
  • search("dashboards.listTemplates")
  • search("dashboards.executeQuery")
  • search("dashboards.inspectQuery")
  • search("dashboards.apply")
Example prompt:

Agent handoff

Use this prompt when asking an agent to create or update dashboards:
The manifest format also powers Squasher’s built-in operational dashboard templates, so the same apply surface works for custom dashboards instead of a UI-only flow.