**Highlights**
* **Single-version migrations**: add `targetVersion` to migrator & model, separate outputs, enforce exact version.
* **Datasource fixes**: include `apiVersion` in tests, empty-string → `{}`, preserve `{}` refs, drop unwanted defaults.
* **Panel defaults & nesting**: only top-level panels get defaults; preserve empty `transformations` context-aware; filter repeated panels.
* **Migration parity**
* V16: collapsed rows, grid height parsing (`px`).
* V17: omit `maxPerRow` when `minSpan=1`.
* V19–V20: cleanup defaults (`targetBlank`, style).
* V23–V24: template vars + table panel consistency.
* V28: full singlestat/stat parity, mappings & color.
* V30–V36: threshold logic, empty refs, nested targets.
* **Save-model cleanup**: replicate frontend defaults/filtering, drop null IDs, metadata, unused props.
* **Testing**: unified suites, dev dashboards (v42), full unit coverage for major migrations.
Co-authored-by: Ivan Ortega [ivanortegaalba@gmail.com](mailto:ivanortegaalba@gmail.com)
Co-authored-by: Dominik Prokop [dominik.prokop@grafana.com](mailto:dominik.prokop@grafana.com)
565 lines
12 KiB
JSON
565 lines
12 KiB
JSON
{
|
|
"annotations": {
|
|
"list": [
|
|
{
|
|
"builtIn": 1,
|
|
"datasource": {
|
|
"uid": "-- Grafana --"
|
|
},
|
|
"enable": true,
|
|
"hide": true,
|
|
"iconColor": "rgba(0, 211, 255, 1)",
|
|
"name": "Annotations \u0026 Alerts",
|
|
"type": "dashboard"
|
|
}
|
|
]
|
|
},
|
|
"editable": true,
|
|
"fiscalYearStartMonth": 0,
|
|
"graphTooltip": 0,
|
|
"links": [],
|
|
"panels": [
|
|
{
|
|
"aliasColors": {},
|
|
"autoMigrateFrom": "graph",
|
|
"bars": false,
|
|
"dashLength": 10,
|
|
"dashes": false,
|
|
"datasource": {
|
|
"type": "grafana-testdata-datasource"
|
|
},
|
|
"fill": 2,
|
|
"gridPos": {
|
|
"h": 8,
|
|
"w": 24,
|
|
"x": 0,
|
|
"y": 0
|
|
},
|
|
"id": 2,
|
|
"legend": {
|
|
"avg": false,
|
|
"current": false,
|
|
"max": false,
|
|
"min": false,
|
|
"show": true,
|
|
"total": false,
|
|
"values": false
|
|
},
|
|
"lines": true,
|
|
"linewidth": 2,
|
|
"nullPointMode": "null",
|
|
"percentage": false,
|
|
"pointradius": 5,
|
|
"points": false,
|
|
"renderer": "flot",
|
|
"seriesOverrides": [],
|
|
"spaceLength": 10,
|
|
"stack": false,
|
|
"steppedLine": false,
|
|
"targets": [
|
|
{
|
|
"datasource": {
|
|
"type": "grafana-testdata-datasource"
|
|
},
|
|
"refId": "A",
|
|
"scenarioId": "random_walk",
|
|
"target": ""
|
|
}
|
|
],
|
|
"thresholds": [],
|
|
"timeRegions": [
|
|
{
|
|
"colorMode": "gray",
|
|
"fill": true,
|
|
"fillColor": "rgba(255, 255, 255, 0.03)",
|
|
"from": "08:30",
|
|
"fromDayOfWeek": 1,
|
|
"line": false,
|
|
"lineColor": "rgba(255, 255, 255, 0.2)",
|
|
"op": "time",
|
|
"to": "16:45",
|
|
"toDayOfWeek": 5
|
|
}
|
|
],
|
|
"title": "Business Hours",
|
|
"tooltip": {
|
|
"shared": true,
|
|
"sort": 0,
|
|
"value_type": "individual"
|
|
},
|
|
"type": "timeseries",
|
|
"xaxis": {
|
|
"mode": "time",
|
|
"show": true,
|
|
"values": []
|
|
},
|
|
"yaxes": [
|
|
{
|
|
"format": "short",
|
|
"logBase": 1,
|
|
"show": true
|
|
},
|
|
{
|
|
"format": "short",
|
|
"logBase": 1,
|
|
"show": true
|
|
}
|
|
],
|
|
"yaxis": {
|
|
"align": false
|
|
}
|
|
},
|
|
{
|
|
"aliasColors": {},
|
|
"autoMigrateFrom": "graph",
|
|
"bars": false,
|
|
"dashLength": 10,
|
|
"dashes": false,
|
|
"datasource": {
|
|
"type": "grafana-testdata-datasource"
|
|
},
|
|
"fill": 2,
|
|
"gridPos": {
|
|
"h": 8,
|
|
"w": 24,
|
|
"x": 0,
|
|
"y": 8
|
|
},
|
|
"id": 4,
|
|
"legend": {
|
|
"avg": false,
|
|
"current": false,
|
|
"max": false,
|
|
"min": false,
|
|
"show": true,
|
|
"total": false,
|
|
"values": false
|
|
},
|
|
"lines": true,
|
|
"linewidth": 2,
|
|
"nullPointMode": "null",
|
|
"percentage": false,
|
|
"pointradius": 5,
|
|
"points": false,
|
|
"renderer": "flot",
|
|
"seriesOverrides": [],
|
|
"spaceLength": 10,
|
|
"stack": false,
|
|
"steppedLine": false,
|
|
"targets": [
|
|
{
|
|
"datasource": {
|
|
"type": "grafana-testdata-datasource"
|
|
},
|
|
"expr": "",
|
|
"format": "time_series",
|
|
"intervalFactor": 1,
|
|
"refId": "A",
|
|
"scenarioId": "random_walk",
|
|
"target": ""
|
|
}
|
|
],
|
|
"thresholds": [],
|
|
"timeRegions": [
|
|
{
|
|
"colorMode": "red",
|
|
"fill": true,
|
|
"fillColor": "rgba(255, 255, 255, 0.03)",
|
|
"from": "20:00",
|
|
"fromDayOfWeek": 7,
|
|
"line": false,
|
|
"lineColor": "rgba(255, 255, 255, 0.2)",
|
|
"op": "time",
|
|
"to": "23:00",
|
|
"toDayOfWeek": 7
|
|
}
|
|
],
|
|
"title": "Sunday's 20-23",
|
|
"tooltip": {
|
|
"shared": true,
|
|
"sort": 0,
|
|
"value_type": "individual"
|
|
},
|
|
"type": "timeseries",
|
|
"xaxis": {
|
|
"mode": "time",
|
|
"show": true,
|
|
"values": []
|
|
},
|
|
"yaxes": [
|
|
{
|
|
"format": "short",
|
|
"logBase": 1,
|
|
"show": true
|
|
},
|
|
{
|
|
"format": "short",
|
|
"logBase": 1,
|
|
"show": true
|
|
}
|
|
],
|
|
"yaxis": {
|
|
"align": false
|
|
}
|
|
},
|
|
{
|
|
"aliasColors": {
|
|
"A-series": "#d683ce"
|
|
},
|
|
"autoMigrateFrom": "graph",
|
|
"bars": false,
|
|
"dashLength": 10,
|
|
"dashes": false,
|
|
"datasource": {
|
|
"type": "grafana-testdata-datasource"
|
|
},
|
|
"fill": 2,
|
|
"gridPos": {
|
|
"h": 8,
|
|
"w": 24,
|
|
"x": 0,
|
|
"y": 16
|
|
},
|
|
"id": 3,
|
|
"legend": {
|
|
"avg": false,
|
|
"current": false,
|
|
"max": false,
|
|
"min": false,
|
|
"show": true,
|
|
"total": false,
|
|
"values": false
|
|
},
|
|
"lines": true,
|
|
"linewidth": 2,
|
|
"nullPointMode": "null",
|
|
"percentage": false,
|
|
"pointradius": 0.5,
|
|
"points": false,
|
|
"renderer": "flot",
|
|
"seriesOverrides": [],
|
|
"spaceLength": 10,
|
|
"stack": false,
|
|
"steppedLine": false,
|
|
"targets": [
|
|
{
|
|
"datasource": {
|
|
"type": "grafana-testdata-datasource"
|
|
},
|
|
"refId": "A",
|
|
"scenarioId": "random_walk",
|
|
"target": ""
|
|
}
|
|
],
|
|
"thresholds": [],
|
|
"timeRegions": [
|
|
{
|
|
"colorMode": "custom",
|
|
"fill": true,
|
|
"fillColor": "rgba(255, 0, 0, 0.22)",
|
|
"from": "",
|
|
"fromDayOfWeek": 1,
|
|
"line": true,
|
|
"lineColor": "rgba(255, 0, 0, 0.32)",
|
|
"op": "time",
|
|
"to": "",
|
|
"toDayOfWeek": 1
|
|
},
|
|
{
|
|
"colorMode": "custom",
|
|
"fill": true,
|
|
"fillColor": "rgba(255, 127, 0, 0.22)",
|
|
"fromDayOfWeek": 2,
|
|
"line": true,
|
|
"lineColor": "rgba(255, 127, 0, 0.32)",
|
|
"op": "time",
|
|
"toDayOfWeek": 2
|
|
},
|
|
{
|
|
"colorMode": "custom",
|
|
"fill": true,
|
|
"fillColor": "rgba(255, 255, 0, 0.22)",
|
|
"fromDayOfWeek": 3,
|
|
"line": true,
|
|
"lineColor": "rgba(255, 255, 0, 0.22)",
|
|
"op": "time",
|
|
"toDayOfWeek": 3
|
|
},
|
|
{
|
|
"colorMode": "custom",
|
|
"fill": true,
|
|
"fillColor": "rgba(0, 255, 0, 0.22)",
|
|
"fromDayOfWeek": 4,
|
|
"line": true,
|
|
"lineColor": "rgba(0, 255, 0, 0.32)",
|
|
"op": "time",
|
|
"toDayOfWeek": 4
|
|
},
|
|
{
|
|
"colorMode": "custom",
|
|
"fill": true,
|
|
"fillColor": "rgba(0, 0, 255, 0.22)",
|
|
"fromDayOfWeek": 5,
|
|
"line": true,
|
|
"lineColor": "rgba(0, 0, 255, 0.32)",
|
|
"op": "time",
|
|
"toDayOfWeek": 5
|
|
},
|
|
{
|
|
"colorMode": "custom",
|
|
"fill": true,
|
|
"fillColor": "rgba(75, 0, 130, 0.22)",
|
|
"fromDayOfWeek": 6,
|
|
"line": true,
|
|
"lineColor": "rgba(75, 0, 130, 0.32)",
|
|
"op": "time",
|
|
"toDayOfWeek": 6
|
|
},
|
|
{
|
|
"colorMode": "custom",
|
|
"fill": true,
|
|
"fillColor": "rgba(148, 0, 211, 0.22)",
|
|
"fromDayOfWeek": 7,
|
|
"line": true,
|
|
"lineColor": "rgba(148, 0, 211, 0.32)",
|
|
"op": "time",
|
|
"toDayOfWeek": 7
|
|
}
|
|
],
|
|
"title": "Each day of week",
|
|
"tooltip": {
|
|
"shared": true,
|
|
"sort": 0,
|
|
"value_type": "individual"
|
|
},
|
|
"type": "timeseries",
|
|
"xaxis": {
|
|
"mode": "time",
|
|
"show": true,
|
|
"values": []
|
|
},
|
|
"yaxes": [
|
|
{
|
|
"format": "short",
|
|
"logBase": 1,
|
|
"show": true
|
|
},
|
|
{
|
|
"format": "short",
|
|
"logBase": 1,
|
|
"show": true
|
|
}
|
|
],
|
|
"yaxis": {
|
|
"align": false
|
|
}
|
|
},
|
|
{
|
|
"aliasColors": {},
|
|
"autoMigrateFrom": "graph",
|
|
"bars": false,
|
|
"dashLength": 10,
|
|
"dashes": false,
|
|
"datasource": {
|
|
"type": "grafana-testdata-datasource"
|
|
},
|
|
"fill": 2,
|
|
"gridPos": {
|
|
"h": 8,
|
|
"w": 24,
|
|
"x": 0,
|
|
"y": 24
|
|
},
|
|
"id": 5,
|
|
"legend": {
|
|
"avg": false,
|
|
"current": false,
|
|
"max": false,
|
|
"min": false,
|
|
"show": true,
|
|
"total": false,
|
|
"values": false
|
|
},
|
|
"lines": true,
|
|
"linewidth": 2,
|
|
"nullPointMode": "null",
|
|
"percentage": false,
|
|
"pointradius": 5,
|
|
"points": false,
|
|
"renderer": "flot",
|
|
"seriesOverrides": [],
|
|
"spaceLength": 10,
|
|
"stack": false,
|
|
"steppedLine": false,
|
|
"targets": [
|
|
{
|
|
"datasource": {
|
|
"type": "grafana-testdata-datasource"
|
|
},
|
|
"expr": "",
|
|
"format": "time_series",
|
|
"intervalFactor": 1,
|
|
"refId": "A",
|
|
"scenarioId": "random_walk",
|
|
"target": ""
|
|
}
|
|
],
|
|
"thresholds": [],
|
|
"timeRegions": [
|
|
{
|
|
"colorMode": "red",
|
|
"fill": false,
|
|
"from": "05:00",
|
|
"line": true,
|
|
"op": "time"
|
|
}
|
|
],
|
|
"title": "05:00",
|
|
"tooltip": {
|
|
"shared": true,
|
|
"sort": 0,
|
|
"value_type": "individual"
|
|
},
|
|
"type": "timeseries",
|
|
"xaxis": {
|
|
"mode": "time",
|
|
"show": true,
|
|
"values": []
|
|
},
|
|
"yaxes": [
|
|
{
|
|
"format": "short",
|
|
"logBase": 1,
|
|
"show": true
|
|
},
|
|
{
|
|
"format": "short",
|
|
"logBase": 1,
|
|
"show": true
|
|
}
|
|
],
|
|
"yaxis": {
|
|
"align": false
|
|
}
|
|
},
|
|
{
|
|
"aliasColors": {},
|
|
"autoMigrateFrom": "graph",
|
|
"bars": false,
|
|
"dashLength": 10,
|
|
"dashes": false,
|
|
"datasource": {
|
|
"type": "grafana-testdata-datasource"
|
|
},
|
|
"fill": 1,
|
|
"gridPos": {
|
|
"h": 8,
|
|
"w": 24,
|
|
"x": 0,
|
|
"y": 32
|
|
},
|
|
"id": 7,
|
|
"legend": {
|
|
"avg": false,
|
|
"current": false,
|
|
"max": false,
|
|
"min": false,
|
|
"show": true,
|
|
"total": false,
|
|
"values": false
|
|
},
|
|
"lines": true,
|
|
"linewidth": 1,
|
|
"nullPointMode": "null",
|
|
"percentage": false,
|
|
"pointradius": 2,
|
|
"points": false,
|
|
"renderer": "flot",
|
|
"seriesOverrides": [],
|
|
"spaceLength": 10,
|
|
"stack": false,
|
|
"steppedLine": false,
|
|
"targets": [
|
|
{
|
|
"datasource": {
|
|
"type": "grafana-testdata-datasource"
|
|
},
|
|
"refId": "A",
|
|
"scenarioId": "random_walk"
|
|
}
|
|
],
|
|
"thresholds": [],
|
|
"timeRegions": [
|
|
{
|
|
"colorMode": "gray",
|
|
"fill": true,
|
|
"fillColor": "rgba(234, 112, 112, 0.12)",
|
|
"from": "22:00",
|
|
"line": false,
|
|
"lineColor": "rgba(237, 46, 24, 0.60)",
|
|
"op": "time",
|
|
"to": "00:30"
|
|
}
|
|
],
|
|
"title": "From 22:00 to 00:30 (crossing midnight)",
|
|
"tooltip": {
|
|
"shared": true,
|
|
"sort": 0,
|
|
"value_type": "individual"
|
|
},
|
|
"type": "timeseries",
|
|
"xaxis": {
|
|
"mode": "time",
|
|
"show": true,
|
|
"values": []
|
|
},
|
|
"yaxes": [
|
|
{
|
|
"format": "short",
|
|
"logBase": 1,
|
|
"show": true
|
|
},
|
|
{
|
|
"format": "short",
|
|
"logBase": 1,
|
|
"show": true
|
|
}
|
|
],
|
|
"yaxis": {
|
|
"align": false
|
|
}
|
|
}
|
|
],
|
|
"refresh": "",
|
|
"schemaVersion": 42,
|
|
"tags": [
|
|
"gdev",
|
|
"panel-tests",
|
|
"graph"
|
|
],
|
|
"templating": {
|
|
"list": []
|
|
},
|
|
"time": {
|
|
"from": "now-30d",
|
|
"to": "now"
|
|
},
|
|
"timepicker": {
|
|
"refresh_intervals": [
|
|
"5s",
|
|
"10s",
|
|
"30s",
|
|
"1m",
|
|
"5m",
|
|
"15m",
|
|
"30m",
|
|
"1h",
|
|
"2h",
|
|
"1d"
|
|
]
|
|
},
|
|
"timezone": "browser",
|
|
"title": "Panel Tests - Graph Time Regions",
|
|
"uid": "XMjIZPmik",
|
|
"weekStart": ""
|
|
} |