mirror of https://github.com/grafana/grafana.git
Plugins: Expose datasources as apiservers feature toggle (#93250)
This commit is contained in:
parent
73eff837e8
commit
f21a5987a2
|
|
@ -145,6 +145,7 @@ Experimental features might be changed or removed without prior notice.
|
||||||
| `awsDatasourcesTempCredentials` | Support temporary security credentials in AWS plugins for Grafana Cloud customers |
|
| `awsDatasourcesTempCredentials` | Support temporary security credentials in AWS plugins for Grafana Cloud customers |
|
||||||
| `mlExpressions` | Enable support for Machine Learning in server-side expressions |
|
| `mlExpressions` | Enable support for Machine Learning in server-side expressions |
|
||||||
| `metricsSummary` | Enables metrics summary queries in the Tempo data source |
|
| `metricsSummary` | Enables metrics summary queries in the Tempo data source |
|
||||||
|
| `datasourceAPIServers` | Expose some datasources as apiservers. |
|
||||||
| `permissionsFilterRemoveSubquery` | Alternative permission filter implementation that does not use subqueries for fetching the dashboard folder |
|
| `permissionsFilterRemoveSubquery` | Alternative permission filter implementation that does not use subqueries for fetching the dashboard folder |
|
||||||
| `aiGeneratedDashboardChanges` | Enable AI powered features for dashboards to auto-summary changes when saving |
|
| `aiGeneratedDashboardChanges` | Enable AI powered features for dashboards to auto-summary changes when saving |
|
||||||
| `sseGroupByDatasource` | Send query to the same datasource in a single request when using server side expressions. The `cloudWatchBatchQueries` feature toggle should be enabled if this used with CloudWatch. |
|
| `sseGroupByDatasource` | Send query to the same datasource in a single request when using server side expressions. The `cloudWatchBatchQueries` feature toggle should be enabled if this used with CloudWatch. |
|
||||||
|
|
@ -206,8 +207,8 @@ Experimental features might be changed or removed without prior notice.
|
||||||
|
|
||||||
The following toggles require explicitly setting Grafana's [app mode]({{< relref "../_index.md#app_mode" >}}) to 'development' before you can enable this feature toggle. These features tend to be experimental.
|
The following toggles require explicitly setting Grafana's [app mode]({{< relref "../_index.md#app_mode" >}}) to 'development' before you can enable this feature toggle. These features tend to be experimental.
|
||||||
|
|
||||||
| Feature toggle name | Description |
|
| Feature toggle name | Description |
|
||||||
| -------------------------------------- | -------------------------------------------------------------- |
|
| -------------------------------------- | ----------------------------------------------------------------------------- |
|
||||||
| `grafanaAPIServerWithExperimentalAPIs` | Register experimental APIs with the k8s API server |
|
| `grafanaAPIServerWithExperimentalAPIs` | Register experimental APIs with the k8s API server, including all datasources |
|
||||||
| `grafanaAPIServerEnsureKubectlAccess` | Start an additional https handler and write kubectl options |
|
| `grafanaAPIServerEnsureKubectlAccess` | Start an additional https handler and write kubectl options |
|
||||||
| `panelTitleSearchInV1` | Enable searching for dashboards using panel title in search v1 |
|
| `panelTitleSearchInV1` | Enable searching for dashboards using panel title in search v1 |
|
||||||
|
|
|
||||||
|
|
@ -87,6 +87,7 @@ export interface FeatureToggles {
|
||||||
mlExpressions?: boolean;
|
mlExpressions?: boolean;
|
||||||
traceQLStreaming?: boolean;
|
traceQLStreaming?: boolean;
|
||||||
metricsSummary?: boolean;
|
metricsSummary?: boolean;
|
||||||
|
datasourceAPIServers?: boolean;
|
||||||
grafanaAPIServerWithExperimentalAPIs?: boolean;
|
grafanaAPIServerWithExperimentalAPIs?: boolean;
|
||||||
grafanaAPIServerEnsureKubectlAccess?: boolean;
|
grafanaAPIServerEnsureKubectlAccess?: boolean;
|
||||||
featureToggleAdminPage?: boolean;
|
featureToggleAdminPage?: boolean;
|
||||||
|
|
|
||||||
|
|
@ -58,8 +58,11 @@ func RegisterAPIService(
|
||||||
accessControl accesscontrol.AccessControl,
|
accessControl accesscontrol.AccessControl,
|
||||||
reg prometheus.Registerer,
|
reg prometheus.Registerer,
|
||||||
) (*DataSourceAPIBuilder, error) {
|
) (*DataSourceAPIBuilder, error) {
|
||||||
|
// We want to expose just a limited set of plugins
|
||||||
|
explictPluginList := features.IsEnabledGlobally(featuremgmt.FlagDatasourceAPIServers)
|
||||||
|
|
||||||
// This requires devmode!
|
// This requires devmode!
|
||||||
if !features.IsEnabledGlobally(featuremgmt.FlagGrafanaAPIServerWithExperimentalAPIs) {
|
if !(explictPluginList || features.IsEnabledGlobally(featuremgmt.FlagGrafanaAPIServerWithExperimentalAPIs)) {
|
||||||
return nil, nil // skip registration unless opting into experimental apis
|
return nil, nil // skip registration unless opting into experimental apis
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -73,7 +76,7 @@ func RegisterAPIService(
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, ds := range all {
|
for _, ds := range all {
|
||||||
if !slices.Contains(ids, ds.ID) {
|
if explictPluginList && !slices.Contains(ids, ds.ID) {
|
||||||
continue // skip this one
|
continue // skip this one
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -517,9 +517,16 @@ var (
|
||||||
FrontendOnly: true,
|
FrontendOnly: true,
|
||||||
Owner: grafanaObservabilityTracesAndProfilingSquad,
|
Owner: grafanaObservabilityTracesAndProfilingSquad,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Name: "datasourceAPIServers",
|
||||||
|
Description: "Expose some datasources as apiservers.",
|
||||||
|
Stage: FeatureStageExperimental,
|
||||||
|
Owner: grafanaAppPlatformSquad,
|
||||||
|
RequiresRestart: true, // changes the API routing
|
||||||
|
},
|
||||||
{
|
{
|
||||||
Name: "grafanaAPIServerWithExperimentalAPIs",
|
Name: "grafanaAPIServerWithExperimentalAPIs",
|
||||||
Description: "Register experimental APIs with the k8s API server",
|
Description: "Register experimental APIs with the k8s API server, including all datasources",
|
||||||
Stage: FeatureStageExperimental,
|
Stage: FeatureStageExperimental,
|
||||||
RequiresRestart: true,
|
RequiresRestart: true,
|
||||||
RequiresDevMode: true,
|
RequiresDevMode: true,
|
||||||
|
|
|
||||||
|
|
@ -68,6 +68,7 @@ transformationsRedesign,GA,@grafana/observability-metrics,false,false,true
|
||||||
mlExpressions,experimental,@grafana/alerting-squad,false,false,false
|
mlExpressions,experimental,@grafana/alerting-squad,false,false,false
|
||||||
traceQLStreaming,GA,@grafana/observability-traces-and-profiling,false,false,true
|
traceQLStreaming,GA,@grafana/observability-traces-and-profiling,false,false,true
|
||||||
metricsSummary,experimental,@grafana/observability-traces-and-profiling,false,false,true
|
metricsSummary,experimental,@grafana/observability-traces-and-profiling,false,false,true
|
||||||
|
datasourceAPIServers,experimental,@grafana/grafana-app-platform-squad,false,true,false
|
||||||
grafanaAPIServerWithExperimentalAPIs,experimental,@grafana/grafana-app-platform-squad,true,true,false
|
grafanaAPIServerWithExperimentalAPIs,experimental,@grafana/grafana-app-platform-squad,true,true,false
|
||||||
grafanaAPIServerEnsureKubectlAccess,experimental,@grafana/grafana-app-platform-squad,true,true,false
|
grafanaAPIServerEnsureKubectlAccess,experimental,@grafana/grafana-app-platform-squad,true,true,false
|
||||||
featureToggleAdminPage,experimental,@grafana/grafana-operator-experience-squad,false,true,false
|
featureToggleAdminPage,experimental,@grafana/grafana-operator-experience-squad,false,true,false
|
||||||
|
|
|
||||||
|
|
|
@ -283,8 +283,12 @@ const (
|
||||||
// Enables metrics summary queries in the Tempo data source
|
// Enables metrics summary queries in the Tempo data source
|
||||||
FlagMetricsSummary = "metricsSummary"
|
FlagMetricsSummary = "metricsSummary"
|
||||||
|
|
||||||
|
// FlagDatasourceAPIServers
|
||||||
|
// Expose some datasources as apiservers.
|
||||||
|
FlagDatasourceAPIServers = "datasourceAPIServers"
|
||||||
|
|
||||||
// FlagGrafanaAPIServerWithExperimentalAPIs
|
// FlagGrafanaAPIServerWithExperimentalAPIs
|
||||||
// Register experimental APIs with the k8s API server
|
// Register experimental APIs with the k8s API server, including all datasources
|
||||||
FlagGrafanaAPIServerWithExperimentalAPIs = "grafanaAPIServerWithExperimentalAPIs"
|
FlagGrafanaAPIServerWithExperimentalAPIs = "grafanaAPIServerWithExperimentalAPIs"
|
||||||
|
|
||||||
// FlagGrafanaAPIServerEnsureKubectlAccess
|
// FlagGrafanaAPIServerEnsureKubectlAccess
|
||||||
|
|
|
||||||
|
|
@ -909,6 +909,22 @@
|
||||||
"expression": "true"
|
"expression": "true"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"metadata": {
|
||||||
|
"name": "datasourceAPIServers",
|
||||||
|
"resourceVersion": "1726731672938",
|
||||||
|
"creationTimestamp": "2024-09-12T07:32:40Z",
|
||||||
|
"annotations": {
|
||||||
|
"grafana.app/updatedTimestamp": "2024-09-19 07:41:12.938146 +0000 UTC"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"spec": {
|
||||||
|
"description": "Expose some datasources as apiservers.",
|
||||||
|
"stage": "experimental",
|
||||||
|
"codeowner": "@grafana/grafana-app-platform-squad",
|
||||||
|
"requiresRestart": true
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"name": "datasourceProxyDisableRBAC",
|
"name": "datasourceProxyDisableRBAC",
|
||||||
|
|
@ -1327,11 +1343,14 @@
|
||||||
{
|
{
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"name": "grafanaAPIServerWithExperimentalAPIs",
|
"name": "grafanaAPIServerWithExperimentalAPIs",
|
||||||
"resourceVersion": "1718727528075",
|
"resourceVersion": "1726731672938",
|
||||||
"creationTimestamp": "2023-10-06T18:55:22Z"
|
"creationTimestamp": "2023-10-06T18:55:22Z",
|
||||||
|
"annotations": {
|
||||||
|
"grafana.app/updatedTimestamp": "2024-09-19 07:41:12.938146 +0000 UTC"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"spec": {
|
"spec": {
|
||||||
"description": "Register experimental APIs with the k8s API server",
|
"description": "Register experimental APIs with the k8s API server, including all datasources",
|
||||||
"stage": "experimental",
|
"stage": "experimental",
|
||||||
"codeowner": "@grafana/grafana-app-platform-squad",
|
"codeowner": "@grafana/grafana-app-platform-squad",
|
||||||
"requiresDevMode": true,
|
"requiresDevMode": true,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue