Files
grafana/apps/dashboard/pkg/migration/conversion/testdata/input/v2alpha1.complete.json
Dominik Prokop 20b08ccaab Add v2beta1 api version: Consolidate schema breaking changes (#108172)
* Revert "Revert: Future-proofing query and data source model in Dashboard Sche… (#107985)"

This reverts commit 13a89d4ae3.

* Revert "Revert "Schema V2: Simplify annotations v1<->v2 conversions" (#107984)"

This reverts commit 2b8c5bea1a.

* make gen apps

* e2e update

* Use v2alpha2 by default (#108177)

* Use v2alpha2 by default

* Apply only DS changes to alpha2

* Use v2alpha2 by default except to query

* Create a v2 index in @grafana/schema

* Update path and apply lint

* Update tests

* Update imports to v2 status

* Fix failing openapi test

* Schemav2 breaking changes: conversion implementation (#108224)

* provision v2alpha1 dashboard

* Run conversions for DS refactor

* Run snapshot testing on conversions

* Normalize output name

* Update snapshots to include all panel and variable cases

* fix lint

* fix lint

* fix test and go lint

* more go lint

---------

Co-authored-by: Ivan Ortega <ivanortegaalba@gmail.com>
Co-authored-by: Haris Rozajac <haris.rozajac12@gmail.com>

* Schema v2: Introduce group/datasource convention to GroupBy and AdHoc variable (#108237)

* Schema v2: Introduce group/datasource convention to GroupBy and AdHoc variables

* add conversion

* App Installer: Authorizer support (#108419)

* Chore: use `satisfies` and remove a load of `any`s (#108397)

use satisfies and remove a load of anys

* improve logging and fail unified-storage migration with more than 0 errors (#108471)

improve logging and fail unified-storage migration with more than 0 errors

* fix conversion test

* Secrets: Create more granular fixed roles for SecureValues (#108382)

* Provisioning: Fix bug in job progress recording (#108440)

Fix bug in job progress recording

* Provisioning: Fix ImportAllPanelsFromLocalRepository test (#108441)

* Provisioning: Skip flaky test

* Fix flaky provisioning test

* Fix lint

---------

Co-authored-by: Roberto Jimenez Sanchez <roberto.jimenez@grafana.com>

* BulkDeleteProvisionedResource: Move progress bar into a second step (#108417)

* Move progress bar into a second step

---------

Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>

* [Dashboard Schema Codegen] Move dashboard CUE codegen block back up into kind body (#108476)

[Dashboard Schema Codegen] Move dashboard CUE codegen block back up into kind body to make sure new versions have the same settings.

---------

Co-authored-by: Haris Rozajac <haris.rozajac12@gmail.com>
Co-authored-by: Todd Treece <360020+toddtreece@users.noreply.github.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
Co-authored-by: Will Assis <35489495+gassiss@users.noreply.github.com>
Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>
Co-authored-by: Roberto Jiménez Sánchez <jszroberto@gmail.com>
Co-authored-by: Roberto Jimenez Sanchez <roberto.jimenez@grafana.com>
Co-authored-by: Yunwen Zheng <yunwen.zheng@grafana.com>
Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
Co-authored-by: Austin Pond <IfSentient@users.noreply.github.com>
Co-authored-by: Ivan Ortega <ivanortegaalba@gmail.com>

* Dashboard Schema V2: Refactor VizConfigKind to follow DataQueryKind convention (#108148)

* Dashboards API: Register v2alpha2 API

* Prepare conversion functions

* Fix test

* Refactor VizConfigKind to follow DataQueryKind convention

* fix tests

* use new dataquerykind convention alpha 2

* add conversion

* fix tests

* fix tests

* fix another test

* Fix merge

---------

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>

* fix k8s codegen

* Update e2e-playwright/dashboards/TestV2Dashboard.json

* Update e2e/dashboards/TestV2Dashboard.json

* revert app generation for non-related apps

* try again

* another try

* also revert folder and secret app generation

* v2alpha1 provisioned dashboard

* Fix kind

* Fix conversion snapshots

* Update API discovery registry

* Rename to v2beta1

* Rename migrations

* Update apps/dashboard/pkg/apis/dashboard/v2beta1/doc.go

Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>

* Ensure conditional rendering and other non changed properties

---------

Co-authored-by: Ivan Ortega <ivanortegaalba@gmail.com>
Co-authored-by: Haris Rozajac <haris.rozajac12@gmail.com>
Co-authored-by: Todd Treece <360020+toddtreece@users.noreply.github.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
Co-authored-by: Will Assis <35489495+gassiss@users.noreply.github.com>
Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>
Co-authored-by: Roberto Jiménez Sánchez <jszroberto@gmail.com>
Co-authored-by: Roberto Jimenez Sanchez <roberto.jimenez@grafana.com>
Co-authored-by: Yunwen Zheng <yunwen.zheng@grafana.com>
Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
Co-authored-by: Austin Pond <IfSentient@users.noreply.github.com>
Co-authored-by: Haris Rozajac <58232930+harisrozajac@users.noreply.github.com>
Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>
2025-07-30 15:01:27 +02:00

462 lines
12 KiB
JSON

{
"apiVersion": "dashboard.grafana.app/v2alpha1",
"kind": "Dashboard",
"metadata": {
"name": "test-v2alpha1-complete",
"labels": {
"category": "test"
},
"annotations": {
"description": "Complete example of v2alpha1 dashboard features"
}
},
"spec": {
"title": "Test: Complete V2alpha1 Dashboard Example",
"description": "This dashboard demonstrates all features that need to be converted from v2alpha1 to v2beta1",
"editable": true,
"liveNow": true,
"preload": true,
"cursorSync": "Tooltip",
"tags": ["test", "example", "migration"],
"annotations": [
{
"kind": "AnnotationQuery",
"spec": {
"builtIn": true,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": false,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"query": {
"kind": "grafana",
"spec": {
"limit": 100,
"matchAny": false,
"tags": [],
"type": "dashboard"
}
}
}
},
{
"kind": "AnnotationQuery",
"spec": {
"builtIn": false,
"datasource": {
"type": "prometheus",
"uid": "gdev-prometheus"
},
"enable": true,
"hide": false,
"iconColor": "yellow",
"name": "Prometheus Annotations",
"query": {
"kind": "prometheus",
"spec": {
"expr": "changes(process_start_time_seconds[1m])",
"refId": "Anno"
}
}
}
}
],
"variables": [
{
"kind": "QueryVariable",
"spec": {
"name": "prometheus_query",
"datasource": {
"type": "prometheus",
"uid": "gdev-prometheus"
},
"query": {
"kind": "prometheus",
"spec": {
"expr": "up"
}
},
"refresh": "time",
"regex": "",
"sort": "alphabetical",
"multi": true,
"includeAll": true,
"current": {
"text": "All",
"value": ["$__all"]
},
"hide": "dontHide",
"label": "Prometheus Query",
"description": "Shows all up metrics",
"skipUrlSync": false,
"definition": "up"
}
},
{
"kind": "TextVariable",
"spec": {
"name": "text_var",
"label": "Text Variable",
"description": "A simple text variable",
"query": "server1,server2,server3",
"current": {
"selected": true,
"text": "server1",
"value": "server1"
},
"hide": "dontHide",
"skipUrlSync": false
}
},
{
"kind": "ConstantVariable",
"spec": {
"name": "constant_var",
"label": "Constant",
"description": "A constant value",
"query": "production",
"current": {
"selected": true,
"text": "production",
"value": "production"
},
"hide": "dontHide",
"skipUrlSync": true
}
},
{
"kind": "DatasourceVariable",
"spec": {
"name": "ds_var",
"label": "Datasource",
"description": "Select a datasource",
"pluginId": "prometheus",
"refresh": "load",
"regex": "/^gdev-/",
"current": {
"text": "gdev-prometheus",
"value": "gdev-prometheus"
},
"options": [
{
"text": "gdev-prometheus",
"value": "gdev-prometheus"
}
],
"multi": false,
"includeAll": false,
"hide": "dontHide",
"skipUrlSync": false
}
},
{
"kind": "IntervalVariable",
"spec": {
"name": "interval",
"label": "Interval",
"description": "Time interval selection",
"query": "1m,5m,10m,30m,1h,6h,12h,1d",
"current": {
"selected": true,
"text": "5m",
"value": "5m"
},
"options": [
{
"text": "1m",
"value": "1m"
},
{
"text": "5m",
"value": "5m"
},
{
"text": "10m",
"value": "10m"
},
{
"text": "30m",
"value": "30m"
},
{
"text": "1h",
"value": "1h"
},
{
"text": "6h",
"value": "6h"
},
{
"text": "12h",
"value": "12h"
},
{
"text": "1d",
"value": "1d"
}
],
"auto": true,
"auto_min": "10s",
"auto_count": 30,
"refresh": "load",
"hide": "dontHide",
"skipUrlSync": false
}
},
{
"kind": "CustomVariable",
"spec": {
"name": "custom_var",
"label": "Custom Options",
"description": "Custom multi-value variable",
"query": "prod : Production, staging : Staging, dev : Development",
"current": {
"text": ["Production"],
"value": ["prod"]
},
"options": [
{
"text": "Production",
"value": "prod"
},
{
"text": "Staging",
"value": "staging"
},
{
"text": "Development",
"value": "dev"
}
],
"multi": true,
"includeAll": true,
"allValue": "*",
"hide": "dontHide",
"skipUrlSync": false,
"allowCustomValue": true
}
},
{
"kind": "GroupByVariable",
"spec": {
"name": "group_by",
"datasource": {
"type": "prometheus",
"uid": "gdev-prometheus"
},
"current": {
"text": "instance",
"value": "instance"
},
"description": "Group metrics by label",
"hide": "dontHide",
"label": "Group By"
}
},
{
"kind": "AdhocVariable",
"spec": {
"name": "filters",
"datasource": {
"type": "prometheus",
"uid": "gdev-prometheus"
},
"baseFilters": [
{
"key": "job",
"operator": "=",
"value": "grafana",
"condition": "AND"
}
],
"filters": [],
"hide": "dontHide",
"label": "Filters",
"defaultKeys": [
{
"text": "job",
"value": "job",
"expandable": true
},
{
"text": "instance",
"value": "instance",
"expandable": true
}
]
}
}
],
"elements": {
"panel-1": {
"kind": "Panel",
"spec": {
"id": 1,
"title": "Panel with Conditional Rendering",
"description": "This panel demonstrates conditional rendering features",
"data": {
"kind": "QueryGroup",
"spec": {
"queries": [
{
"kind": "PanelQuery",
"spec": {
"refId": "A",
"datasource": {
"uid": "gdev-prometheus"
},
"query": {
"kind": "prometheus",
"spec": {
"expr": "up{job=\"grafana\"}"
}
}
}
}
],
"transformations": [
{
"kind": "reduce",
"spec": {
"id": "reduce",
"options": {
"mode": "reduceFields",
"includeTimeField": false,
"reducers": ["mean"]
}
}
}
]
}
},
"vizConfig": {
"kind": "stat",
"spec": {
"pluginVersion": "12.1.0-pre",
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"textMode": "auto"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "red",
"value": 0
},
{
"color": "green",
"value": 1
}
]
},
"mappings": [
{
"type": "value",
"options": {
"0": {
"text": "Down",
"color": "red"
},
"1": {
"text": "Up",
"color": "green"
}
}
}
]
},
"overrides": []
}
}
}
}
}
},
"layout": {
"kind": "RowsLayout",
"spec": {
"rows": [
{
"kind": "Row",
"spec": {
"title": "Conditional Row",
"collapse": false,
"hideHeader": false,
"fillScreen": false,
"conditionalRendering": {
"kind": "ConditionalRenderingGroup",
"spec": {
"visibility": "show",
"condition": "and",
"items": [
{
"kind": "ConditionalRenderingVariable",
"spec": {
"variable": "group_by",
"operator": "includes",
"value": "instance"
}
},
{
"kind": "ConditionalRenderingData",
"spec": {
"value": true
}
},
{
"kind": "ConditionalRenderingTimeRangeSize",
"spec": {
"value": "1h"
}
}
]
}
},
"layout": {
"kind": "GridLayout",
"spec": {
"items": [
{
"kind": "GridLayoutItem",
"spec": {
"x": 0,
"y": 0,
"width": 24,
"height": 8,
"element": {
"kind": "ElementReference",
"name": "panel-1"
}
}
}
]
}
}
}
}
]
}
},
"timeSettings": {
"timezone": "browser",
"weekStart": "monday",
"fiscalYearStartMonth": 0,
"autoRefresh": "10s",
"autoRefreshIntervals": ["5s", "10s", "30s", "1m", "5m", "15m", "30m", "1h", "2h", "1d"],
"from": "now-6h",
"to": "now",
"hideTimepicker": false
}
}
}