From 9bde3267bb332cd9add3ca07e8ff57a01ad1daa2 Mon Sep 17 00:00:00 2001 From: Will Assis <35489495+gassiss@users.noreply.github.com> Date: Wed, 1 Oct 2025 11:32:56 -0400 Subject: [PATCH] unified-storage: dont index -- Grafana -- datasource dashboard fields (#111774) * unified-storage: dont index -- Grafana -- datasource dashboard fields --- pkg/services/store/kind/dashboard/dashboard.go | 3 +++ .../check-string-datasource-id-info.json | 14 +------------- .../testdata/special-datasource-types-info.json | 16 +--------------- .../search/testdata/doc/dashboard-aaa-out.json | 7 ------- 4 files changed, 5 insertions(+), 35 deletions(-) diff --git a/pkg/services/store/kind/dashboard/dashboard.go b/pkg/services/store/kind/dashboard/dashboard.go index 3229acbe80d..d6000689c1a 100644 --- a/pkg/services/store/kind/dashboard/dashboard.go +++ b/pkg/services/store/kind/dashboard/dashboard.go @@ -334,6 +334,9 @@ func filterOutSpecialDatasources(dash *DashboardSummaryInfo) { case "-- Dashboard --": // The `Dashboard` datasource refers to the results of the query used in another panel continue + case "grafana": + // this is the uid for the -- Grafana -- datasource + continue default: dsRefs = append(dsRefs, ds) } diff --git a/pkg/services/store/kind/dashboard/testdata/check-string-datasource-id-info.json b/pkg/services/store/kind/dashboard/testdata/check-string-datasource-id-info.json index 136e20a8571..a6502144412 100644 --- a/pkg/services/store/kind/dashboard/testdata/check-string-datasource-id-info.json +++ b/pkg/services/store/kind/dashboard/testdata/check-string-datasource-id-info.json @@ -2,24 +2,12 @@ "id": 250, "title": "fast streaming", "tags": null, - "datasource": [ - { - "uid": "grafana", - "type": "datasource" - } - ], "panels": [ { "id": 3, "title": "Panel Title", "type": "timeseries", - "pluginVersion": "7.5.0-pre", - "datasource": [ - { - "uid": "grafana", - "type": "datasource" - } - ] + "pluginVersion": "7.5.0-pre" } ], "schemaVersion": 27, diff --git a/pkg/services/store/kind/dashboard/testdata/special-datasource-types-info.json b/pkg/services/store/kind/dashboard/testdata/special-datasource-types-info.json index 1f2fabff36f..37a7b893804 100644 --- a/pkg/services/store/kind/dashboard/testdata/special-datasource-types-info.json +++ b/pkg/services/store/kind/dashboard/testdata/special-datasource-types-info.json @@ -3,10 +3,6 @@ "title": "special ds", "tags": null, "datasource": [ - { - "uid": "grafana", - "type": "datasource" - }, { "uid": "dgd92lq7k", "type": "frser-sqlite-datasource" @@ -22,10 +18,6 @@ "title": "mixed ds with grafana ds", "type": "timeseries", "datasource": [ - { - "uid": "grafana", - "type": "datasource" - }, { "uid": "dgd92lq7k", "type": "frser-sqlite-datasource" @@ -45,13 +37,7 @@ { "id": 6, "title": "grafana ds", - "type": "timeseries", - "datasource": [ - { - "uid": "grafana", - "type": "datasource" - } - ] + "type": "timeseries" }, { "id": 2, diff --git a/pkg/storage/unified/search/testdata/doc/dashboard-aaa-out.json b/pkg/storage/unified/search/testdata/doc/dashboard-aaa-out.json index 5989ecb1804..a77725e2cc2 100644 --- a/pkg/storage/unified/search/testdata/doc/dashboard-aaa-out.json +++ b/pkg/storage/unified/search/testdata/doc/dashboard-aaa-out.json @@ -26,7 +26,6 @@ "createdBy": "user:be2g71ke8yoe8b", "fields": { "ds_types": [ - "datasource", "my-custom-plugin" ], "errors_last_1_days": 1, @@ -47,12 +46,6 @@ "kind": "DataSource", "name": "DSUID" }, - { - "relation": "depends-on", - "group": "datasource", - "kind": "DataSource", - "name": "grafana" - }, { "relation": "depends-on", "group": "dashboards.grafana.app",