From e57e0769ca6238962cda15e6c8e75eb66022b41e Mon Sep 17 00:00:00 2001 From: Kyle Brandt Date: Mon, 24 Apr 2023 13:29:54 -0400 Subject: [PATCH] Prometheus: Enable prometheusDataplane by default (#67100) * Prometheus: Enable prometheusDataplane by default and related mitigation toggle dataplaneFrontendFallback original PRs with the toggles: - https://github.com/grafana/grafana/pull/65237 - https://github.com/grafana/grafana/pull/62694 --- .../feature-toggles/index.md | 130 +++++++++--------- .../src/types/featureToggles.gen.ts | 4 +- pkg/services/featuremgmt/registry.go | 30 ++-- pkg/services/featuremgmt/toggles_gen.csv | 6 +- pkg/services/featuremgmt/toggles_gen.go | 16 +-- 5 files changed, 94 insertions(+), 92 deletions(-) diff --git a/docs/sources/setup-grafana/configure-grafana/feature-toggles/index.md b/docs/sources/setup-grafana/configure-grafana/feature-toggles/index.md index 710bb0b2bc3..d8b6ea6be81 100644 --- a/docs/sources/setup-grafana/configure-grafana/feature-toggles/index.md +++ b/docs/sources/setup-grafana/configure-grafana/feature-toggles/index.md @@ -19,23 +19,25 @@ This page contains a list of available feature toggles. To learn how to turn on Some stable features are enabled by default. You can disable a stable feature by setting the feature flag to "false" in the configuration. -| Feature toggle name | Description | Enabled by default | -| ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ | -| `disableEnvelopeEncryption` | Disable envelope encryption (emergency only) | | -| `database_metrics` | Add Prometheus metrics for database tables | | -| `featureHighlights` | Highlight Grafana Enterprise features | | -| `cloudWatchDynamicLabels` | Use dynamic labels instead of alias patterns in CloudWatch datasource | Yes | -| `dataConnectionsConsole` | Enables a new top-level page called Connections. This page is an experiment that provides a better experience when you install and configure data sources and other plugins. | Yes | -| `internationalization` | Enables internationalization | Yes | -| `topnav` | Enables new top navigation and page layouts | Yes | -| `cloudWatchCrossAccountQuerying` | Enables cross-account querying in CloudWatch datasources | Yes | -| `newPanelChromeUI` | Show updated look and feel of grafana-ui PanelChrome: panel header, icons, and menu | Yes | -| `accessTokenExpirationCheck` | Enable OAuth access_token expiration check and token refresh using the refresh_token | | -| `emptyDashboardPage` | Enable the redesigned user interface of a dashboard page that includes no panels | Yes | -| `disablePrometheusExemplarSampling` | Disable Prometheus exemplar sampling | | -| `logsSampleInExplore` | Enables access to the logs sample feature in Explore | Yes | -| `logsContextDatasourceUi` | Allow datasource to provide custom UI for context view | Yes | -| `useCachingService` | When turned on, the new query and resource caching implementation using a wire service inject will be used in place of the previous middleware implementation | | +| Feature toggle name | Description | Enabled by default | +| ----------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ | +| `disableEnvelopeEncryption` | Disable envelope encryption (emergency only) | | +| `database_metrics` | Add Prometheus metrics for database tables | | +| `featureHighlights` | Highlight Grafana Enterprise features | | +| `cloudWatchDynamicLabels` | Use dynamic labels instead of alias patterns in CloudWatch datasource | Yes | +| `dataConnectionsConsole` | Enables a new top-level page called Connections. This page is an experiment that provides a better experience when you install and configure data sources and other plugins. | Yes | +| `internationalization` | Enables internationalization | Yes | +| `topnav` | Enables new top navigation and page layouts | Yes | +| `cloudWatchCrossAccountQuerying` | Enables cross-account querying in CloudWatch datasources | Yes | +| `newPanelChromeUI` | Show updated look and feel of grafana-ui PanelChrome: panel header, icons, and menu | Yes | +| `accessTokenExpirationCheck` | Enable OAuth access_token expiration check and token refresh using the refresh_token | | +| `emptyDashboardPage` | Enable the redesigned user interface of a dashboard page that includes no panels | Yes | +| `disablePrometheusExemplarSampling` | Disable Prometheus exemplar sampling | | +| `logsSampleInExplore` | Enables access to the logs sample feature in Explore | Yes | +| `logsContextDatasourceUi` | Allow datasource to provide custom UI for context view | Yes | +| `prometheusDataplane` | Changes responses to from Prometheus to be compliant with the dataplane specification. In particular it sets the numeric Field.Name from 'Value' to the value of the `__name__` label when present. | Yes | +| `dataplaneFrontendFallback` | Support dataplane contract field name change for transformations and field name matchers where the name is different | Yes | +| `useCachingService` | When turned on, the new query and resource caching implementation using a wire service inject will be used in place of the previous middleware implementation | | ## Beta feature toggles @@ -64,54 +66,52 @@ Some stable features are enabled by default. You can disable a stable feature by These features are early in their development lifecycle and so are not yet supported in Grafana Cloud. Alpha features might be changed or removed without prior notice. -| Feature toggle name | Description | -| ---------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `live-service-web-worker` | This will use a webworker thread to processes events rather than the main thread | -| `queryOverLive` | Use Grafana Live WebSocket to execute backend queries | -| `publicDashboards` | Enables public access to dashboards | -| `publicDashboardsEmailSharing` | Enables public dashboard sharing to be restricted to only allowed emails | -| `lokiLive` | Support WebSocket streaming for loki (early prototype) | -| `storage` | Configurable storage for dashboards, datasources, and resources | -| `newTraceViewHeader` | Shows the new trace view header | -| `datasourceQueryMultiStatus` | Introduce HTTP 207 Multi Status for api/ds/query | -| `traceToMetrics` | Enable trace to metrics links | -| `prometheusWideSeries` | Enable wide series responses in the Prometheus datasource | -| `canvasPanelNesting` | Allow elements nesting | -| `scenes` | Experimental framework to build interactive dashboards | -| `disableSecretsCompatibility` | Disable duplicated secret storage in legacy tables | -| `logRequestsInstrumentedAsUnknown` | Logs the path for requests that are instrumented as unknown | -| `redshiftAsyncQueryDataSupport` | Enable async query data support for Redshift | -| `athenaAsyncQueryDataSupport` | Enable async query data support for Athena | -| `showDashboardValidationWarnings` | Show warnings when dashboards do not validate against the schema | -| `mysqlAnsiQuotes` | Use double quotes to escape keyword in a MySQL query | -| `showTraceId` | Show trace ids for requests | -| `datasourceOnboarding` | Enable data source onboarding page | -| `authnService` | Use new auth service to perform authentication | -| `alertingBacktesting` | Rule backtesting API for alerting | -| `editPanelCSVDragAndDrop` | Enables drag and drop for CSV and Excel files | -| `lokiQuerySplitting` | Split large interval queries into subqueries with smaller time intervals | -| `lokiQuerySplittingConfig` | Give users the option to configure split durations for Loki queries | -| `individualCookiePreferences` | Support overriding cookie preferences per user | -| `onlyExternalOrgRoleSync` | Prohibits a user from changing organization roles synced with external auth providers | -| `traceqlSearch` | Enables the 'TraceQL Search' tab for the Tempo datasource which provides a UI to generate TraceQL queries | -| `prometheusMetricEncyclopedia` | Replaces the Prometheus query builder metric select option with a paginated and filterable component | -| `timeSeriesTable` | Enable time series table transformer & sparkline cell type | -| `prometheusResourceBrowserCache` | Displays browser caching options in Prometheus data source configuration | -| `influxdbBackendMigration` | Query InfluxDB InfluxQL without the proxy | -| `clientTokenRotation` | Replaces the current in-request token rotation so that the client initiates the rotation | -| `prometheusDataplane` | Changes responses to from Prometheus to be compliant with the dataplane specification. In particular it sets the numeric Field.Name from 'Value' to the value of the `__name__` label when present. | -| `lokiMetricDataplane` | Changes responses from Loki to be compliant with the dataplane specification. | -| `alertStateHistoryLokiSecondary` | Enable Grafana to write alert state history to an external Loki instance in addition to Grafana annotations. | -| `alertStateHistoryLokiPrimary` | Enable a remote Loki instance as the primary source for state history reads. | -| `alertStateHistoryLokiOnly` | Disable Grafana alerts from emitting annotations when a remote Loki instance is available. | -| `disableSSEDataplane` | Disables dataplane specific processing in server side expressions. | -| `unifiedRequestLog` | Writes error logs to the request logger | -| `pyroscopeFlameGraph` | Changes flame graph to pyroscope one | -| `dataplaneFrontendFallback` | Support dataplane contract field name change for transformations and field name matchers where the name is different | -| `authenticationConfigUI` | Enables authentication configuration UI | -| `pluginsAPIManifestKey` | Use grafana.com API to retrieve the public manifest key | -| `advancedDataSourcePicker` | Enable a new data source picker with contextual information, recently used order, CSV upload and advanced mode | -| `opensearchDetectVersion` | Enable version detection in OpenSearch | +| Feature toggle name | Description | +| ---------------------------------- | -------------------------------------------------------------------------------------------------------------- | +| `live-service-web-worker` | This will use a webworker thread to processes events rather than the main thread | +| `queryOverLive` | Use Grafana Live WebSocket to execute backend queries | +| `publicDashboards` | Enables public access to dashboards | +| `publicDashboardsEmailSharing` | Enables public dashboard sharing to be restricted to only allowed emails | +| `lokiLive` | Support WebSocket streaming for loki (early prototype) | +| `storage` | Configurable storage for dashboards, datasources, and resources | +| `newTraceViewHeader` | Shows the new trace view header | +| `datasourceQueryMultiStatus` | Introduce HTTP 207 Multi Status for api/ds/query | +| `traceToMetrics` | Enable trace to metrics links | +| `prometheusWideSeries` | Enable wide series responses in the Prometheus datasource | +| `canvasPanelNesting` | Allow elements nesting | +| `scenes` | Experimental framework to build interactive dashboards | +| `disableSecretsCompatibility` | Disable duplicated secret storage in legacy tables | +| `logRequestsInstrumentedAsUnknown` | Logs the path for requests that are instrumented as unknown | +| `redshiftAsyncQueryDataSupport` | Enable async query data support for Redshift | +| `athenaAsyncQueryDataSupport` | Enable async query data support for Athena | +| `showDashboardValidationWarnings` | Show warnings when dashboards do not validate against the schema | +| `mysqlAnsiQuotes` | Use double quotes to escape keyword in a MySQL query | +| `showTraceId` | Show trace ids for requests | +| `datasourceOnboarding` | Enable data source onboarding page | +| `authnService` | Use new auth service to perform authentication | +| `alertingBacktesting` | Rule backtesting API for alerting | +| `editPanelCSVDragAndDrop` | Enables drag and drop for CSV and Excel files | +| `lokiQuerySplitting` | Split large interval queries into subqueries with smaller time intervals | +| `lokiQuerySplittingConfig` | Give users the option to configure split durations for Loki queries | +| `individualCookiePreferences` | Support overriding cookie preferences per user | +| `onlyExternalOrgRoleSync` | Prohibits a user from changing organization roles synced with external auth providers | +| `traceqlSearch` | Enables the 'TraceQL Search' tab for the Tempo datasource which provides a UI to generate TraceQL queries | +| `prometheusMetricEncyclopedia` | Replaces the Prometheus query builder metric select option with a paginated and filterable component | +| `timeSeriesTable` | Enable time series table transformer & sparkline cell type | +| `prometheusResourceBrowserCache` | Displays browser caching options in Prometheus data source configuration | +| `influxdbBackendMigration` | Query InfluxDB InfluxQL without the proxy | +| `clientTokenRotation` | Replaces the current in-request token rotation so that the client initiates the rotation | +| `lokiMetricDataplane` | Changes responses from Loki to be compliant with the dataplane specification. | +| `disableSSEDataplane` | Disables dataplane specific processing in server side expressions. | +| `alertStateHistoryLokiSecondary` | Enable Grafana to write alert state history to an external Loki instance in addition to Grafana annotations. | +| `alertStateHistoryLokiPrimary` | Enable a remote Loki instance as the primary source for state history reads. | +| `alertStateHistoryLokiOnly` | Disable Grafana alerts from emitting annotations when a remote Loki instance is available. | +| `unifiedRequestLog` | Writes error logs to the request logger | +| `pyroscopeFlameGraph` | Changes flame graph to pyroscope one | +| `authenticationConfigUI` | Enables authentication configuration UI | +| `pluginsAPIManifestKey` | Use grafana.com API to retrieve the public manifest key | +| `advancedDataSourcePicker` | Enable a new data source picker with contextual information, recently used order, CSV upload and advanced mode | +| `opensearchDetectVersion` | Enable version detection in OpenSearch | ## Development feature toggles diff --git a/packages/grafana-data/src/types/featureToggles.gen.ts b/packages/grafana-data/src/types/featureToggles.gen.ts index 23af2306117..cc5d17e0578 100644 --- a/packages/grafana-data/src/types/featureToggles.gen.ts +++ b/packages/grafana-data/src/types/featureToggles.gen.ts @@ -83,15 +83,15 @@ export interface FeatureToggles { clientTokenRotation?: boolean; prometheusDataplane?: boolean; lokiMetricDataplane?: boolean; + dataplaneFrontendFallback?: boolean; + disableSSEDataplane?: boolean; alertStateHistoryLokiSecondary?: boolean; alertStateHistoryLokiPrimary?: boolean; alertStateHistoryLokiOnly?: boolean; - disableSSEDataplane?: boolean; unifiedRequestLog?: boolean; renderAuthJWT?: boolean; pyroscopeFlameGraph?: boolean; externalServiceAuth?: boolean; - dataplaneFrontendFallback?: boolean; useCachingService?: boolean; enableElasticsearchBackendQuerying?: boolean; authenticationConfigUI?: boolean; diff --git a/pkg/services/featuremgmt/registry.go b/pkg/services/featuremgmt/registry.go index b1f2bab21b1..03c2322dbb0 100644 --- a/pkg/services/featuremgmt/registry.go +++ b/pkg/services/featuremgmt/registry.go @@ -429,7 +429,8 @@ var ( { Name: "prometheusDataplane", Description: "Changes responses to from Prometheus to be compliant with the dataplane specification. In particular it sets the numeric Field.Name from 'Value' to the value of the `__name__` label when present.", - State: FeatureStateAlpha, + Expression: "true", + State: FeatureStateStable, Owner: grafanaObservabilityMetricsSquad, }, { @@ -438,6 +439,20 @@ var ( State: FeatureStateAlpha, Owner: grafanaObservabilityLogsSquad, }, + { + Name: "dataplaneFrontendFallback", + Description: "Support dataplane contract field name change for transformations and field name matchers where the name is different", + State: FeatureStateStable, + FrontendOnly: true, + Expression: "true", + Owner: grafanaObservabilityMetricsSquad, + }, + { + Name: "disableSSEDataplane", + Description: "Disables dataplane specific processing in server side expressions.", + State: FeatureStateAlpha, + Owner: grafanaObservabilityMetricsSquad, + }, { Name: "alertStateHistoryLokiSecondary", Description: "Enable Grafana to write alert state history to an external Loki instance in addition to Grafana annotations.", @@ -456,12 +471,6 @@ var ( State: FeatureStateAlpha, Owner: grafanaAlertingSquad, }, - { - Name: "disableSSEDataplane", - Description: "Disables dataplane specific processing in server side expressions.", - State: FeatureStateAlpha, - Owner: grafanaObservabilityMetricsSquad, - }, { Name: "unifiedRequestLog", Description: "Writes error logs to the request logger", @@ -487,13 +496,6 @@ var ( RequiresDevMode: true, Owner: grafanaAuthnzSquad, }, - { - Name: "dataplaneFrontendFallback", - Description: "Support dataplane contract field name change for transformations and field name matchers where the name is different", - State: FeatureStateAlpha, - FrontendOnly: true, - Owner: grafanaObservabilityMetricsSquad, - }, { Name: "useCachingService", Description: "When turned on, the new query and resource caching implementation using a wire service inject will be used in place of the previous middleware implementation", diff --git a/pkg/services/featuremgmt/toggles_gen.csv b/pkg/services/featuremgmt/toggles_gen.csv index dea4dac80d6..1e6bc7d7401 100644 --- a/pkg/services/featuremgmt/toggles_gen.csv +++ b/pkg/services/featuremgmt/toggles_gen.csv @@ -62,17 +62,17 @@ timeSeriesTable,alpha,@grafana/app-o11y,false,false,false,true prometheusResourceBrowserCache,alpha,@grafana/observability-metrics,false,false,false,true influxdbBackendMigration,alpha,@grafana/observability-metrics,false,false,false,true clientTokenRotation,alpha,@grafana/grafana-authnz-team,false,false,false,false -prometheusDataplane,alpha,@grafana/observability-metrics,false,false,false,false +prometheusDataplane,stable,@grafana/observability-metrics,false,false,false,false lokiMetricDataplane,alpha,@grafana/observability-logs,false,false,false,false +dataplaneFrontendFallback,stable,@grafana/observability-metrics,false,false,false,true +disableSSEDataplane,alpha,@grafana/observability-metrics,false,false,false,false alertStateHistoryLokiSecondary,alpha,@grafana/alerting-squad,false,false,false,false alertStateHistoryLokiPrimary,alpha,@grafana/alerting-squad,false,false,false,false alertStateHistoryLokiOnly,alpha,@grafana/alerting-squad,false,false,false,false -disableSSEDataplane,alpha,@grafana/observability-metrics,false,false,false,false unifiedRequestLog,alpha,@grafana/backend-platform,false,false,false,false renderAuthJWT,beta,@grafana/grafana-as-code,false,false,false,false pyroscopeFlameGraph,alpha,@grafana/observability-traces-and-profiling,false,false,false,false externalServiceAuth,alpha,@grafana/grafana-authnz-team,true,false,false,false -dataplaneFrontendFallback,alpha,@grafana/observability-metrics,false,false,false,true useCachingService,stable,@grafana/grafana-operator-experience-squad,false,false,true,false enableElasticsearchBackendQuerying,beta,@grafana/observability-logs,false,false,false,false authenticationConfigUI,alpha,@grafana/grafana-authnz-team,false,false,false,false diff --git a/pkg/services/featuremgmt/toggles_gen.go b/pkg/services/featuremgmt/toggles_gen.go index 4912944f700..24c98397d6e 100644 --- a/pkg/services/featuremgmt/toggles_gen.go +++ b/pkg/services/featuremgmt/toggles_gen.go @@ -267,6 +267,14 @@ const ( // Changes responses from Loki to be compliant with the dataplane specification. FlagLokiMetricDataplane = "lokiMetricDataplane" + // FlagDataplaneFrontendFallback + // Support dataplane contract field name change for transformations and field name matchers where the name is different + FlagDataplaneFrontendFallback = "dataplaneFrontendFallback" + + // FlagDisableSSEDataplane + // Disables dataplane specific processing in server side expressions. + FlagDisableSSEDataplane = "disableSSEDataplane" + // FlagAlertStateHistoryLokiSecondary // Enable Grafana to write alert state history to an external Loki instance in addition to Grafana annotations. FlagAlertStateHistoryLokiSecondary = "alertStateHistoryLokiSecondary" @@ -279,10 +287,6 @@ const ( // Disable Grafana alerts from emitting annotations when a remote Loki instance is available. FlagAlertStateHistoryLokiOnly = "alertStateHistoryLokiOnly" - // FlagDisableSSEDataplane - // Disables dataplane specific processing in server side expressions. - FlagDisableSSEDataplane = "disableSSEDataplane" - // FlagUnifiedRequestLog // Writes error logs to the request logger FlagUnifiedRequestLog = "unifiedRequestLog" @@ -299,10 +303,6 @@ const ( // Starts an OAuth2 authentication provider for external services FlagExternalServiceAuth = "externalServiceAuth" - // FlagDataplaneFrontendFallback - // Support dataplane contract field name change for transformations and field name matchers where the name is different - FlagDataplaneFrontendFallback = "dataplaneFrontendFallback" - // FlagUseCachingService // When turned on, the new query and resource caching implementation using a wire service inject will be used in place of the previous middleware implementation FlagUseCachingService = "useCachingService"