Angular: Rename autoMigrateGraphPanels feature flag to autoMigrateOldPanels (#65243)

This commit is contained in:
Ryan McKinley 2023-03-22 21:02:36 -07:00 committed by GitHub
parent 7835aacc8f
commit baf5a1d141
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 384 additions and 25 deletions

View File

@ -0,0 +1,346 @@
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"links": [
{
"asDropdown": false,
"icon": "dashboard",
"includeVars": false,
"keepTime": false,
"tags": [],
"targetBlank": true,
"title": "Auto migrate (TRUE)",
"tooltip": "",
"type": "link",
"url": "/d/cdd412c4/?__feature.autoMigrateOldPanels=true"
},
{
"asDropdown": false,
"icon": "external link",
"includeVars": false,
"keepTime": false,
"tags": [],
"targetBlank": true,
"title": "Auto migrate (FALSE)",
"tooltip": "",
"type": "link",
"url": "/d/cdd412c4/?__feature.autoMigrateOldPanels=false"
}
],
"liveNow": false,
"panels": [
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": {
"type": "testdata",
"uid": "PD8C576611E62080A"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "never",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "short"
},
"overrides": []
},
"fill": 1,
"fillGradient": 0,
"gridPos": {
"h": 11,
"w": 15,
"x": 0,
"y": 0
},
"hiddenSeries": false,
"id": 4,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"nullPointMode": "null",
"options": {
"alertThreshold": true,
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "multi",
"sort": "none"
}
},
"percentage": false,
"pluginVersion": "9.5.0-pre",
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"datasource": {
"type": "testdata",
"uid": "PD8C576611E62080A"
},
"refId": "A",
"scenarioId": "random_walk",
"seriesCount": 3
}
],
"thresholds": [],
"timeRegions": [],
"title": "Flot graph",
"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
}
},
{
"datasource": {
"type": "testdata",
"uid": "PD8C576611E62080A"
},
"gridPos": {
"h": 11,
"w": 9,
"x": 15,
"y": 0
},
"id": 6,
"options": {
"code": {
"language": "plaintext",
"showLineNumbers": false,
"showMiniMap": false
},
"content": "# Graph panel >> Timeseries panel\n\nKnown issues:\n* hiding null/empty series\n* time regions",
"mode": "markdown"
},
"pluginVersion": "9.5.0-pre",
"title": "Status + Notes",
"type": "text"
},
{
"columns": [],
"datasource": {
"type": "testdata",
"uid": "PD8C576611E62080A"
},
"fontSize": "100%",
"gridPos": {
"h": 10,
"w": 15,
"x": 0,
"y": 11
},
"id": 2,
"options": {
"cellHeight": "sm",
"footer": {
"countRows": false,
"fields": "",
"reducer": [
"sum"
],
"show": false
},
"showHeader": true,
"showRowNums": false
},
"pluginVersion": "9.5.0-pre",
"showHeader": true,
"sort": {
"col": 0,
"desc": true
},
"styles": [
{
"alias": "Time",
"align": "auto",
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"pattern": "Time",
"type": "date"
},
{
"alias": "",
"align": "right",
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"decimals": 2,
"pattern": "/.*/",
"thresholds": [],
"type": "number",
"unit": "short"
}
],
"targets": [
{
"datasource": {
"type": "testdata",
"uid": "PD8C576611E62080A"
},
"refId": "A",
"scenarioId": "random_walk_table"
}
],
"title": "Table (old)",
"transform": "table",
"transformations": [
{
"id": "merge",
"options": {
"reducers": []
}
}
],
"type": "table-old"
},
{
"datasource": {
"type": "testdata",
"uid": "PD8C576611E62080A"
},
"gridPos": {
"h": 10,
"w": 9,
"x": 15,
"y": 11
},
"id": 7,
"options": {
"code": {
"language": "plaintext",
"showLineNumbers": false,
"showMiniMap": false
},
"content": "# Table (old) >> Table\n\nKnown issues:\n* wrapping text\n* style changes",
"mode": "markdown"
},
"pluginVersion": "9.5.0-pre",
"title": "Status + Notes",
"type": "text"
}
],
"refresh": "",
"schemaVersion": 35,
"style": "dark",
"tags": [
"gdev",
"migrations",
"angular"
],
"templating": {
"list": []
},
"time": {
"from": "now-6h",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "Devenv - Panel migrations",
"uid": "cdd412c4",
"version": 9,
"weekStart": ""
}

View File

@ -373,6 +373,13 @@ local dashboard = grafana.dashboard;
id: 0,
}
},
dashboard.new('migrations', import '../dev-dashboards/migrations/migrations.json') +
resource.addMetadata('folder', 'dev-dashboards') +
{
spec+: {
id: 0,
}
},
dashboard.new('mssql_fakedata', import '../dev-dashboards/datasource-mssql/mssql_fakedata.json') +
resource.addMetadata('folder', 'dev-dashboards') +
{

View File

@ -34,18 +34,18 @@ Some stable features are enabled by default. You can disable a stable feature by
## Beta feature toggles
| Feature toggle name | Description |
| --------------------------------- | ------------------------------------------------------------------------------- |
| `trimDefaults` | Use cue schema to remove values that will be applied automatically |
| `panelTitleSearch` | Search for dashboards using panel title |
| `prometheusAzureOverrideAudience` | Experimental. Allow override default AAD audience for Azure Prometheus endpoint |
| `migrationLocking` | Lock database during migrations |
| `newDBLibrary` | Use jmoiron/sqlx rather than xorm for a few backend services |
| `validateDashboardsOnSave` | Validate dashboard JSON POSTed to api/dashboards/db |
| `autoMigrateGraphPanels` | Replace the angular graph panel with timeseries |
| `topnav` | Displays new top nav and page layouts |
| `accessControlOnCall` | Access control primitives for OnCall |
| `alertingNoNormalState` | Stop maintaining state of alerts that are not firing |
| Feature toggle name | Description |
| --------------------------------- | ---------------------------------------------------------------------------------- |
| `trimDefaults` | Use cue schema to remove values that will be applied automatically |
| `panelTitleSearch` | Search for dashboards using panel title |
| `prometheusAzureOverrideAudience` | Experimental. Allow override default AAD audience for Azure Prometheus endpoint |
| `migrationLocking` | Lock database during migrations |
| `newDBLibrary` | Use jmoiron/sqlx rather than xorm for a few backend services |
| `validateDashboardsOnSave` | Validate dashboard JSON POSTed to api/dashboards/db |
| `autoMigrateOldPanels` | Migrate old angular panels to supported versions (graph, table-old, worldmap, etc) |
| `topnav` | Displays new top nav and page layouts |
| `accessControlOnCall` | Access control primitives for OnCall |
| `alertingNoNormalState` | Stop maintaining state of alerts that are not firing |
## Alpha feature toggles

View File

@ -43,7 +43,7 @@ export interface FeatureToggles {
traceToMetrics?: boolean;
newDBLibrary?: boolean;
validateDashboardsOnSave?: boolean;
autoMigrateGraphPanels?: boolean;
autoMigrateOldPanels?: boolean;
prometheusWideSeries?: boolean;
canvasPanelNesting?: boolean;
scenes?: boolean;

View File

@ -169,8 +169,8 @@ var (
Owner: grafanaAsCodeSquad,
},
{
Name: "autoMigrateGraphPanels",
Description: "Replace the angular graph panel with timeseries",
Name: "autoMigrateOldPanels",
Description: "Migrate old angular panels to supported versions (graph, table-old, worldmap, etc)",
State: FeatureStateBeta,
FrontendOnly: true,
Owner: grafanaDatavizSquad,

View File

@ -42,11 +42,17 @@ func ProvideManagerService(cfg *setting.Cfg, licensing licensing.Licensing) (*Fe
for key, val := range flags {
flag, ok := mgmt.flags[key]
if !ok {
flag = &FeatureFlag{
Name: key,
State: FeatureStateUnknown,
switch key {
// renamed the flag so it supports more panels
case "autoMigrateGraphPanels":
flag = mgmt.flags[FlagAutoMigrateOldPanels]
default:
flag = &FeatureFlag{
Name: key,
State: FeatureStateUnknown,
}
mgmt.flags[key] = flag
}
mgmt.flags[key] = flag
}
flag.Expression = fmt.Sprintf("%t", val) // true | false
}

View File

@ -24,7 +24,7 @@ datasourceQueryMultiStatus,alpha,@grafana/plugins-platform-backend,false,false,f
traceToMetrics,alpha,@grafana/observability-traces-and-profiling,false,false,false,true
newDBLibrary,beta,@grafana/backend-platform,false,false,false,false
validateDashboardsOnSave,beta,@grafana/grafana-as-code,false,false,true,false
autoMigrateGraphPanels,beta,@grafana/dataviz-squad,false,false,false,true
autoMigrateOldPanels,beta,@grafana/dataviz-squad,false,false,false,true
prometheusWideSeries,alpha,@grafana/observability-metrics,false,false,false,false
canvasPanelNesting,alpha,@grafana/dataviz-squad,false,false,false,true
scenes,alpha,@grafana/dashboards-squad,false,false,false,true

1 Name State Owner requiresDevMode RequiresLicense RequiresRestart FrontendOnly
24 traceToMetrics alpha @grafana/observability-traces-and-profiling false false false true
25 newDBLibrary beta @grafana/backend-platform false false false false
26 validateDashboardsOnSave beta @grafana/grafana-as-code false false true false
27 autoMigrateGraphPanels autoMigrateOldPanels beta @grafana/dataviz-squad false false false true
28 prometheusWideSeries alpha @grafana/observability-metrics false false false false
29 canvasPanelNesting alpha @grafana/dataviz-squad false false false true
30 scenes alpha @grafana/dashboards-squad false false false true

View File

@ -107,9 +107,9 @@ const (
// Validate dashboard JSON POSTed to api/dashboards/db
FlagValidateDashboardsOnSave = "validateDashboardsOnSave"
// FlagAutoMigrateGraphPanels
// Replace the angular graph panel with timeseries
FlagAutoMigrateGraphPanels = "autoMigrateGraphPanels"
// FlagAutoMigrateOldPanels
// Migrate old angular panels to supported versions (graph, table-old, worldmap, etc)
FlagAutoMigrateOldPanels = "autoMigrateOldPanels"
// FlagPrometheusWideSeries
// Enable wide series responses in the Prometheus datasource

View File

@ -237,13 +237,13 @@ export class PanelModel implements DataConfigSource, IPanelModel {
switch (this.type) {
case 'graph':
if (config.featureToggles?.autoMigrateGraphPanels || !config.angularSupportEnabled) {
if (config.featureToggles?.autoMigrateOldPanels || !config.angularSupportEnabled) {
this.autoMigrateFrom = this.type;
this.type = 'timeseries';
}
break;
case 'table-old':
if (!config.angularSupportEnabled) {
if (config.featureToggles?.autoMigrateOldPanels || !config.angularSupportEnabled) {
this.autoMigrateFrom = this.type;
this.type = 'table';
}