Files
grafana/apps/dashboard/pkg/migration/conversion/testdata/output/v1beta1.panel-conversions.v2alpha1.json
T
2025-11-19 15:56:33 +01:00

505 lines
14 KiB
JSON

{
"kind": "Dashboard",
"apiVersion": "dashboard.grafana.app/v2alpha1",
"metadata": {
"name": "panel-conversions-test",
"labels": {
"test": "panel-conversions"
}
},
"spec": {
"annotations": [],
"cursorSync": "Off",
"description": "Testing panel to elements conversion",
"editable": true,
"elements": {
"panel-1": {
"kind": "Panel",
"spec": {
"id": 1,
"title": "Regular Timeseries Panel",
"description": "",
"links": [
{
"title": "External Link",
"url": "https://example.com",
"targetBlank": true
}
],
"data": {
"kind": "QueryGroup",
"spec": {
"queries": [
{
"kind": "PanelQuery",
"spec": {
"query": {
"kind": "prometheus",
"spec": {
"expr": "up",
"interval": "30s"
}
},
"datasource": {
"type": "prometheus",
"uid": "existing-ref-uid"
},
"refId": "A",
"hidden": false
}
},
{
"kind": "PanelQuery",
"spec": {
"query": {
"kind": "prometheus",
"spec": {
"expr": "cpu_usage",
"interval": "1m"
}
},
"datasource": {
"type": "prometheus",
"uid": "existing-ref-uid"
},
"refId": "B",
"hidden": true
}
}
],
"transformations": [
{
"kind": "reduce",
"spec": {
"id": "reduce",
"options": {
"reducers": [
"mean"
]
}
}
}
],
"queryOptions": {
"maxDataPoints": 300,
"interval": "1m",
"cacheTimeout": "60s"
}
}
},
"vizConfig": {
"kind": "timeseries",
"spec": {
"pluginVersion": "10.0.0",
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single"
}
},
"fieldConfig": {
"defaults": {
"thresholds": {
"mode": "absolute",
"steps": [
{
"value": null,
"color": "green"
},
{
"value": 80,
"color": "red"
}
]
},
"color": {
"mode": "palette-classic"
},
"custom": {
"drawStyle": "line",
"fillOpacity": 10,
"lineWidth": 1
}
},
"overrides": []
}
}
},
"transparent": true
}
},
"panel-2": {
"kind": "LibraryPanel",
"spec": {
"id": 2,
"title": "Library Panel Reference",
"libraryPanel": {
"name": "Shared Stats Panel",
"uid": "library-panel-uid-123"
}
}
},
"panel-4": {
"kind": "Panel",
"spec": {
"id": 4,
"title": "Panel in Row",
"description": "",
"links": [],
"data": {
"kind": "QueryGroup",
"spec": {
"queries": [
{
"kind": "PanelQuery",
"spec": {
"query": {
"kind": "prometheus",
"spec": {
"scenarioId": "random_walk"
}
},
"datasource": {
"type": "prometheus",
"uid": "default-ds-uid"
},
"refId": "A",
"hidden": false
}
}
],
"transformations": [],
"queryOptions": {}
}
},
"vizConfig": {
"kind": "timeseries",
"spec": {
"pluginVersion": "",
"options": {},
"fieldConfig": {
"defaults": {},
"overrides": []
}
}
}
}
},
"panel-6": {
"kind": "Panel",
"spec": {
"id": 6,
"title": "Hidden Panel in Collapsed Row",
"description": "",
"links": [],
"data": {
"kind": "QueryGroup",
"spec": {
"queries": [
{
"kind": "PanelQuery",
"spec": {
"query": {
"kind": "loki",
"spec": {
"format": "table",
"rawSql": "SELECT * FROM metrics"
}
},
"datasource": {
"type": "loki",
"uid": "non-default-test-ds-uid"
},
"refId": "A",
"hidden": false
}
}
],
"transformations": [],
"queryOptions": {}
}
},
"vizConfig": {
"kind": "table",
"spec": {
"pluginVersion": "",
"options": {
"showHeader": true
},
"fieldConfig": {
"defaults": {},
"overrides": []
}
}
}
}
},
"panel-7": {
"kind": "Panel",
"spec": {
"id": 7,
"title": "Complex Panel with All Features",
"description": "",
"links": [
{
"title": "Drill Down",
"url": "/d/detailed-view"
}
],
"data": {
"kind": "QueryGroup",
"spec": {
"queries": [
{
"kind": "PanelQuery",
"spec": {
"query": {
"kind": "elasticsearch",
"spec": {
"bucketAggs": [
{
"field": "@timestamp",
"id": "2",
"type": "date_histogram"
}
],
"query": "*"
}
},
"datasource": {
"type": "elasticsearch",
"uid": "existing-target-uid"
},
"refId": "A",
"hidden": false
}
}
],
"transformations": [
{
"kind": "groupBy",
"spec": {
"id": "groupBy",
"options": {
"fields": {
"status": {
"aggregations": [
"count"
],
"operation": "groupby"
}
}
}
}
},
{
"kind": "sortBy",
"spec": {
"id": "sortBy",
"options": {
"sort": [
{
"desc": true,
"field": "count"
}
]
}
}
}
],
"queryOptions": {
"timeFrom": "1h",
"maxDataPoints": 1000,
"timeShift": "1h",
"queryCachingTTL": 300,
"hideTimeOverride": true
}
}
},
"vizConfig": {
"kind": "barchart",
"spec": {
"pluginVersion": "9.5.0",
"options": {
"barWidth": 0.97,
"groupWidth": 0.7,
"orientation": "horizontal"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "continuous-GrYlRd"
},
"custom": {
"orientation": "horizontal"
}
},
"overrides": []
}
}
}
}
}
},
"layout": {
"kind": "RowsLayout",
"spec": {
"rows": [
{
"kind": "RowsLayoutRow",
"spec": {
"title": "",
"collapse": false,
"hideHeader": true,
"layout": {
"kind": "GridLayout",
"spec": {
"items": [
{
"kind": "GridLayoutItem",
"spec": {
"x": 0,
"y": 0,
"width": 12,
"height": 8,
"element": {
"kind": "ElementReference",
"name": "panel-1"
}
}
},
{
"kind": "GridLayoutItem",
"spec": {
"x": 12,
"y": 0,
"width": 6,
"height": 4,
"element": {
"kind": "ElementReference",
"name": "panel-2"
}
}
}
]
}
}
}
},
{
"kind": "RowsLayoutRow",
"spec": {
"title": "Row Panel",
"collapse": false,
"repeat": {
"mode": "variable",
"value": "server"
},
"layout": {
"kind": "GridLayout",
"spec": {
"items": [
{
"kind": "GridLayoutItem",
"spec": {
"x": 0,
"y": 0,
"width": 8,
"height": 6,
"element": {
"kind": "ElementReference",
"name": "panel-4"
},
"repeat": {
"mode": "variable",
"value": "region",
"direction": "h",
"maxPerRow": 4
}
}
},
{
"kind": "GridLayoutItem",
"spec": {
"x": 8,
"y": 0,
"width": 16,
"height": 6,
"element": {
"kind": "ElementReference",
"name": "panel-7"
}
}
}
]
}
}
}
},
{
"kind": "RowsLayoutRow",
"spec": {
"title": "Collapsed Row",
"collapse": true,
"layout": {
"kind": "GridLayout",
"spec": {
"items": [
{
"kind": "GridLayoutItem",
"spec": {
"x": 0,
"y": 0,
"width": 12,
"height": 8,
"element": {
"kind": "ElementReference",
"name": "panel-6"
}
}
}
]
}
}
}
}
]
}
},
"links": [],
"liveNow": false,
"preload": false,
"tags": [
"test",
"panels"
],
"timeSettings": {
"timezone": "browser",
"from": "now-1h",
"to": "now",
"autoRefresh": "",
"autoRefreshIntervals": [
"5s",
"10s",
"30s",
"1m",
"5m",
"15m",
"30m",
"1h",
"2h",
"1d"
],
"hideTimepicker": false,
"fiscalYearStartMonth": 0
},
"title": "Panel Conversions Test Dashboard",
"variables": []
},
"status": {}
}