Dashboard Migrations: V2 - legacy services.filter and graphite panel type (#112282)

* migrate to v2

* Fix tests

* graphite panels should be auto-migrated

* lint

* Provisioning: Fix dashboard export to preserve original API version

* Add error handling for the edge case where conversion fails but no
storedVersion is available.
This commit is contained in:
Haris Rozajac
2025-10-15 10:34:12 -06:00
committed by GitHub
parent 5b7e6ef2e1
commit d9067b27eb
13 changed files with 734 additions and 78 deletions
@@ -0,0 +1,89 @@
{
"schemaVersion": 1,
"title": "V2 Comprehensive Migration Test Dashboard",
"services": {
"filter": {
"time": {
"from": "now-6h",
"to": "now"
},
"list": [
{
"name": "server",
"type": "query",
"datasource": "prometheus",
"query": "label_values(server)"
},
{
"name": "env",
"type": "custom",
"options": [
{"text": "Production", "value": "prod"},
{"text": "Staging", "value": "stage"}
]
}
]
}
},
"panels": [
{
"id": 1,
"type": "graphite",
"title": "CPU Usage",
"legend": true,
"grid": {
"min": 0,
"max": 100
},
"y_format": "percent",
"y2_format": "short",
"targets": [
{
"refId": "A",
"target": "cpu.usage"
}
]
},
{
"id": 2,
"type": "graph",
"title": "Memory Usage",
"legend": false,
"grid": {
"min": 0
},
"y_format": "bytes",
"targets": [
{
"refId": "A",
"target": "memory.usage"
}
]
},
{
"id": 3,
"type": "table",
"title": "Server Stats",
"legend": true,
"grid": {
"min": 0,
"max": 100
},
"y_format": "short",
"y2_format": "bytes"
},
{
"id": 4,
"type": "graphite",
"title": "Disk I/O",
"legend": true,
"y2_format": "Bps",
"targets": [
{
"refId": "A",
"target": "disk.io"
}
]
}
]
}