From 271cdb4baa6d5b021e013b463350f227173c4e95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Farkas?= Date: Mon, 19 Jun 2023 12:03:51 +0200 Subject: [PATCH] loki: rename experimental feature flag (#70306) --- .../configure-grafana/feature-toggles/index.md | 2 +- packages/grafana-data/src/types/featureToggles.gen.ts | 2 +- pkg/services/featuremgmt/registry.go | 4 ++-- pkg/services/featuremgmt/toggles_gen.csv | 2 +- pkg/services/featuremgmt/toggles_gen.go | 6 +++--- .../plugins/datasource/loki/components/LokiOptionFields.tsx | 2 +- public/app/plugins/datasource/loki/datasource.ts | 6 +++++- 7 files changed, 14 insertions(+), 10 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 35adb9b4ee7..56a403f0b08 100644 --- a/docs/sources/setup-grafana/configure-grafana/feature-toggles/index.md +++ b/docs/sources/setup-grafana/configure-grafana/feature-toggles/index.md @@ -75,7 +75,7 @@ Experimental features might be changed or removed without prior notice. | ---------------------------------- | ------------------------------------------------------------------------------------------------------------ | | `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 | -| `lokiLive` | Support WebSocket streaming for loki (early prototype) | +| `lokiExperimentalStreaming` | Support new streaming approach for loki (prototype, needs special loki build) | | `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 | diff --git a/packages/grafana-data/src/types/featureToggles.gen.ts b/packages/grafana-data/src/types/featureToggles.gen.ts index 63cdb3ba10c..c1689c0b0f2 100644 --- a/packages/grafana-data/src/types/featureToggles.gen.ts +++ b/packages/grafana-data/src/types/featureToggles.gen.ts @@ -26,7 +26,7 @@ export interface FeatureToggles { prometheusAzureOverrideAudience?: boolean; publicDashboards?: boolean; publicDashboardsEmailSharing?: boolean; - lokiLive?: boolean; + lokiExperimentalStreaming?: boolean; featureHighlights?: boolean; migrationLocking?: boolean; storage?: boolean; diff --git a/pkg/services/featuremgmt/registry.go b/pkg/services/featuremgmt/registry.go index 2a453d80d46..5a413c6055b 100644 --- a/pkg/services/featuremgmt/registry.go +++ b/pkg/services/featuremgmt/registry.go @@ -62,8 +62,8 @@ var ( HideFromDocs: true, }, { - Name: "lokiLive", - Description: "Support WebSocket streaming for loki (early prototype)", + Name: "lokiExperimentalStreaming", + Description: "Support new streaming approach for loki (prototype, needs special loki build)", Stage: FeatureStageExperimental, Owner: grafanaObservabilityLogsSquad, }, diff --git a/pkg/services/featuremgmt/toggles_gen.csv b/pkg/services/featuremgmt/toggles_gen.csv index fc563b88b95..70449f198a9 100644 --- a/pkg/services/featuremgmt/toggles_gen.csv +++ b/pkg/services/featuremgmt/toggles_gen.csv @@ -7,7 +7,7 @@ panelTitleSearch,preview,@grafana/grafana-app-platform-squad,false,false,false,f prometheusAzureOverrideAudience,preview,@grafana/observability-metrics,false,false,false,false publicDashboards,preview,@grafana/dashboards-squad,false,false,false,false publicDashboardsEmailSharing,preview,@grafana/dashboards-squad,false,true,false,false -lokiLive,experimental,@grafana/observability-logs,false,false,false,false +lokiExperimentalStreaming,experimental,@grafana/observability-logs,false,false,false,false featureHighlights,GA,@grafana/grafana-as-code,false,false,false,false migrationLocking,preview,@grafana/backend-platform,false,false,false,false storage,experimental,@grafana/grafana-app-platform-squad,false,false,false,false diff --git a/pkg/services/featuremgmt/toggles_gen.go b/pkg/services/featuremgmt/toggles_gen.go index f783217a187..5bbef3e2074 100644 --- a/pkg/services/featuremgmt/toggles_gen.go +++ b/pkg/services/featuremgmt/toggles_gen.go @@ -39,9 +39,9 @@ const ( // Enables public dashboard sharing to be restricted to only allowed emails FlagPublicDashboardsEmailSharing = "publicDashboardsEmailSharing" - // FlagLokiLive - // Support WebSocket streaming for loki (early prototype) - FlagLokiLive = "lokiLive" + // FlagLokiExperimentalStreaming + // Support new streaming approach for loki (prototype, needs special loki build) + FlagLokiExperimentalStreaming = "lokiExperimentalStreaming" // FlagFeatureHighlights // Highlight Grafana Enterprise features diff --git a/public/app/plugins/datasource/loki/components/LokiOptionFields.tsx b/public/app/plugins/datasource/loki/components/LokiOptionFields.tsx index d5bb0cb4c92..109b28817b2 100644 --- a/public/app/plugins/datasource/loki/components/LokiOptionFields.tsx +++ b/public/app/plugins/datasource/loki/components/LokiOptionFields.tsx @@ -28,7 +28,7 @@ export const queryTypeOptions: Array> = [ }, ]; -if (config.featureToggles.lokiLive) { +if (config.featureToggles.lokiExperimentalStreaming) { queryTypeOptions.push({ value: LokiQueryType.Stream, label: 'Stream', diff --git a/public/app/plugins/datasource/loki/datasource.ts b/public/app/plugins/datasource/loki/datasource.ts index 54a1f87b328..c0da2484716 100644 --- a/public/app/plugins/datasource/loki/datasource.ts +++ b/public/app/plugins/datasource/loki/datasource.ts @@ -263,7 +263,11 @@ export class LokiDatasource }; const streamQueries = fixedRequest.targets.filter((q) => q.queryType === LokiQueryType.Stream); - if (config.featureToggles.lokiLive && streamQueries.length > 0 && fixedRequest.rangeRaw?.to === 'now') { + if ( + config.featureToggles.lokiExperimentalStreaming && + streamQueries.length > 0 && + fixedRequest.rangeRaw?.to === 'now' + ) { // this is still an in-development feature, // we do not support mixing stream-queries with normal-queries for now. const streamRequest = {