diff --git a/operators/multiclusterobservability/controllers/multiclusterobservability/grafana.go b/operators/multiclusterobservability/controllers/multiclusterobservability/grafana.go index 75eb768cf..13551e9ff 100644 --- a/operators/multiclusterobservability/controllers/multiclusterobservability/grafana.go +++ b/operators/multiclusterobservability/controllers/multiclusterobservability/grafana.go @@ -54,6 +54,7 @@ type GrafanaDatasource struct { Type string `yaml:"type,omitempty"` URL string `yaml:"url,omitempty"` Version int `yaml:"version,omitempty"` + UID string `yaml:"uid,omitempty"` JSONData *JsonData `yaml:"jsonData,omitempty"` SecureJSONData *SecureJsonData `yaml:"secureJsonData,omitempty"` } @@ -101,6 +102,7 @@ func GenerateGrafanaDataSource( config.ProxyServiceName, config.GetDefaultNamespace(), ), + UID: "000000001", JSONData: &JsonData{ Timeout: "300", CustomQueryParameters: "max_source_resolution=auto", @@ -118,6 +120,7 @@ func GenerateGrafanaDataSource( config.ProxyServiceName, config.GetDefaultNamespace(), ), + UID: "000000002", JSONData: &JsonData{ Timeout: "300", CustomQueryParameters: "max_source_resolution=auto", diff --git a/tests/pkg/utils/mco_metric.go b/tests/pkg/utils/mco_metric.go index 05723eb05..763671a08 100644 --- a/tests/pkg/utils/mco_metric.go +++ b/tests/pkg/utils/mco_metric.go @@ -60,7 +60,7 @@ func (r GrafanaResponse) String() string { func QueryGrafana(opt TestOptions, query string) (*GrafanaResponse, error) { grafanaConsoleURL := GetGrafanaURL(opt) - path := "/api/datasources/proxy/1/api/v1/query?" + path := "/api/datasources/proxy/uid/000000001/api/v1/query?" queryParams := url.PathEscape(fmt.Sprintf("query=%s", query)) req, err := http.NewRequest( "GET", diff --git a/tests/run-in-kind/grafana/grafana-datasources-test.yaml b/tests/run-in-kind/grafana/grafana-datasources-test.yaml index eb2449982..d1f37bb83 100644 --- a/tests/run-in-kind/grafana/grafana-datasources-test.yaml +++ b/tests/run-in-kind/grafana/grafana-datasources-test.yaml @@ -16,6 +16,7 @@ stringData: version: 0 jsonData: null secureJsonData: null + uid: "000000001" kind: Secret metadata: name: grafana-datasources-test