skillZs
★ LIVE SKILL TAGS ★
>>> LIVE SKILLS INDEX <<<
* OPEN SOURCE *
NO LOGIN, NO TRACKING
※ REAL INSTALL DATA ※
← back to all skills
kubesense-ai/kubesense-mcp-skills151 installs

kubesense-dashboards

Create and edit KubeSense dashboards over metrics, logs, traces, real user monitoring (RUM) and infrastructure host maps — directly with the create-dashboard and update-dashboard MCP tools, or as preset JSON the user imports — with the exact schema, the fields that hard-fail import, and the fields that silently discard your data instead of erroring. Includes validate-dashboard-json for checking a preset before you commit to it.

How do I install this agent skill?

npx skills add https://github.com/kubesense-ai/kubesense-mcp-skills --skill kubesense-dashboards
view source ↗

Is this agent skill safe to install?

  • Gen Agent Trust Hubpass

    The skill provides comprehensive instructions for creating and validating KubeSense dashboard JSON presets using MCP tools. It focuses on technical schema requirements and best practices for telemetry data discovery. No malicious code, prompt injection, or data exfiltration patterns were detected.

  • Socketpass

    No alerts

  • Snykpass

    Risk: LOW · No issues

What does this agent skill do?

KubeSense Dashboards

Build a dashboard preset — the same shape the Export button produces, so an exported dashboard can be edited and re-imported.

Two ways to deliver it:

create-dashboard MCP toolPreset JSON
Applied bythe agent (write tool, needs approval)the user, via Dashboards → Import
Use whenthe user asked you to create onethey asked for the JSON, or want to review first
Shape to emitthe preset object itselfthe import envelope, with preset stringified

Both go through the same server-side schema check, so a preset that passes validate-dashboard-json is one that both paths accept.

When to Use

  • "Create a dashboard for…" / "Build a dashboard with panels for…" → create-dashboard
  • "Give me the dashboard JSON for…" → preset JSON
  • "Generate a dashboard preset" → preset JSON
  • "What does the X panel show" / "show me the X panel on the Y dashboard" → list-dashboards for the id, then run-dashboard-panel with the panel's name. It runs the saved queries with the dashboard's variables and the panel's time frame applied.
  • "Change / fix / add a panel to the X dashboard" → get-dashboard-details, then update-dashboard — see Editing an existing dashboard

Always Validate Before You Finish

Call validate-dashboard-json on the preset before creating it or handing it over. It stores nothing, so call it as often as you need.

# valid=false findings=2
path                              rule   message
/panels/0/queries/0/selectedMode  shape  value must be one of 'logs', 'metrics', 'traces', 'events', 'rum', 'formula'
/gridLayout/0                     shape  must have required property 'h'

Each path is a JSON Pointer to the exact value to fix. Repeat until valid=true.

Pass the preset object as document — not the import envelope with the stringified preset field. Same for create-dashboard's preset argument.

Validation checks shape, not whether the data exists. A query against a metric nobody collects is well-formed and will render empty, so discover names first.

Discover Fields First

If the KubeSense MCP server is connected, discover real names before writing queries — never guess a metric, group-by, or filter field.

To findTool
Metric namesget-available-metrics
Metric labels (for by)get-metric-labels
Log, trace, event or RUM fieldsget-fields with signal (rum_view, … for RUM)

Dashboard queries use storage-level field names, not the MCP catalog labels — the webapp posts these directly. Take field names from the discovery output's storage column where they differ, and tell the user to confirm on the panel preview. See kubesense-mcp for the label/storage distinction.

Without MCP, fall back to user-provided names and say they need verifying.

Output Format

{
  "name": "<dashboard name>",
  "description": "",
  "preset": "<stringified JSON of the preset object>"
}

[!IMPORTANT] In this envelope, preset is a JSON string, not a nested object. The validator declares preset: z.string() and only runs the preset schema after JSON.parse(preset). Emitting an object fails with "Preset must be a valid JSON string that matches the dashboard preset schema".

This applies to the import envelope only. create-dashboard and validate-dashboard-json take the preset object itself — passing a stringified blob to them works too, but do not wrap it in this envelope.

name is required and non-empty. description is optional.

The object you stringify:

{
  "gridLayout": [],
  "panels": [],
  "variables": [],
  "subGrids": [],
  "subGridLayout": []
}

Only gridLayout and panels are required; the rest default to []. Three more optional keys validate: publicDashboardPath (string), eventOverlays (see Event Overlays) and tabs (see Tabs).

Minimal Valid Dashboard

Verified against the live validator:

{
  "name": "Minimal",
  "description": "",
  "preset": "{\"gridLayout\":[{\"i\":\"0\",\"x\":0,\"y\":0,\"w\":12,\"h\":4}],\"panels\":[{\"name\":\"Up\",\"panelType\":\"timeSeries\",\"queries\":[{\"selectedMode\":\"metrics\",\"label\":\"A\",\"selectedMetric\":\"up\",\"functions\":[]}],\"config\":{}}],\"variables\":[],\"subGrids\":[],\"subGridLayout\":[]}"
}

What Hard-Fails Import

Get these wrong and import is rejected with an error:

  1. preset not a string.
  2. Missing or empty top-level name.
  3. Missing gridLayout or panels.
  4. A gridLayout item missing any of i, x, y, w, h, or with a wrong type ("6" instead of 6).
  5. A panel with no queries (queries missing or []) is refused by validate-dashboard-json, create-dashboard and update-dashboard (rule panel_has_queries) — it would open on an empty query builder and "No data". A dashboard with no panels at all is fine.
  6. A panel missing name. (An empty name: "" is accepted — the editor allows it and stored dashboards carry it — but a nameless panel is unusable, so always set one.)
  7. A panel missing the queries key entirely (an empty array parses, but is refused by the rule in item 5).
  8. A query whose selectedMode is not metrics | logs | traces | events | rum | formula | infrastructure. A RUM signal name from the MCP tools (rum_view) is not a selectedMode here; see RUM query.
  9. A logs/traces/events/rum query missing columnFields — the single hard-required field on those queries. A rum query also needs rumEventType.
  10. A columnFields[] entry with field: "".
  11. A formula missing expression, or one containing lowercase letters or a decimal point.
  12. A formula referencing an undefined label, referencing itself, placed before the queries it references, or with a multi-character label.
  13. A host map whose levels break host > pod > container, use a signal their entity lacks, size an outer level, group by something the first level does not carry, or filter on a field host maps cannot narrow by (rules infrastructure_* and host_map_query) — see references/host-map.md.
  14. A tabs[].id that does not match ^[a-z0-9][a-z0-9-]{0,39}$, or that repeats another tab's id.
  15. A tabs[].title that is empty after trimming, longer than 50 characters, or equal to another tab's title compared case-insensitively after trimming.
  16. A non-empty tabs array alongside a non-empty top-level panels, gridLayout, subGrids or subGridLayout. A tabbed dashboard keeps those four empty.
  17. Two sub-grids with the same id anywhere in the dashboard, across all tabs.
  18. A tab whose gridLayout has a different number of entries than its panels (rule tab_grid_layout). Unlike the top level, a tab's layout must match exactly.

What Silently Destroys Your Data

More dangerous than hard failures — these validate cleanly and then discard what you sent. Almost every field carries a .catch(), so a single bad value resets its whole array or object to the default.

FieldOn a bad value
functions (metrics query)The entire array is wiped to [] — one malformed entry loses every function
variablesAll variables deleted — one invalid variable empties the array
subGridsAll sub-grids dropped
subGrids[].panelsThat row's panels emptied
aggregationResets to {"function": "row_count"}
panelTypeResets to "timeSeries"
chart_typeResets to "table"
yAxisLabelFormatterResets to "auto"
colorSchemeResets to {"type":"palette","palette":"default"}
stepNon-integer (e.g. 60.5) resets to "auto"
paginationpage_size > 500 resets the whole object to {page:1,page_size:50}

Because of this, prefer omitting an optional field over guessing its value — an omitted field takes the default; a wrong one can take out its siblings.

[!WARNING] gridLayout must have at least as many entries as panels. Panels and layout are matched positionally by array index, not by the i value. A short top-level gridLayout throws a TypeError when the dashboard renders. validate-dashboard-json and create-dashboard refuse it (rule grid_layout_covers_panels); a server built before that rule accepts it, so still check the count. Sub-grid layouts may be shorter. The i string is only used to identify sub-grid rows (via a sg- prefix); real exports set it to the index ("0", "1", …).

Panel

{
  "name": "CPU by namespace",
  "description": "",
  "panelType": "timeSeries",
  "queries": [],
  "config": {}
}

panelType — 13 values: timeSeries, stat, table, list, bar, pie, topList, treemap, alert, spl, sql, slo, hostMap. Note camelCase timeSeries.

config can never fail import (the whole object catches), so {} is always safe and inherits every default. For the full field list, defaults, and the colorScheme / thresholds / alignColumns / columnFormatting / visualFormattingRules shapes, read references/panel-config.md.

For a table panel, per-column display names, visibility, cell type (number / bar), and threshold/range colouring go in config.columnFormatting[] — see the reference.

For a top-list panel, config.topListDisplayMode is flat (default) or stacked, and stacked needs two or more groupBy entries — the first is the row, the rest are the blocks stacked inside it. With one dimension the renderer draws flat whatever the field says. Value-driven colouring goes in config.visualFormattingRules[], which supersedes thresholds for this panel type. Both are in the reference.

For a treemap panel, give the query a groupBy and leave config alone — it has no config of its own beyond colorScheme and the unit, and it draws one cell per returned series, sized by value and coloured categorically from the panel palette. It is an instant panel like pie/topList, so config.step does not apply. Its chart_type is topList (see below), since the query-level enum has no treemap arm. Every series comes back, so cap the result with the query's own limit rather than expecting the panel to trim it.

For an alert panel, the query names a rule and the widget to draw it as: widgetType is graph, value or summary. graph and value need a ruleId (and cache the rule's name in ruleName); graph also takes vizType, timeseries (default) or topList, which draws the rule's own query ranked by each series' last value. value prints that rule's current figure alone — for a rule firing on several series it is the one furthest past the threshold, highest for a greater_than rule and lowest for a less_than one. summary reads filters instead, plus displayFormat (count/list/both), colorPreference (text/background) and summaryType (monitor/group/combined). summaryType decides what one row is: monitor one per rule, group one per firing instance (a rule grouped by pod gets a row per breaching pod), combined one per rule with its firing instances counted beside it. Unlike Datadog's equivalent, group cannot list healthy groups — the engine materialises an instance only while it is firing, so a series that never breached has no row to show. Like slo it is served by the alert endpoints, not /explore/query, so config.step does not apply and its chart_type is topList. Datadog's fourth widget, Check Status, has no arm: the engine persists only normal and firing, so a four-state widget would have nothing to put in two of its cells.

For a host map panel (hostMap), hosts are tiles with their pods and containers nested inside, each coloured by a signal such as CPU utilization or readiness. It takes exactly one infrastructure query and no PromQL; the server compiles it for Kubernetes and legacy hosts alike. Colours go in config.hostMapColors, keyed by entity. Levels, signals, grouping, filters and colours are in references/host-map.md.

A panel follows the dashboard's time picker unless config.timeFrame gives it its own relative window: last_5m … last_30d, week_to_date, month_to_date, previous_week, previous_month (weeks Monday to Sunday, in the viewer's timezone). Use it only where the period is the point, such as a month-to-date cost stat beside hourly charts, and omit it everywhere else. Keys and exact boundaries are in references/panel-config.md.

Three config fields the old format got wrong:

  • thresholdDisplayMode, not enableThresholds. Values: off (default), lines, lines_dashed, filled_regions, filled_regions_and_lines, filled_regions_and_lines_dashed.
  • colorScheme, not colorPalette. A 5-variant union; the palette variant is {"type":"palette","palette":"default"} and the only palette keys are default, success, warning, error. To pin one query's colour regardless of the panel scheme, use the query's own fieldConfig.color (see Per-query color).
  • mergeTables is z.literal(true) and lives in the defaults — it is always true and cannot be disabled. Sending false silently becomes true. Just omit it.

Y-axis units

yAxisLabelFormatter accepts 199 values — the same enum as fieldConfig.unit. Common ones: auto, number, percentage, bytes, bytes/sec, nanoseconds, milliseconds, seconds, mCPU, CPU. Use nanoseconds for any panel aggregating trace duration — the formatter auto-scales ns → µs/ms/s. Full list in references/panel-config.md.

[!WARNING] percent, percent_unit, short, ops, bps, celsius, fahrenheit, and none do not exist and silently become auto. Use percentage, CPU / mCPU, bytes/sec, number instead.

Queries

Discriminated on selectedMode: metrics | logs | traces | events | rum | formula | infrastructure (host maps only, see references/host-map.md). Note spl is not a valid selectedMode — use panelType: "spl" with a logs/traces query and filterMode: "SPL".

Metrics query

{
  "selectedMode": "metrics",
  "label": "A",
  "selectedMetric": "container_cpu_usage_seconds_total",
  "functions": [],
  "filters": {},
  "queryMode": "builder",
  "promql": "",
  "visible": true,
  "labelOptions": { "type": "auto" },
  "pagination": { "page": 1, "page_size": 50 },
  "fieldConfig": {}
}

Every field is optional. queryMode is builder or code — use code with promql set, builder with selectedMetric + functions.

A builder query can also shift its series selector with selectorModifiers: {"offset": "1h"}, {"at": "end()"} (start(), end() or a unix timestamp), or both. The Explorer renders them where the selector is used, e.g. rate(m{…}[5m] offset 1h).

variables is auto-derived from filters and promql ($name references) — anything you supply is overwritten. Don't bother setting it.

Logs / traces query

{
  "selectedMode": "logs",
  "label": "A",
  "columnFields": [],
  "filters": {},
  "queryMode": "builder",
  "filterMode": "MFD",
  "aggregation": { "function": "row_count" },
  "groupBy": [],
  "chart_type": "table",
  "visible": true,
  "sorting": {
    "sortBy": { "field": "", "type": "string", "is_attribute": false },
    "sortOrder": "ASC"
  },
  "query": "",
  "pagination": { "page": 1, "page_size": 50 },
  "fieldConfig": {}
}

[!IMPORTANT] columnFields is required — include it on every logs/traces query, even as []. Omitting it is a hard import failure. Entry shape: {"field": "namespace", "type": "string", "is_attribute": false} with optional alias and label. field must be non-empty.

  • chart_type — 7 values: table, stat, bar, pie, topList, timeseries, list. Lowercase timeseries — timeSeries silently becomes table. This is a query-level field, separate from the panel-level panelType. There is deliberately no treemap arm: the panel is not offered for SPL/SQL, so a treemap panel sets chart_type to topList the way a stat panel sets table.
  • filterMode — MFD, ADVANCED_QUERY, SPL, SQL. Use ADVANCED_QUERY for anything MFD's equality-only filters can't express (e.g. a latency threshold). See Filtering a logs / traces / events / rum query below: the WHERE clause goes in filters.advanced_query, never in query.
  • groupBy entries use the same shape as columnFields.
  • list (array) and value (string) are the SPL/SQL column fields. There is no topListLabel/topListValue.

aggregation is strict about type:

{ "function": "p99", "fields": [ { "field": "duration", "type": "float", "is_attribute": false } ] }
  • row_count — no fields.
  • unique_count — fields required, type is "float" or "string".
  • avg, sum, max, min, p99, p95, p90, p75, p50 — fields required and type must be literally "float".

Get any of that wrong — missing fields, type: "string" on a numeric aggregation, or function: "count" (not a valid name) — and the whole aggregation silently resets to row_count, giving you a row count where you asked for a percentile.

Filtering a logs / traces / events / rum query

A WHERE clause is stored in the filter store, not in query:

{
  "selectedMode": "traces",
  "label": "A",
  "columnFields": [],
  "filterMode": "ADVANCED_QUERY",
  "filters": { "advanced_query": ["service = checkout AND duration > 500"] },
  "aggregation": { "function": "row_count" }
}
  • filters.advanced_query is an array holding one WHERE string. filterMode: "ADVANCED_QUERY" makes the panel open in the Advanced editor.
  • The WHERE syntax is the one the search/analyze tools accept: =, !=, <, >, <=, >=, LIKE, ILIKE, IN (...), combined with AND, OR and a prefix NOT: exclude a list as NOT namespace IN (a, b), never namespace NOT IN (a, b). Field names are the catalog labels from get-fields (same signal); prefix an attribute with @ (@http.route = /api/orders).
  • query is only for SPL or SQL text (filterMode: "SPL" / "SQL"). A WHERE clause put in query is never run: the panel silently shows every row.
  • filterMode: "MFD" panels keep plain equality filters as filters: {"<field>": ["<value>", ...]}.

Events query

selectedMode: "events" reads custom events: GitHub pushes, pull requests, comments and reviews, CI runs and jobs, deployments, security alerts, and events customers push. Same shape as a logs query (so columnFields is required), with these differences:

  • filterMode is MFD or ADVANCED_QUERY. Events have no SPL or SQL.
  • Fields come from get-fields with signal: "events": timestamp, severity (info success warning error critical), type, title, message, repository, actor, status, category, source, service, environment, namespace, cluster, workload, pod, container, event_id. Anything else is an attribute: @vcs.ref.head.name, @cicd.pipeline.name, @vcs.actor.is_bot.
  • Array paths (@key[*]) are refused. url and timestamp cannot be filtered on; use the time range for time.
{
  "selectedMode": "events",
  "label": "A",
  "columnFields": [],
  "filterMode": "ADVANCED_QUERY",
  "filters": {
    "advanced_query": ["category = deployment AND severity IN (error, critical) AND environment = production"]
  },
  "aggregation": { "function": "row_count" },
  "groupBy": [{ "field": "repository", "type": "string", "is_attribute": false }]
}

RUM query

selectedMode: "rum" reads real user monitoring events from browser and mobile apps. The event type picks the table, so it is a second field, rumEventType: session | view | action | error | resource | long_task. Same shape as a logs query (so columnFields is required), with these differences:

  • rumEventType is required. A rum query without it fails validation and is refused on save. The webapp repairs a missing one to view, silently changing the table.
  • The stored form differs from the MCP form. analyze-telemetry takes the event type inside the mode (selectedMode: "rum_view"). A panel stores selectedMode: "rum" plus rumEventType: "view". To turn a tested analyze-telemetry query into a panel, split the mode and keep everything else.
  • filterMode is ADVANCED_QUERY. RUM has no SPL or SQL, and the panel editor has no mode toggle for it. The WHERE clause goes in filters.advanced_query.
  • Fields and rules come from kubesense-rum: get-fields with the matching signal, LIKE only on low-cardinality fields, array fields filter-only, no group-by on a raw duration, feature_flag.<key> group-by on view and error only.
  • Measure durations on the base field (lcp, duration), which is stored in nanoseconds. The _ms / _s twins (lcp_ms) are filter-only: use them in the WHERE clause, never as an aggregation field or group-by. Leave fieldConfig.unit unset: the chart detects a base duration and shows it as a readable duration. A fixed nanoseconds unit prints the raw count (12500000000.00ns).
  • Numeric aggregations (avg, sum, min, max, p50, p75, p90, p95, p99) need fields with type: "float", as on logs.
  • RUM is not offered on alert rules; see kubesense-alerts.
  • Recipes (exact unique users and p75 with a total stat, crash-free users, Web Vital good/poor shares, Apdex, top errors and URLs, ANR rate): kubesense-rum/references/dashboard-recipes.md.
{
  "selectedMode": "rum",
  "rumEventType": "view",
  "label": "A",
  "columnFields": [],
  "filterMode": "ADVANCED_QUERY",
  "filters": { "advanced_query": ["browser_name = Chrome AND env = production"] },
  "aggregation": {
    "function": "p90",
    "fields": [ { "field": "lcp", "type": "float", "is_attribute": false } ]
  },
  "groupBy": [ { "field": "view_name", "type": "string", "is_attribute": false } ]
}

Formula query

{ "selectedMode": "formula", "label": "C", "expression": "A/B", "visible": true, "fieldConfig": {} }

expression must match ^[A-Z0-9+/*()-]+$ after whitespace is stripped. Consequences:

  • Uppercase only — a+b fails.
  • No decimal point — A*1.5 fails. Use A*3/2.
  • Labels are single letters A–Z; a two-character label breaks the dependency check.
  • The formula must appear after the queries it references in the queries array.
  • It cannot reference itself, or a label that doesn't exist.

Per-query color

Any query arm (metrics, logs, traces, formula) may carry fieldConfig.color. It colours every series that query yields and outranks the panel colorScheme, including the stat panel's default base threshold. Only an explicit colorScheme of type thresholds outranks it. Use it whenever the meaning of a query is fixed — errors red, success green — so the colour does not depend on the query's position in the panel.

{ "selectedMode": "traces", "label": "A", "...": "...",
  "fieldConfig": { "color": { "type": "single", "color": "#4AAD5A" } } }
{ "selectedMode": "traces", "label": "B", "...": "...",
  "fieldConfig": { "color": { "type": "palette", "palette": "error" } } }
  • single — one hex colour (#rgb, #rrggbb, or with alpha). A grouped query that returns several series is drawn in shades of it, not all identical.
  • palette — default | success | warning | error, cycled from the query's first series. Optional offset (integer ≥ 0) starts at a later slot.
  • Omit color (or the whole fieldConfig) to inherit the panel scheme.

A non-hex colour or an unknown palette name fails validation on import; the UI, if it ever reads one, drops back to the panel scheme. Full shape in references/panel-config.md.

Filters

filters is Record<string, string[]>:

{ "namespace": ["production"], "level": ["ERROR", "FATAL"] }
  • Attribute keys are prefixed @_@, e.g. "@_@user.id": ["abc"].
  • Exclusion is a - prefix on the value: {"namespace": ["-kube-system"]}.
  • A $name value is a dashboard-variable reference.
  • A "$$name": ["$$name"] entry is a field reference: the variable's field, filtered to its selection. See references/variables-and-rows.md.
  • On a metrics query, a ~ prefix makes the value a regex, and -~ a negated one: {"namespace": ["~kube-.*"], "pod": ["-~test-.*"]} renders namespace=~"kube-.*", pod!~"test-.*". - alone gives !=, so {"container": ["-"]} is container!="".

Metrics Query Functions

functions is an ordered pipeline: each entry applies to the result of the one before. Builder mode covers any single-query MetricsQL function (rollup, transform, label and aggregate functions, and scalar operators); a query that combines several series goes in code mode instead.

"functions": [
  { "type": "range", "name": "rate", "arguments": [ { "arg_name": "over", "arg_value": "5m" } ] },
  { "type": "aggregations", "name": "sum", "arguments": [ { "arg_name": "by", "arg_value": ["namespace"] } ] }
]
  • name picks the function and fixes its type and its argument names.
  • arguments holds {arg_name, arg_value} entries in any order. Leave one out to take its default, or, for an optional one, to leave it unrendered. The exception is a label list marked required in the reference (label_keep, labels_equal, the sort_by_label family, …): it must be present with at least that many labels, or the import fails.
  • A rollup's over window takes any duration ("15m", "1h30m") or a macro ("$__rate_interval"); omit it and the query engine picks one.
  • Modifiers are arguments too:
    • by / without (label lists) and limit on aggregates
    • keep_metric_names: true on rollups, transforms and operators
    • bool: true on comparisons
    • step for a [window:step] subquery
  • Validation rejects an unknown name or arg_name, a value of the wrong kind, and a malformed window, naming the function it objects to.

Before writing any function, read references/metrics-functions.md. It lists every function with its type, each argument's name, kind and default, and a verified example of the PromQL it renders. Argument names differ between look-alike functions: quantile takes phi, while quantile_over_time and histogram_quantile take quantile.

Grid Layout

{ "i": "0", "x": 0, "y": 0, "w": 6, "h": 4 }

All five keys required. 12-column grid, rowHeight 100px, panel minH 2. No bounds are validated — w: 99 is accepted and renders broken.

  • x: 0–11. Side by side: 0, 6 for two columns; 0, 4, 8 for three.
  • y: increment by the previous row's height.
  • i: the array index as a string. Matching is positional, so keep gridLayout in the same order as panels, and at least as long.

The pairing is per page. A page is {panels, gridLayout, subGrids, subGridLayout}. An untabbed dashboard's top level is one page, and each tab carries its own page. Inside each page, gridLayout[n] positions panels[n], and y starts at 0 again.

Variables and Rows

Both are optional and most dashboards need neither — omit variables, subGrids, and subGridLayout and they default to [].

If the dashboard needs a template variable (a dropdown feeding $name into query filters) or rows (collapsible panel groups), read references/variables-and-rows.md for the schemas. Two things to carry into that file: a variable's description is required (use ""), and one invalid variable silently deletes every variable.

Tabs

Tabs split a dashboard into pages the viewer switches between. They are optional, and a dashboard is either one page or a list of tabs, never both:

{
  "gridLayout": [], "panels": [], "subGrids": [], "subGridLayout": [],
  "variables": [], "eventOverlays": [],
  "tabs": [
    { "id": "overview", "title": "Overview", "panels": [], "gridLayout": [], "subGrids": [], "subGridLayout": [] }
  ]
}
  • Each tab is {id, title} plus its own page. Its panels, layout and rows live inside it.
  • On a tabbed dashboard the top-level panels, gridLayout, subGrids and subGridLayout stay present and empty.
  • variables, eventOverlays and publicDashboardPath stay at the top level and apply to every tab. There is no per-tab variable or overlay.
  • An untabbed dashboard omits tabs or sends [].

For a complete tabbed example, the id and title rules, and when to use tabs instead of rows, read references/tabs.md.

Event Overlays

If the dashboard should mark events on its charts (deployments, releases, CI runs), read references/event-overlays.md for the schema and a worked example. It covers the top-level eventOverlays array and each panel's config.eventOverlay (inherit | custom | off). Two things to carry into that file: color is a palette name (hex is refused), and only timeSeries and bar panels draw markers. On any other panel type an overlay validates and does nothing.

Delivering It

Creating it directly

validate-dashboard-json  →  valid=true  →  create-dashboard

create-dashboard takes name, preset (the object, or a JSON string containing it) and an optional description. It returns the dashboard id and its UI path — quote that path so the user can open it.

It is a write tool: only call it when the user has clearly asked for a dashboard to be created, and say what you are about to create before calling. If it refuses, the response names the JSON Pointer for every problem; fix them and retry rather than falling back to handing over JSON.

Editing an existing dashboard

list-dashboards  →  get-dashboard-details  →  update-dashboard (panel_operations + preset_version)

update-dashboard takes dashboard_id plus any of name, description, panel_operations or preset. Like create-dashboard it is a write tool: say what you are about to change, and call it only when the user asked for the change. It needs edit access on the dashboard.

System dashboards are read-only. list-dashboards reports type: system for a dashboard KubeSense ships (one per integration service, such as "AWS RDS Overview" or "Kubernetes Pods Overview"), user for one a person made. update-dashboard refuses a system dashboard for everyone. To change one, the user clones it in the UI (Clone on the dashboard or on the integration's Dashboards tab) and you edit the copy, which is a user dashboard with the same name; filter with type: "user" to find it. A system dashboard with an integration_id is listed only while that integration has a connected account.

Edit panels with panel_operations, not a whole preset. get-dashboard-details returns a projection — queries only, no layout, colours, axes or thresholds — so a preset rebuilt from it silently deletes all of those. panel_operations edits the stored document in place and keeps everything you never saw.

get-dashboard-details gives what the operations need:

  • position — the panel's index within its section, from 0. Panels have no id.
  • sub_grid_id — the row (sub-grid) the panel is in; empty for a top-level panel.
  • tab_id and tab_title — the tab the panel is on; empty on an untabbed dashboard. The response also lists the dashboard's tabs.
  • preset_version — pass it back unchanged as preset_version. Required with panel_operations.
  • rendered_promql — on a builder-mode metrics query, the PromQL the panel runs (the stored promql is empty in builder mode), with $$name filters expanded to <field>="$name". Read-only: it is not part of the stored query, so never send it back in a panel patch.

Each operation is one of:

{"op": "update_panel", "position": 2, "panel": {"name": "p99 latency"}}
{"op": "add_panel", "panel": { /* the whole new panel */ }, "grid_layout": {"w": 6, "h": 4}}
{"op": "remove_panel", "position": 0}

A panel's address is tab_id, sub_grid_id and position. Add "sub_grid_id": "<id>" to act inside a row; omit it for the page's top-level panels. On a tabbed dashboard every operation, add_panel included, needs "tab_id": "<id>". A missing or unknown tab_id refuses the call, and the error lists the valid tab ids. On an untabbed dashboard, omit tab_id.

{"op": "update_panel", "tab_id": "node-health", "sub_grid_id": "row-disk", "position": 1, "panel": {"name": "Disk IO"}}
  • update_panel is a JSON merge patch (RFC 7386): objects merge key by key, null deletes a key, and arrays are replaced whole — to change one query, send the full queries array. An optional grid_layout {x, y, w, h} moves or resizes the panel; only the keys you give change. It needs a panel patch, a grid_layout, or both.
  • add_panel appends a whole panel, which must pass the same checks as create-dashboard. It takes no position. Without grid_layout it goes in a new row below everything else, sized like the section's first cell.
  • remove_panel takes only position (and tab_id, sub_grid_id); it removes the panel and its layout cell.

Positions refer to the dashboard as you read it, even after an earlier operation in the same call removed a panel — do not re-count. Target each position at most once per call; combine two edits to one panel into one update_panel. All operations are applied in one write, and one bad operation refuses the whole call, naming panel_operations[i].

Refusals to expect:

Message saysDo
the dashboard changed since it was read / was saved by someone elseCall get-dashboard-details again and rebuild the edit from the new positions and preset_version. Never reuse the old ones.
position N does not existRe-read; the position is out of range for that section.
sub-grids share id / panel(s) but … gridLayout entr(ies)That section cannot be edited by position — fall back to a whole preset.
preset and panel_operations cannot be combinedSend one or the other.
a missing or unknown tab_id, with the valid idsRetry with one of the listed ids.
this dashboard has tabs and the preset has no tabs key (409)Your whole preset had no tabs key. Re-read with raw=true and send the preset back with its tabs array.

On success it returns the id, name and a new preset_version; a further edit in the same conversation can use that without reading again.

Whole-preset rewrite — only when the edit cannot be expressed as panel operations (reordering, restructuring rows, variables, and adding, removing, renaming or reordering tabs). Read with get-dashboard-details raw=true, which adds the full stored preset; change what you need; run it through validate-dashboard-json; send the whole object back as preset. Anything you leave out is deleted. Pass preset_version here too, so a concurrent save is refused instead of overwritten.

On a tabbed dashboard the preset you send must keep the tabs key. A preset with no tabs key over a tabbed dashboard looks like an old client that would drop the tabs, so the server refuses it with 409. Moving a panel to another tab is also a rewrite: take it out of one tab's panels and gridLayout and append it to the other's.

A name- or description-only update needs neither.

Handing over JSON to import

  1. Copy the JSON to a .json file (the import UI requires application/json).
  2. KubeSense → Dashboards → Import.
  3. Upload and review, then save.

On this path never claim the dashboard was created — the user imports and confirms it.

Rules

Rule 0: run validate-dashboard-json before creating or handing over, and fix what it reports. Everything in What Hard-Fails Import is machine-checked — the validator names the JSON Pointer, so it needs no checklist here.

This checklist is for what the validator is blind to. Every rule below passes validation and then silently discards your data or crashes at render. A green validation is not a working dashboard — check these by hand before you hand it over.

  1. gridLayout must be at least as long as panels, in the same order — matching is positional, and a short layout throws a TypeError when the dashboard renders.
  2. Numeric aggregations need fields[].type: "float" exactly, or the whole aggregation resets to row_count — a row count where you asked for a percentile.
  3. chart_type is lowercase timeseries; panelType is camelCase timeSeries. Each resets to its own default (table / timeSeries) on a mismatch.
  4. Variables need description (use "") and a regex-valid name ≤ 20 chars — one bad variable deletes them all.
  5. Use real y-axis units (percentage, mCPU, bytes/sec) — percent, short, none become auto.
  6. Don't emit enableThresholds, colorPalette, mergeTables: false, topListLabel, or topListValue — none exist, and unknown keys are stripped without comment. On a top list, value colouring goes in visualFormattingRules, not thresholds.
  7. Prefer omitting an optional field to guessing it: an omitted field takes its default, a wrong one can reset its siblings.
  8. Validation checks shape, not existence. Discover metric and field names with MCP before writing queries, and tell the user to confirm on the panel preview.
  9. On a tabbed dashboard, put each panel's layout cell in the same tab as the panel, at the same index. Every whole-preset rewrite keeps the tabs key, and every panel_operations entry carries tab_id.
  10. Keep variables and eventOverlays at the top level of the preset, never inside a tab. They apply to every tab.

The one rule that spans both: preset is a stringified JSON string in the import envelope, but the plain object when passed to create-dashboard or validate-dashboard-json.

Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.

<a href="https://skillzs.dev/skills/kubesense-ai/kubesense-mcp-skills/kubesense-dashboards">View kubesense-dashboards on skillZs</a>