PublicDashboards: Refresh ds plugin supported list (#74947)

This commit is contained in:
Juan Cabanas
2023-09-21 16:24:08 -03:00
committed by GitHub
parent 158c669d1a
commit 633605af4e
9 changed files with 111 additions and 33 deletions

View File

@@ -12,6 +12,11 @@ import (
var grafanaDatasources = []string{expr.DatasourceType, "datasource"}
// there are some datasources that have backend flag as true but don't call /ds/query endpoint
var unsupportedDataSourcesMap = map[string]bool{
"cloudwatch": true,
}
type listPluginResponse struct {
Items []struct {
Slug string `json:"slug"`
@@ -40,7 +45,7 @@ func GetCompatibleDatasources(baseUrl string) ([]string, error) {
// we only consider a datasource to be supported when alerting and backend are both true
var supported []string
for _, datasource := range datasources {
if datasource.Alerting && datasource.Backend {
if datasource.Alerting && datasource.Backend && !unsupportedDataSourcesMap[datasource.Slug] {
supported = append(supported, datasource.Slug)
}
}