From d73bb12b9954e2a869cab65115ed8b0c2ce43b2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ida=20=C5=A0tambuk?= Date: Fri, 10 Jan 2025 23:23:23 +0100 Subject: [PATCH] Features: Remove cloudwatchMetricInsightsCrossAccount feature toggle (#98826) --- .../aws-cloudwatch/query-editor/index.md | 1 - .../feature-toggles/index.md | 1 - .../src/types/featureToggles.gen.ts | 1 - pkg/services/featuremgmt/registry.go | 8 ----- pkg/services/featuremgmt/toggles_gen.csv | 1 - pkg/services/featuremgmt/toggles_gen.go | 4 --- pkg/services/featuremgmt/toggles_gen.json | 1 + .../SQLBuilderEditor/SQLBuilderSelectRow.tsx | 35 ++++++++----------- .../SQLBuilderEditor/SQLFilter.tsx | 10 ++---- .../SQLBuilderEditor/SQLGroupBy.test.tsx | 15 +------- .../SQLBuilderEditor/SQLGroupBy.tsx | 4 +-- .../QueryEditor/QueryEditor.test.tsx | 9 ----- .../components/QueryEditor/QueryHeader.tsx | 12 ++----- 13 files changed, 21 insertions(+), 81 deletions(-) diff --git a/docs/sources/datasources/aws-cloudwatch/query-editor/index.md b/docs/sources/datasources/aws-cloudwatch/query-editor/index.md index fe44e0d7542..b65bd308e77 100644 --- a/docs/sources/datasources/aws-cloudwatch/query-editor/index.md +++ b/docs/sources/datasources/aws-cloudwatch/query-editor/index.md @@ -274,7 +274,6 @@ To enable cross-account observability, complete the following steps: Cross-account querying is available in the plugin through the **Logs**, **Metric search**, and **Metric Insights** modes. After you have it configured, you'll see a **Monitoring account** badge in the query editor header. -To support cross-account query building in the **Metric Insight** builder mode, the `cloudwatchMetricInsightsCrossAccount` feature toggle should be enabled. {{< figure src="/static/img/docs/cloudwatch/cloudwatch-monitoring-badge-9.3.0.png" max-width="1200px" caption="Monitoring account badge" >}} 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 09b70ac31e6..d7f0588df06 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,6 @@ Most [generally available](https://grafana.com/docs/release-life-cycle/#general- | `openSearchBackendFlowEnabled` | Enables the backend query flow for Open Search datasource plugin | Yes | | `alertingApiServer` | Register Alerting APIs with the K8s API server | Yes | | `cloudWatchRoundUpEndTime` | Round up end time for metric queries to the next minute to avoid missing data | Yes | -| `cloudwatchMetricInsightsCrossAccount` | Enables cross account observability for Cloudwatch Metric Insights query builder | Yes | | `newFiltersUI` | Enables new combobox style UI for the Ad hoc filters variable in scenes architecture | Yes | | `useSessionStorageForRedirection` | Use session storage for handling the redirection after login | Yes | | `userStorageAPI` | Enables the user storage API | Yes | diff --git a/packages/grafana-data/src/types/featureToggles.gen.ts b/packages/grafana-data/src/types/featureToggles.gen.ts index f1d6f6a6792..8625b8880c8 100644 --- a/packages/grafana-data/src/types/featureToggles.gen.ts +++ b/packages/grafana-data/src/types/featureToggles.gen.ts @@ -199,7 +199,6 @@ export interface FeatureToggles { enableScopesInMetricsExplore?: boolean; alertingApiServer?: boolean; cloudWatchRoundUpEndTime?: boolean; - cloudwatchMetricInsightsCrossAccount?: boolean; prometheusAzureOverrideAudience?: boolean; alertingFilterV2?: boolean; dataplaneAggregator?: boolean; diff --git a/pkg/services/featuremgmt/registry.go b/pkg/services/featuremgmt/registry.go index 2776923bbe7..81a96f9da58 100644 --- a/pkg/services/featuremgmt/registry.go +++ b/pkg/services/featuremgmt/registry.go @@ -1375,14 +1375,6 @@ var ( Owner: awsDatasourcesSquad, Expression: "true", }, - { - Name: "cloudwatchMetricInsightsCrossAccount", - Description: "Enables cross account observability for Cloudwatch Metric Insights query builder", - Stage: FeatureStageGeneralAvailability, - Owner: awsDatasourcesSquad, - FrontendOnly: true, - Expression: "true", - }, { Name: "prometheusAzureOverrideAudience", Description: "Deprecated. Allow override default AAD audience for Azure Prometheus endpoint. Enabled by default. This feature should no longer be used and will be removed in the future.", diff --git a/pkg/services/featuremgmt/toggles_gen.csv b/pkg/services/featuremgmt/toggles_gen.csv index 920edee152f..7f182d4b200 100644 --- a/pkg/services/featuremgmt/toggles_gen.csv +++ b/pkg/services/featuremgmt/toggles_gen.csv @@ -180,7 +180,6 @@ reloadDashboardsOnParamsChange,experimental,@grafana/dashboards-squad,false,fals enableScopesInMetricsExplore,experimental,@grafana/dashboards-squad,false,false,false alertingApiServer,GA,@grafana/alerting-squad,false,true,false cloudWatchRoundUpEndTime,GA,@grafana/aws-datasources,false,false,false -cloudwatchMetricInsightsCrossAccount,GA,@grafana/aws-datasources,false,false,true prometheusAzureOverrideAudience,deprecated,@grafana/partner-datasources,false,false,false alertingFilterV2,experimental,@grafana/alerting-squad,false,false,false dataplaneAggregator,experimental,@grafana/grafana-app-platform-squad,false,true,false diff --git a/pkg/services/featuremgmt/toggles_gen.go b/pkg/services/featuremgmt/toggles_gen.go index 15615506aca..b3aa97588cf 100644 --- a/pkg/services/featuremgmt/toggles_gen.go +++ b/pkg/services/featuremgmt/toggles_gen.go @@ -731,10 +731,6 @@ const ( // Round up end time for metric queries to the next minute to avoid missing data FlagCloudWatchRoundUpEndTime = "cloudWatchRoundUpEndTime" - // FlagCloudwatchMetricInsightsCrossAccount - // Enables cross account observability for Cloudwatch Metric Insights query builder - FlagCloudwatchMetricInsightsCrossAccount = "cloudwatchMetricInsightsCrossAccount" - // FlagPrometheusAzureOverrideAudience // Deprecated. Allow override default AAD audience for Azure Prometheus endpoint. Enabled by default. This feature should no longer be used and will be removed in the future. FlagPrometheusAzureOverrideAudience = "prometheusAzureOverrideAudience" diff --git a/pkg/services/featuremgmt/toggles_gen.json b/pkg/services/featuremgmt/toggles_gen.json index 36b6452c5ea..5ae300fe69b 100644 --- a/pkg/services/featuremgmt/toggles_gen.json +++ b/pkg/services/featuremgmt/toggles_gen.json @@ -869,6 +869,7 @@ "name": "cloudwatchMetricInsightsCrossAccount", "resourceVersion": "1729265619643", "creationTimestamp": "2024-07-02T10:34:12Z", + "deletionTimestamp": "2025-01-10T15:06:19Z", "annotations": { "grafana.app/updatedTimestamp": "2024-10-18 15:33:39.643165 +0000 UTC" } diff --git a/public/app/plugins/datasource/cloudwatch/components/QueryEditor/MetricsQueryEditor/SQLBuilderEditor/SQLBuilderSelectRow.tsx b/public/app/plugins/datasource/cloudwatch/components/QueryEditor/MetricsQueryEditor/SQLBuilderEditor/SQLBuilderSelectRow.tsx index d350e18bf66..dc7b6f8d7cf 100644 --- a/public/app/plugins/datasource/cloudwatch/components/QueryEditor/MetricsQueryEditor/SQLBuilderEditor/SQLBuilderSelectRow.tsx +++ b/public/app/plugins/datasource/cloudwatch/components/QueryEditor/MetricsQueryEditor/SQLBuilderEditor/SQLBuilderSelectRow.tsx @@ -53,10 +53,7 @@ const SQLBuilderSelectRow = ({ datasource, query, onQueryChange }: SQLBuilderSel const metricOptions = useMetrics(datasource, { region: query.region, namespace, - ...(config.featureToggles.cloudWatchCrossAccountQuerying && - config.featureToggles.cloudwatchMetricInsightsCrossAccount - ? { accountId: query.accountId } - : {}), + ...(config.featureToggles.cloudWatchCrossAccountQuerying && { accountId: query.accountId }), }); const existingFilters = useMemo(() => stringArrayToDimensions(schemaLabels ?? []), [schemaLabels]); const unusedDimensionKeys = useDimensionKeys(datasource, { @@ -64,10 +61,7 @@ const SQLBuilderSelectRow = ({ datasource, query, onQueryChange }: SQLBuilderSel namespace, metricName, dimensionFilters: existingFilters, - ...(config.featureToggles.cloudWatchCrossAccountQuerying && - config.featureToggles.cloudwatchMetricInsightsCrossAccount - ? { accountId: query.accountId } - : {}), + ...(config.featureToggles.cloudWatchCrossAccountQuerying && { accountId: query.accountId }), }); const dimensionKeys = useMemo( () => (schemaLabels?.length ? [...unusedDimensionKeys, ...schemaLabels.map(toOption)] : unusedDimensionKeys), @@ -93,19 +87,18 @@ const SQLBuilderSelectRow = ({ datasource, query, onQueryChange }: SQLBuilderSel return ( <> - {config.featureToggles.cloudWatchCrossAccountQuerying && - config.featureToggles.cloudwatchMetricInsightsCrossAccount && ( - { - onQueryChange({ - ...query, - accountId, - }); - }} - /> - )} + {config.featureToggles.cloudWatchCrossAccountQuerying && ( + { + onQueryChange({ + ...query, + accountId, + }); + }} + /> + )}