Skip to content

Dashboard JSON schema

A dashboard is a single JSON document. It is what osuite dashboard pull writes to disk and what osuite dashboard apply sends back to the platform (see dashboards as code). This page documents every field.

A file is recognized as a dashboard only if it has a top-level name. The platform assigns id and created_at — you never set them by hand.

FieldTypeRequiredNotes
namestringyesThe dashboard name.
idintegernoAssigned by the platform. Omit on a new dashboard; never change it on an existing one.
descriptionstringnoFree-text description.
tagsstring[]noLabels for organizing dashboards. Defaults to [].
publishedbooleannoWhether the dashboard is published. Defaults to false.
created_atstring (date-time)noSet by the platform.
widgetsWidget[]noThe panels. Defaults to [].
variablesVariable[]noTemplate variables. Defaults to [].

A widget is one panel. Widgets are placed on a 24-column grid.

FieldTypeRequiredNotes
idstringyesStable identifier for the widget. Never change it on an existing widget.
chart_typestring (enum)yesOne of the chart types below.
titlestringyesPanel heading.
descriptionstringnoOptional panel description.
pos_xintegeryesColumn offset on the grid (0–23).
pos_yintegeryesRow offset on the grid.
widthintegeryesColumn span, 124 (12 = half width, 24 = full width).
heightintegeryesRow span; a positive integer, typically 6–12.
queriesNamedQuery[]yesOne or more PromQL queries backing the panel.
configobjectnoFormatting config. Defaults to {}. See config.

chart_type is a fixed enum. Any other value is rejected locally by osuite dashboard plan and apply before anything is sent.

line, area, stacked-area, bar, stacked-bar, scatter, pie, bar-gauge, gauge, stats, table, service-graph.

See the dashboards overview for what each one is used for.

config holds panel formatting. Set the display unit with {"type": "<unit>"}, where <unit> is one of:

number, percentage, bytes, bytes_per_second, duration_ms.

Pick the unit that matches the metric — bytes for memory, duration_ms for latency, percentage for a utilization ratio.

FieldTypeRequiredNotes
namestringyesQuery name. Queries within a widget are named sequentially: A, B, C, …
querystringyesThe PromQL query.
legendstringnoLegend template for the series, for example {{status_code}}.

A template variable is referenced in queries as $name (see template variables).

FieldTypeRequiredNotes
idstringyesStable identifier for the variable.
namestringyesReferenced in queries as $name.
orderintegeryesPosition among the selectors.
var_typestringnoVariable type.
display_labelstringnoLabel shown in the selector control; queries still use name.
multibooleannoAllow selecting multiple values. Defaults to false.
query_typestring (enum)noSource of the values: label_name, label_value, or metrics.
label_namestringnoThe label to read values from, when query_type is label_value.
metricstringnoThe metric to scope the values to.
custom_key_valuesarray of objectsnoA fixed value list; each entry is a { "<key>": "<value>" } map. Defaults to [].

osuite dashboard plan and apply validate each file locally before contacting the platform. A file fails if any widget:

  • is missing chart_type, or has a chart_type outside the enum,
  • is missing id or title (must be strings),
  • is missing pos_x, pos_y, width, or height (must be numbers),
  • is missing the queries array, or
  • has a width outside the 1–24 range.
{
"name": "Payments service",
"description": "Golden signals for the payments service",
"tags": ["apm", "payments"],
"published": true,
"variables": [
{
"id": "var-service",
"name": "service",
"order": 0,
"display_label": "Service",
"multi": false,
"query_type": "label_value",
"label_name": "service"
}
],
"widgets": [
{
"id": "request-rate",
"chart_type": "line",
"title": "Request rate",
"description": "Requests per second by status code",
"pos_x": 0,
"pos_y": 0,
"width": 12,
"height": 8,
"queries": [
{
"name": "A",
"query": "sum(rate(http_requests_total{service=\"$service\"}[5m])) by (status_code)",
"legend": "{{status_code}}"
}
],
"config": { "type": "number" }
},
{
"id": "p99-latency",
"chart_type": "line",
"title": "p99 latency",
"pos_x": 12,
"pos_y": 0,
"width": 12,
"height": 8,
"queries": [
{
"name": "A",
"query": "histogram_quantile(0.99, sum(rate(http_request_duration_seconds_bucket{service=\"$service\"}[5m])) by (le))"
}
],
"config": { "type": "duration_ms" }
}
]
}