Watch
0
0
Fork
You've already forked hyperhive
0
hyperhive/nix/host-modules/swarm-grafana/dashboards/builds.json
iris ab30c3dc7d builds board: a Grafana dashboard of the container builds, from the lines hive-c0re logs
A builds tab (counts, failures, longest, builds over time by outcome, a table of
each build) and an output tab (every line of the build picked in the Build
filter). The table joins its grouped stats by labels, one row per build.
2026-11-01 17:18:58 +01:00

684 lines
20 KiB
JSON

{
"apiVersion": "dashboard.grafana.app/v2beta1",
"kind": "Dashboard",
"metadata": {
"name": "hyperhive-builds"
},
"spec": {
"title": "hyperhive · builds",
"description": "Container builds on every hive: what ran, how it ended, how long it took, and its output.",
"editable": true,
"cursorSync": "Off",
"liveNow": false,
"preload": false,
"tags": ["hyperhive", "swarm", "builds"],
"links": [],
"annotations": [
{
"kind": "AnnotationQuery",
"spec": {
"query": {
"kind": "DataQuery",
"group": "grafana",
"version": "v0",
"datasource": {
"name": "-- Grafana --"
},
"spec": {}
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"builtIn": true,
"legacyOptions": {
"type": "dashboard"
}
}
}
],
"variables": [
{
"kind": "QueryVariable",
"spec": {
"name": "agent",
"label": "Agent",
"hide": "dontHide",
"refresh": "onTimeRangeChanged",
"skipUrlSync": false,
"query": {
"kind": "DataQuery",
"group": "victoriametrics-logs-datasource",
"version": "v0",
"datasource": {
"name": "@logsDatasourceUid@"
},
"spec": {
"refId": "agent",
"type": "fieldValue",
"field": "F_AGENT",
"query": "_SYSTEMD_UNIT:\"hive-c0re.service\" TARGET:\"nixos-container\" F_EVENT:finish",
"limit": 200
}
},
"regex": "",
"options": [],
"allowCustomValue": true,
"current": {
"text": "All",
"value": "$__all"
},
"sort": "alphabeticalAsc",
"multi": true,
"includeAll": true
}
},
{
"kind": "QueryVariable",
"spec": {
"name": "build",
"label": "Build",
"hide": "dontHide",
"refresh": "onTimeRangeChanged",
"skipUrlSync": false,
"query": {
"kind": "DataQuery",
"group": "victoriametrics-logs-datasource",
"version": "v0",
"datasource": {
"name": "@logsDatasourceUid@"
},
"spec": {
"refId": "build",
"type": "fieldValue",
"field": "F_BUILD_ID",
"query": "_SYSTEMD_UNIT:\"hive-c0re.service\" TARGET:\"nixos-container\" F_EVENT:start",
"limit": 200
}
},
"regex": "",
"options": [],
"allowCustomValue": true,
"current": {},
"sort": "numericalDesc",
"multi": false,
"includeAll": false
}
}
],
"timeSettings": {
"timezone": "utc",
"from": "now-24h",
"to": "now",
"autoRefresh": "1m",
"autoRefreshIntervals": [
"5s",
"10s",
"30s",
"1m",
"5m",
"15m",
"30m",
"1h",
"2h",
"1d"
],
"hideTimepicker": false,
"fiscalYearStartMonth": 0
},
"elements": {
"panel-1": {
"kind": "Panel",
"spec": {
"id": 1,
"title": "Builds",
"description": "Container builds that finished in the range; zero means the log feed is down.",
"links": [],
"data": {
"kind": "QueryGroup",
"spec": {
"queries": [
{
"kind": "PanelQuery",
"spec": {
"query": {
"kind": "DataQuery",
"group": "victoriametrics-logs-datasource",
"version": "v0",
"datasource": {
"name": "@logsDatasourceUid@"
},
"spec": {
"expr": "_SYSTEMD_UNIT:\"hive-c0re.service\" TARGET:\"nixos-container\" F_EVENT:finish | filter F_AGENT:$agent | stats count() as builds",
"queryType": "stats"
}
},
"refId": "A",
"hidden": false
}
}
],
"transformations": [],
"queryOptions": {}
}
},
"vizConfig": {
"kind": "VizConfig",
"group": "stat",
"version": "",
"spec": {
"options": {
"colorMode": "value",
"graphMode": "none",
"justifyMode": "auto",
"reduceOptions": {
"calcs": ["lastNotNull"],
"fields": "",
"values": false
},
"textMode": "auto"
},
"fieldConfig": {
"defaults": {
"unit": "short",
"decimals": 0,
"color": {
"mode": "thresholds"
},
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
}
},
"overrides": []
}
}
}
}
},
"panel-2": {
"kind": "Panel",
"spec": {
"id": 2,
"title": "Failed builds",
"description": "Builds that ended in failure; open the output tab to read one.",
"links": [],
"data": {
"kind": "QueryGroup",
"spec": {
"queries": [
{
"kind": "PanelQuery",
"spec": {
"query": {
"kind": "DataQuery",
"group": "victoriametrics-logs-datasource",
"version": "v0",
"datasource": {
"name": "@logsDatasourceUid@"
},
"spec": {
"expr": "_SYSTEMD_UNIT:\"hive-c0re.service\" TARGET:\"nixos-container\" F_EVENT:finish | filter F_AGENT:$agent | filter F_STATUS:fail | stats count() as failed",
"queryType": "stats"
}
},
"refId": "A",
"hidden": false
}
}
],
"transformations": [],
"queryOptions": {}
}
},
"vizConfig": {
"kind": "VizConfig",
"group": "stat",
"version": "",
"spec": {
"options": {
"colorMode": "value",
"graphMode": "none",
"justifyMode": "auto",
"reduceOptions": {
"calcs": ["lastNotNull"],
"fields": "",
"values": false
},
"textMode": "auto"
},
"fieldConfig": {
"defaults": {
"unit": "short",
"decimals": 0,
"color": {
"mode": "thresholds"
},
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "orange",
"value": null
}
]
}
},
"overrides": []
}
}
}
}
},
"panel-3": {
"kind": "Panel",
"spec": {
"id": 3,
"title": "Longest build",
"description": "The longest build in the range, in seconds.",
"links": [],
"data": {
"kind": "QueryGroup",
"spec": {
"queries": [
{
"kind": "PanelQuery",
"spec": {
"query": {
"kind": "DataQuery",
"group": "victoriametrics-logs-datasource",
"version": "v0",
"datasource": {
"name": "@logsDatasourceUid@"
},
"spec": {
"expr": "_SYSTEMD_UNIT:\"hive-c0re.service\" TARGET:\"nixos-container\" F_EVENT:finish | filter F_AGENT:$agent | stats max(F_RUNTIME_SECS) as seconds",
"queryType": "stats"
}
},
"refId": "A",
"hidden": false
}
}
],
"transformations": [],
"queryOptions": {}
}
},
"vizConfig": {
"kind": "VizConfig",
"group": "stat",
"version": "",
"spec": {
"options": {
"colorMode": "value",
"graphMode": "none",
"justifyMode": "auto",
"reduceOptions": {
"calcs": ["lastNotNull"],
"fields": "",
"values": false
},
"textMode": "auto"
},
"fieldConfig": {
"defaults": {
"unit": "s",
"decimals": 0,
"color": {
"mode": "thresholds"
},
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "blue",
"value": null
}
]
}
},
"overrides": []
}
}
}
}
},
"panel-4": {
"kind": "Panel",
"spec": {
"id": 4,
"title": "Builds over time by status",
"description": "Finished builds per outcome over the range.",
"links": [],
"data": {
"kind": "QueryGroup",
"spec": {
"queries": [
{
"kind": "PanelQuery",
"spec": {
"query": {
"kind": "DataQuery",
"group": "victoriametrics-logs-datasource",
"version": "v0",
"datasource": {
"name": "@logsDatasourceUid@"
},
"spec": {
"expr": "_SYSTEMD_UNIT:\"hive-c0re.service\" TARGET:\"nixos-container\" F_EVENT:finish | filter F_AGENT:$agent | stats by (F_STATUS) count() as builds",
"queryType": "statsRange",
"legendFormat": "{{F_STATUS}}"
}
},
"refId": "A",
"hidden": false
}
}
],
"transformations": [],
"queryOptions": {}
}
},
"vizConfig": {
"kind": "VizConfig",
"group": "timeseries",
"version": "",
"spec": {
"options": {
"legend": {
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
},
"fieldConfig": {
"defaults": {
"unit": "short",
"decimals": 0,
"color": {
"mode": "palette-classic"
},
"custom": {
"drawStyle": "bars",
"lineWidth": 1,
"fillOpacity": 60,
"showPoints": "never",
"spanNulls": false,
"axisSoftMin": 0
}
},
"overrides": []
}
}
}
}
},
"panel-5": {
"kind": "Panel",
"spec": {
"id": 5,
"title": "Recent builds",
"description": "Each build in the range: its id, agent, kind, outcome and runtime. Pick the id on the output tab.",
"links": [],
"data": {
"kind": "QueryGroup",
"spec": {
"queries": [
{
"kind": "PanelQuery",
"spec": {
"query": {
"kind": "DataQuery",
"group": "victoriametrics-logs-datasource",
"version": "v0",
"datasource": {
"name": "@logsDatasourceUid@"
},
"spec": {
"expr": "_SYSTEMD_UNIT:\"hive-c0re.service\" TARGET:\"nixos-container\" F_EVENT:finish | filter F_AGENT:$agent | stats by (F_BUILD_ID, F_AGENT, F_KIND, F_STATUS) max(F_RUNTIME_SECS) as runtime | sort by (F_BUILD_ID) desc | limit 100",
"queryType": "stats"
}
},
"refId": "A",
"hidden": false
}
}
],
"transformations": [
{
"kind": "joinByLabels",
"spec": {
"id": "joinByLabels",
"options": {
"join": ["F_BUILD_ID", "F_AGENT", "F_KIND", "F_STATUS"],
"value": "__name__"
}
}
},
{
"kind": "organize",
"spec": {
"id": "organize",
"options": {
"excludeByName": {
"Time": true
},
"renameByName": {
"F_BUILD_ID": "Build",
"F_AGENT": "Agent",
"F_KIND": "Kind",
"F_STATUS": "Status",
"runtime": "Runtime (s)"
}
}
}
}
],
"queryOptions": {}
}
},
"vizConfig": {
"kind": "VizConfig",
"group": "table",
"version": "",
"spec": {
"options": {
"showHeader": true,
"sortBy": [
{
"displayName": "Build",
"desc": true
}
]
},
"fieldConfig": {
"defaults": {
"unit": "short",
"decimals": 0
},
"overrides": []
}
}
}
}
},
"panel-6": {
"kind": "Panel",
"spec": {
"id": 6,
"title": "Build output",
"description": "Every line of the build picked above, oldest first, with its start and finish lines.",
"links": [],
"data": {
"kind": "QueryGroup",
"spec": {
"queries": [
{
"kind": "PanelQuery",
"spec": {
"query": {
"kind": "DataQuery",
"group": "victoriametrics-logs-datasource",
"version": "v0",
"datasource": {
"name": "@logsDatasourceUid@"
},
"spec": {
"expr": "_SYSTEMD_UNIT:\"hive-c0re.service\" TARGET:\"nixos-container\" F_BUILD_ID:$build | sort by (_time)",
"queryType": "instant"
}
},
"refId": "A",
"hidden": false
}
}
],
"transformations": [],
"queryOptions": {}
}
},
"vizConfig": {
"kind": "VizConfig",
"group": "logs",
"version": "",
"spec": {
"options": {
"showTime": true,
"wrapLogMessage": true,
"prettifyLogMessage": false,
"enableLogDetails": true,
"sortOrder": "Ascending",
"dedupStrategy": "none"
},
"fieldConfig": {
"defaults": {},
"overrides": []
}
}
}
}
}
},
"layout": {
"kind": "TabsLayout",
"spec": {
"tabs": [
{
"kind": "TabsLayoutTab",
"spec": {
"title": "builds",
"layout": {
"kind": "GridLayout",
"spec": {
"items": [
{
"kind": "GridLayoutItem",
"spec": {
"x": 0,
"y": 0,
"width": 8,
"height": 4,
"element": {
"kind": "ElementReference",
"name": "panel-1"
}
}
},
{
"kind": "GridLayoutItem",
"spec": {
"x": 8,
"y": 0,
"width": 8,
"height": 4,
"element": {
"kind": "ElementReference",
"name": "panel-2"
}
}
},
{
"kind": "GridLayoutItem",
"spec": {
"x": 16,
"y": 0,
"width": 8,
"height": 4,
"element": {
"kind": "ElementReference",
"name": "panel-3"
}
}
},
{
"kind": "GridLayoutItem",
"spec": {
"x": 0,
"y": 4,
"width": 24,
"height": 8,
"element": {
"kind": "ElementReference",
"name": "panel-4"
}
}
},
{
"kind": "GridLayoutItem",
"spec": {
"x": 0,
"y": 12,
"width": 24,
"height": 14,
"element": {
"kind": "ElementReference",
"name": "panel-5"
}
}
}
]
}
}
}
},
{
"kind": "TabsLayoutTab",
"spec": {
"title": "output",
"layout": {
"kind": "GridLayout",
"spec": {
"items": [
{
"kind": "GridLayoutItem",
"spec": {
"x": 0,
"y": 0,
"width": 24,
"height": 26,
"element": {
"kind": "ElementReference",
"name": "panel-6"
}
}
}
]
}
}
}
}
]
}
}
}
}