Save Dashboard
save_dashboardCreate or update an analytics dashboard by name, with customizable panels for charts and tables, using automatic layout sizing and time range selection.
Instructions
Create or update an analytics dashboard by name (upsert).
If a dashboard with this name already exists it is updated; otherwise a
new one is created.
Size each panel with a named ``size`` from the catalog below (PREFERRED
— guarantees a legible layout) and omit positions entirely: panels are
auto-placed in the order given (left-to-right, top-to-bottom on a
12-column grid, wrapping rows, never overlapping).
Size catalog and when to use each:
- ``small-square`` (3x6): single ``stat`` metrics.
- ``half-rectangle`` (6x6): ``line``/``bar``/``area`` trends, two per row.
- ``half-square`` (6x9): ``radar``, ``composed``, denser charts.
- ``full-rectangle`` (12x9): wide time-series comparisons.
- ``full-square`` (12x12): ``table`` panels.
Args:
name: Dashboard name — the upsert key.
panels: Optional list of panel definitions. Each panel is an object:
- ``title`` (str, required): panel heading.
- ``chart_type`` (str, required): one of ``line``, ``bar``,
``composed``, ``area``, ``radar``, ``stat``, ``table``.
- ``query`` (object, required): what to chart —
``{"cube": "check_trend", "measures": [...],
"dimensions": [...], "filters": [...],
"time_dimensions": [...], "order": {...}}``. ``measures`` is
required; everything else is optional. ``cube`` defaults to
``check_trend``. The dashboard ``time_range`` applies to all
panels — panels do NOT carry their own time range.
- ``size`` (str): a catalog name (see above). Required unless
``layout`` is given; wins over ``layout`` w/h if both appear.
- ``layout`` (object): raw grid placement
``{"x": >=0, "y": >=0, "w": >=1, "h": >=1}`` (integers).
Only needed when not using ``size``, or to pin an explicit
position (give both ``x`` and ``y``; with ``size``, w/h are
ignored). Heights below the legibility floor are sized up on
save: ``h >= 6`` when ``w <= 6``, ``h >= 9`` when ``w > 6``.
- ``table_config`` (object, optional): ONLY for
``chart_type == "table"``.
``check_trend`` measures: ``avg_check_value``, ``issue_rate``,
``error_rate``, ``datapoint_count``, ``issue_count``,
``error_count``, ``test_run_count``, ``avg_latency``,
``sum_cost``, ``input_token_count``, ``output_token_count``.
``check_trend`` dimensions: ``check.name``, ``check.id``,
``target.name``, ``target.id``, ``scenario.name``,
``scenario.id``, ``test_run.id``, ``test_run.type``,
``test_run.is_latest_for_target``, ``source``, ``provider``,
``request_model_name``, ``response_model_name``, ``tag``.
Use ``query_analytics(include_metadata=True)`` for the
authoritative, current set.
Example panel::
{"title": "Avg Check Value by Check", "chart_type": "bar",
"query": {"measures": ["avg_check_value"],
"dimensions": ["check.name"]},
"size": "half-rectangle"}
description: Optional dashboard description.
time_range: Optional default look-back window for the whole
dashboard. One of: LAST_HOUR, LAST_24_HOURS, LAST_7_DAYS,
LAST_14_DAYS, LAST_30_DAYS, LAST_90_DAYS. Defaults to
LAST_90_DAYS when omitted.
Returns:
JSON with the saved dashboard and ``action`` (created/updated).
When sizing or dimensions were changed on save (size overriding
layout w/h, or a height floored), an ``adjustments`` list reports
each change: ``{"panel", "field", "from", "to", "reason"}``.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| panels | No | ||
| time_range | No | ||
| description | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |