mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Elasticsearch: Run Explore queries trough data source backend (#65339)
Elasticsearch: Execute Explore queries trough backend
This commit is contained in:
parent
cb68b1e0d1
commit
f3da91f53f
@ -29,24 +29,25 @@ Some stable features are enabled by default. You can disable a stable feature by
|
||||
| `internationalization` | Enables internationalization | Yes |
|
||||
| `cloudWatchCrossAccountQuerying` | Enables cross-account querying in CloudWatch datasources | Yes |
|
||||
| `accessTokenExpirationCheck` | Enable OAuth access_token expiration check and token refresh using the refresh_token | |
|
||||
| `disablePrometheusExemplarSampling` | Disable Prometheus examplar sampling | |
|
||||
| `disablePrometheusExemplarSampling` | Disable Prometheus exemplar sampling | |
|
||||
| `logsSampleInExplore` | Enables access to the logs sample feature in Explore | Yes |
|
||||
|
||||
## 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 |
|
||||
| `autoMigrateOldPanels` | Migrate old angular panels to supported versions (graph, table-old, worldmap, etc) |
|
||||
| `disableAngular` | Dynamic flag to disable angular at runtime. The preferred method is to set `angular_support_enabled` to `false` in the [security] settings, which allows you to change the state at runtime. |
|
||||
| `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) |
|
||||
| `disableAngular` | Dynamic flag to disable angular at runtime. The preferred method is to set `angular_support_enabled` to `false` in the [security] settings, which allows you to change the state at runtime. |
|
||||
| `topnav` | Displays new top nav and page layouts |
|
||||
| `accessControlOnCall` | Access control primitives for OnCall |
|
||||
| `alertingNoNormalState` | Stop maintaining state of alerts that are not firing |
|
||||
| `disableElasticsearchBackendExploreQuery` | Disable executing of Elasticsearch Explore queries trough backend |
|
||||
|
||||
## Alpha feature toggles
|
||||
|
||||
|
@ -84,4 +84,5 @@ export interface FeatureToggles {
|
||||
timeSeriesTable?: boolean;
|
||||
influxdbBackendMigration?: boolean;
|
||||
clientTokenRotation?: boolean;
|
||||
disableElasticsearchBackendExploreQuery?: boolean;
|
||||
}
|
||||
|
@ -334,7 +334,7 @@ var (
|
||||
},
|
||||
{
|
||||
Name: "disablePrometheusExemplarSampling",
|
||||
Description: "Disable Prometheus examplar sampling",
|
||||
Description: "Disable Prometheus exemplar sampling",
|
||||
State: FeatureStateStable,
|
||||
Owner: grafanaObservabilityMetricsSquad,
|
||||
},
|
||||
@ -441,5 +441,11 @@ var (
|
||||
State: FeatureStateAlpha,
|
||||
Owner: grafanaAuthnzSquad,
|
||||
},
|
||||
{
|
||||
Name: "disableElasticsearchBackendExploreQuery",
|
||||
Description: "Disable executing of Elasticsearch Explore queries trough backend",
|
||||
State: FeatureStateBeta,
|
||||
Owner: grafanaObservabilityLogsSquad,
|
||||
},
|
||||
}
|
||||
)
|
||||
|
@ -65,3 +65,4 @@ prometheusMetricEncyclopedia,alpha,@grafana/observability-metrics,false,false,fa
|
||||
timeSeriesTable,alpha,@grafana/app-o11y,false,false,false,true
|
||||
influxdbBackendMigration,alpha,@grafana/observability-metrics,false,false,false,true
|
||||
clientTokenRotation,alpha,@grafana/grafana-authnz-team,false,false,false,false
|
||||
disableElasticsearchBackendExploreQuery,beta,@grafana/observability-logs,false,false,false,false
|
||||
|
|
@ -208,7 +208,7 @@ const (
|
||||
FlagAuthnService = "authnService"
|
||||
|
||||
// FlagDisablePrometheusExemplarSampling
|
||||
// Disable Prometheus examplar sampling
|
||||
// Disable Prometheus exemplar sampling
|
||||
FlagDisablePrometheusExemplarSampling = "disablePrometheusExemplarSampling"
|
||||
|
||||
// FlagAlertingBacktesting
|
||||
@ -270,4 +270,8 @@ const (
|
||||
// FlagClientTokenRotation
|
||||
// Replaces the current in-request token rotation so that the client initiates the rotation
|
||||
FlagClientTokenRotation = "clientTokenRotation"
|
||||
|
||||
// FlagDisableElasticsearchBackendExploreQuery
|
||||
// Disable executing of Elasticsearch Explore queries trough backend
|
||||
FlagDisableElasticsearchBackendExploreQuery = "disableElasticsearchBackendExploreQuery"
|
||||
)
|
||||
|
@ -641,8 +641,12 @@ export class ElasticDatasource
|
||||
}
|
||||
|
||||
query(request: DataQueryRequest<ElasticsearchQuery>): Observable<DataQueryResponse> {
|
||||
// Run request through backend if it is coming from Explore and disableElasticsearchBackendExploreQuery is not set
|
||||
// or if elasticsearchBackendMigration feature toggle is enabled
|
||||
const { elasticsearchBackendMigration, disableElasticsearchBackendExploreQuery } = config.featureToggles;
|
||||
const shouldRunTroughBackend =
|
||||
request.app === CoreApp.Explore && config.featureToggles.elasticsearchBackendMigration;
|
||||
(request.app === CoreApp.Explore && !disableElasticsearchBackendExploreQuery) || elasticsearchBackendMigration;
|
||||
|
||||
if (shouldRunTroughBackend) {
|
||||
const start = new Date();
|
||||
return super.query(request).pipe(tap((response) => trackQuery(response, request, start)));
|
||||
|
Loading…
Reference in New Issue
Block a user