a72e02f88a
**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)
461 lines
10 KiB
JSON
461 lines
10 KiB
JSON
{
|
|
"annotations": {
|
|
"list": [
|
|
{
|
|
"builtIn": 1,
|
|
"datasource": {
|
|
"type": "datasource",
|
|
"uid": "grafana"
|
|
},
|
|
"enable": true,
|
|
"hide": true,
|
|
"iconColor": "rgba(0, 211, 255, 1)",
|
|
"name": "Annotations \u0026 Alerts",
|
|
"target": {
|
|
"limit": 100,
|
|
"matchAny": false,
|
|
"tags": [],
|
|
"type": "dashboard"
|
|
},
|
|
"type": "dashboard"
|
|
}
|
|
]
|
|
},
|
|
"editable": true,
|
|
"fiscalYearStartMonth": 0,
|
|
"graphTooltip": 0,
|
|
"id": 79,
|
|
"links": [],
|
|
"liveNow": false,
|
|
"panels": [
|
|
{
|
|
"datasource": {
|
|
"type": "grafana-testdata-datasource"
|
|
},
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"color": {
|
|
"mode": "palette-classic"
|
|
},
|
|
"custom": {
|
|
"fillOpacity": 80,
|
|
"lineWidth": 1,
|
|
"spanNulls": false
|
|
},
|
|
"mappings": [
|
|
{
|
|
"options": {
|
|
"CRITICAL": {
|
|
"color": "red",
|
|
"index": 3
|
|
},
|
|
"HIGH": {
|
|
"color": "orange",
|
|
"index": 2
|
|
},
|
|
"LOW": {
|
|
"color": "blue",
|
|
"index": 0
|
|
},
|
|
"NORMAL": {
|
|
"color": "green",
|
|
"index": 1
|
|
}
|
|
},
|
|
"type": "value"
|
|
}
|
|
],
|
|
"thresholds": {
|
|
"mode": "absolute",
|
|
"steps": [
|
|
{
|
|
"color": "green"
|
|
},
|
|
{
|
|
"color": "red",
|
|
"value": 80
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"overrides": []
|
|
},
|
|
"gridPos": {
|
|
"h": 8,
|
|
"w": 24,
|
|
"x": 0,
|
|
"y": 0
|
|
},
|
|
"id": 9,
|
|
"options": {
|
|
"alignValue": "center",
|
|
"colWidth": 0.9,
|
|
"legend": {
|
|
"calcs": [],
|
|
"displayMode": "list",
|
|
"placement": "bottom",
|
|
"showLegend": true
|
|
},
|
|
"mergeValues": true,
|
|
"rowHeight": 0.98,
|
|
"showValue": "always",
|
|
"tooltip": {
|
|
"mode": "single",
|
|
"sort": "none"
|
|
}
|
|
},
|
|
"pluginVersion": "7.5.0-pre",
|
|
"targets": [
|
|
{
|
|
"alias": "SensorA",
|
|
"refId": "A",
|
|
"scenarioId": "csv_metric_values",
|
|
"stringInput": "LOW,HIGH,NORMAL,NORMAL,NORMAL,LOW,LOW,NORMAL,HIGH,CRITICAL"
|
|
},
|
|
{
|
|
"alias": "SensorB",
|
|
"hide": false,
|
|
"refId": "B",
|
|
"scenarioId": "csv_metric_values",
|
|
"stringInput": "NORMAL,LOW,LOW,CRITICAL,CRITICAL,LOW,LOW,NORMAL,HIGH,CRITICAL"
|
|
},
|
|
{
|
|
"alias": "SensorA",
|
|
"hide": false,
|
|
"refId": "C",
|
|
"scenarioId": "csv_metric_values",
|
|
"stringInput": "NORMAL,NORMAL,NORMAL,NORMAL,CRITICAL,LOW,NORMAL,NORMAL,NORMAL,LOW"
|
|
}
|
|
],
|
|
"title": "State changes strings",
|
|
"type": "state-timeline"
|
|
},
|
|
{
|
|
"datasource": {
|
|
"type": "grafana-testdata-datasource"
|
|
},
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"color": {
|
|
"mode": "thresholds"
|
|
},
|
|
"custom": {
|
|
"fillOpacity": 70,
|
|
"lineWidth": 1,
|
|
"spanNulls": false
|
|
},
|
|
"mappings": [
|
|
{
|
|
"options": {
|
|
"match": "true",
|
|
"result": {
|
|
"color": "semi-dark-green",
|
|
"index": 0,
|
|
"text": "ON"
|
|
}
|
|
},
|
|
"type": "special"
|
|
},
|
|
{
|
|
"options": {
|
|
"match": "false",
|
|
"result": {
|
|
"color": "red",
|
|
"index": 1,
|
|
"text": "OFF"
|
|
}
|
|
},
|
|
"type": "special"
|
|
}
|
|
],
|
|
"thresholds": {
|
|
"mode": "absolute",
|
|
"steps": [
|
|
{
|
|
"color": "green"
|
|
},
|
|
{
|
|
"color": "red",
|
|
"value": 80
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"overrides": []
|
|
},
|
|
"gridPos": {
|
|
"h": 11,
|
|
"w": 13,
|
|
"x": 0,
|
|
"y": 8
|
|
},
|
|
"id": 13,
|
|
"options": {
|
|
"alignValue": "center",
|
|
"colWidth": 1,
|
|
"legend": {
|
|
"displayMode": "list",
|
|
"placement": "bottom",
|
|
"showLegend": true
|
|
},
|
|
"mergeValues": true,
|
|
"mode": "changes",
|
|
"rowHeight": 0.98,
|
|
"showValue": "always",
|
|
"tooltip": {
|
|
"mode": "single",
|
|
"sort": "none"
|
|
}
|
|
},
|
|
"targets": [
|
|
{
|
|
"alias": "",
|
|
"refId": "A",
|
|
"scenarioId": "csv_metric_values",
|
|
"stringInput": "true,false,true,true,true,true,false,false"
|
|
},
|
|
{
|
|
"hide": false,
|
|
"refId": "B",
|
|
"scenarioId": "csv_metric_values",
|
|
"stringInput": "false,true,false,true,true,false,false,false,true,true"
|
|
},
|
|
{
|
|
"hide": false,
|
|
"refId": "C",
|
|
"scenarioId": "csv_metric_values",
|
|
"stringInput": "true,false,true,true"
|
|
},
|
|
{
|
|
"hide": false,
|
|
"refId": "D",
|
|
"scenarioId": "csv_metric_values",
|
|
"stringInput": "false,true,false,true,true"
|
|
}
|
|
],
|
|
"title": "State changes with boolean values",
|
|
"type": "state-timeline"
|
|
},
|
|
{
|
|
"datasource": {
|
|
"type": "grafana-testdata-datasource"
|
|
},
|
|
"description": "Should show gaps",
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"color": {
|
|
"mode": "thresholds"
|
|
},
|
|
"custom": {
|
|
"fillOpacity": 80,
|
|
"lineWidth": 1,
|
|
"spanNulls": false
|
|
},
|
|
"mappings": [
|
|
{
|
|
"options": {
|
|
"match": "true",
|
|
"result": {
|
|
"color": "semi-dark-green",
|
|
"index": 0,
|
|
"text": "ON"
|
|
}
|
|
},
|
|
"type": "special"
|
|
},
|
|
{
|
|
"options": {
|
|
"match": "false",
|
|
"result": {
|
|
"color": "red",
|
|
"index": 1,
|
|
"text": "OFF"
|
|
}
|
|
},
|
|
"type": "special"
|
|
}
|
|
],
|
|
"thresholds": {
|
|
"mode": "absolute",
|
|
"steps": [
|
|
{
|
|
"color": "green"
|
|
},
|
|
{
|
|
"color": "red",
|
|
"value": 80
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"overrides": []
|
|
},
|
|
"gridPos": {
|
|
"h": 11,
|
|
"w": 11,
|
|
"x": 13,
|
|
"y": 8
|
|
},
|
|
"id": 12,
|
|
"options": {
|
|
"alignValue": "center",
|
|
"colWidth": 1,
|
|
"legend": {
|
|
"displayMode": "list",
|
|
"placement": "bottom",
|
|
"showLegend": true
|
|
},
|
|
"mergeValues": true,
|
|
"mode": "changes",
|
|
"rowHeight": 0.98,
|
|
"showValue": "always",
|
|
"tooltip": {
|
|
"mode": "single",
|
|
"sort": "none"
|
|
}
|
|
},
|
|
"targets": [
|
|
{
|
|
"refId": "A",
|
|
"scenarioId": "csv_metric_values",
|
|
"stringInput": "true,false,true,true,true,true,false,false"
|
|
},
|
|
{
|
|
"hide": false,
|
|
"refId": "B",
|
|
"scenarioId": "csv_metric_values",
|
|
"stringInput": "false,true,false,true,true,false,false,false,true,true"
|
|
},
|
|
{
|
|
"hide": false,
|
|
"refId": "C",
|
|
"scenarioId": "csv_metric_values",
|
|
"stringInput": "true,false,null,true,true"
|
|
},
|
|
{
|
|
"hide": false,
|
|
"refId": "D",
|
|
"scenarioId": "csv_metric_values",
|
|
"stringInput": "false,null,null,false,true,true"
|
|
}
|
|
],
|
|
"title": "State changes with nulls",
|
|
"type": "state-timeline"
|
|
},
|
|
{
|
|
"datasource": {
|
|
"type": "grafana-testdata-datasource"
|
|
},
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"color": {
|
|
"mode": "continuous-GrYlRd"
|
|
},
|
|
"custom": {
|
|
"fillOpacity": 96,
|
|
"lineWidth": 0
|
|
},
|
|
"decimals": 0,
|
|
"mappings": [],
|
|
"max": 30,
|
|
"min": -10,
|
|
"thresholds": {
|
|
"mode": "absolute",
|
|
"steps": [
|
|
{
|
|
"color": "green"
|
|
},
|
|
{
|
|
"color": "red",
|
|
"value": 80
|
|
}
|
|
]
|
|
},
|
|
"unit": "short"
|
|
},
|
|
"overrides": []
|
|
},
|
|
"gridPos": {
|
|
"h": 12,
|
|
"w": 24,
|
|
"x": 0,
|
|
"y": 19
|
|
},
|
|
"id": 4,
|
|
"maxDataPoints": 20,
|
|
"options": {
|
|
"alignValue": "center",
|
|
"colWidth": 0.96,
|
|
"legend": {
|
|
"calcs": [],
|
|
"displayMode": "list",
|
|
"placement": "bottom",
|
|
"showLegend": true
|
|
},
|
|
"rowHeight": 0.98,
|
|
"showValue": "always",
|
|
"tooltip": {
|
|
"mode": "single",
|
|
"sort": "asc"
|
|
}
|
|
},
|
|
"pluginVersion": "7.5.0-pre",
|
|
"targets": [
|
|
{
|
|
"alias": "",
|
|
"csvWave": {
|
|
"timeStep": 60,
|
|
"valuesCSV": "0,0,2,2,1,1"
|
|
},
|
|
"lines": 10,
|
|
"max": 30,
|
|
"min": -10,
|
|
"noise": 2,
|
|
"points": [],
|
|
"pulseWave": {
|
|
"offCount": 3,
|
|
"offValue": 1,
|
|
"onCount": 3,
|
|
"onValue": 2,
|
|
"timeStep": 60
|
|
},
|
|
"refId": "A",
|
|
"scenarioId": "random_walk",
|
|
"seriesCount": 4,
|
|
"spread": 15,
|
|
"startValue": 5,
|
|
"stream": {
|
|
"bands": 1,
|
|
"noise": 2.2,
|
|
"speed": 250,
|
|
"spread": 3.5,
|
|
"type": "signal"
|
|
},
|
|
"stringInput": ""
|
|
}
|
|
],
|
|
"title": "Status map",
|
|
"type": "status-history"
|
|
}
|
|
],
|
|
"refresh": "",
|
|
"schemaVersion": 42,
|
|
"tags": [
|
|
"gdev",
|
|
"panel-tests",
|
|
"graph-ng",
|
|
"demo"
|
|
],
|
|
"templating": {
|
|
"list": []
|
|
},
|
|
"time": {
|
|
"from": "now-1h",
|
|
"to": "now"
|
|
},
|
|
"timepicker": {},
|
|
"timezone": "utc",
|
|
"title": "Timeline Demo",
|
|
"uid": "mIJjFy8Kz",
|
|
"weekStart": ""
|
|
} |