Alerting: Enable flag alertingApiServer by default (#98282)

* enable flag alertingApiServer by default
* remove feature flag toggle in integration tests
* disable flag for old API tests
This commit is contained in:
Yuri Tseretyan 2025-01-08 14:31:35 -05:00 committed by GitHub
parent 34c597b3b3
commit 3e68731600
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 31 additions and 31 deletions

View File

@ -74,6 +74,7 @@ Most [generally available](https://grafana.com/docs/release-life-cycle/#general-
| `pluginProxyPreserveTrailingSlash` | Preserve plugin proxy trailing slash. | |
| `pinNavItems` | Enables pinning of nav items | Yes |
| `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 |
@ -204,7 +205,6 @@ Experimental features might be changed or removed without prior notice.
| `alertingCentralAlertHistory` | Enables the new central alert history. |
| `sqlQuerybuilderFunctionParameters` | Enables SQL query builder function parameters |
| `failWrongDSUID` | Throws an error if a datasource has an invalid UIDs |
| `alertingApiServer` | Register Alerting APIs with the K8s API server |
| `dataplaneAggregator` | Enable grafana dataplane aggregator |
| `lokiSendDashboardPanelNames` | Send dashboard and panel names to Loki when querying |
| `alertingPrometheusRulesPrimary` | Uses Prometheus rules as the primary source of truth for ruler-enabled data sources |

View File

@ -1371,9 +1371,10 @@ var (
{
Name: "alertingApiServer",
Description: "Register Alerting APIs with the K8s API server",
Stage: FeatureStageExperimental,
Stage: FeatureStageGeneralAvailability,
Owner: grafanaAlertingSquad,
RequiresRestart: true,
Expression: "true",
},
{
Name: "cloudWatchRoundUpEndTime",

View File

@ -179,7 +179,7 @@ failWrongDSUID,experimental,@grafana/plugins-platform-backend,false,false,false
zanzana,experimental,@grafana/identity-access-team,false,false,false
reloadDashboardsOnParamsChange,experimental,@grafana/dashboards-squad,false,false,false
enableScopesInMetricsExplore,experimental,@grafana/dashboards-squad,false,false,false
alertingApiServer,experimental,@grafana/alerting-squad,false,true,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

1 Name Stage Owner requiresDevMode RequiresRestart FrontendOnly
179 zanzana experimental @grafana/identity-access-team false false false
180 reloadDashboardsOnParamsChange experimental @grafana/dashboards-squad false false false
181 enableScopesInMetricsExplore experimental @grafana/dashboards-squad false false false
182 alertingApiServer experimental GA @grafana/alerting-squad false true false
183 cloudWatchRoundUpEndTime GA @grafana/aws-datasources false false false
184 cloudwatchMetricInsightsCrossAccount GA @grafana/aws-datasources false false true
185 prometheusAzureOverrideAudience deprecated @grafana/partner-datasources false false false

View File

@ -118,14 +118,18 @@
{
"metadata": {
"name": "alertingApiServer",
"resourceVersion": "1718908755156",
"creationTimestamp": "2024-06-20T20:52:03Z"
"resourceVersion": "1734627512749",
"creationTimestamp": "2024-06-20T20:52:03Z",
"annotations": {
"grafana.app/updatedTimestamp": "2024-12-19 16:58:32.7498017 +0000 UTC"
}
},
"spec": {
"description": "Register Alerting APIs with the K8s API server",
"stage": "experimental",
"stage": "GA",
"codeowner": "@grafana/alerting-squad",
"requiresRestart": true
"requiresRestart": true,
"expression": "true"
}
},
{

View File

@ -17,6 +17,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/services/featuremgmt"
apimodels "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions"
"github.com/grafana/grafana/pkg/services/org"
"github.com/grafana/grafana/pkg/services/org/orgimpl"
@ -398,6 +399,7 @@ func TestIntegrationAlertmanagerConfigurationPersistSecrets(t *testing.T) {
EnableUnifiedAlerting: true,
DisableAnonymous: true,
AppModeProduction: true,
DisableFeatureToggles: []string{featuremgmt.FlagAlertingApiServer},
})
grafanaListedAddr, env := testinfra.StartGrafanaEnv(t, dir, path)

View File

@ -22,6 +22,7 @@ import (
"github.com/grafana/grafana/pkg/expr"
"github.com/grafana/grafana/pkg/infra/db"
"github.com/grafana/grafana/pkg/infra/tracing"
"github.com/grafana/grafana/pkg/services/featuremgmt"
apimodels "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions"
ngmodels "github.com/grafana/grafana/pkg/services/ngalert/models"
ngstore "github.com/grafana/grafana/pkg/services/ngalert/store"
@ -49,6 +50,9 @@ func TestIntegrationAMConfigAccess(t *testing.T) {
EnableUnifiedAlerting: true,
DisableAnonymous: true,
AppModeProduction: true,
DisableFeatureToggles: []string{
featuremgmt.FlagAlertingApiServer,
},
})
grafanaListedAddr, env := testinfra.StartGrafanaEnv(t, dir, path)

View File

@ -35,7 +35,6 @@ import (
"github.com/grafana/grafana/pkg/services/accesscontrol/resourcepermissions"
"github.com/grafana/grafana/pkg/services/authz/zanzana"
"github.com/grafana/grafana/pkg/services/dashboards"
"github.com/grafana/grafana/pkg/services/featuremgmt"
"github.com/grafana/grafana/pkg/services/folder/foldertest"
alertingac "github.com/grafana/grafana/pkg/services/ngalert/accesscontrol"
"github.com/grafana/grafana/pkg/services/ngalert/api"
@ -59,11 +58,7 @@ func TestMain(m *testing.M) {
}
func getTestHelper(t *testing.T) *apis.K8sTestHelper {
return apis.NewK8sTestHelper(t, testinfra.GrafanaOpts{
EnableFeatureToggles: []string{
featuremgmt.FlagAlertingApiServer,
},
})
return apis.NewK8sTestHelper(t, testinfra.GrafanaOpts{})
}
func TestIntegrationResourceIdentifier(t *testing.T) {

View File

@ -27,7 +27,6 @@ import (
"github.com/grafana/grafana/pkg/services/accesscontrol/resourcepermissions"
"github.com/grafana/grafana/pkg/services/authz/zanzana"
"github.com/grafana/grafana/pkg/services/dashboards"
"github.com/grafana/grafana/pkg/services/featuremgmt"
"github.com/grafana/grafana/pkg/services/folder/foldertest"
"github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions"
"github.com/grafana/grafana/pkg/services/ngalert/store"
@ -44,11 +43,7 @@ func TestMain(m *testing.M) {
}
func getTestHelper(t *testing.T) *apis.K8sTestHelper {
return apis.NewK8sTestHelper(t, testinfra.GrafanaOpts{
EnableFeatureToggles: []string{
featuremgmt.FlagAlertingApiServer,
},
})
return apis.NewK8sTestHelper(t, testinfra.GrafanaOpts{})
}
func TestIntegrationNotAllowedMethods(t *testing.T) {

View File

@ -22,7 +22,6 @@ import (
"github.com/grafana/grafana/pkg/services/accesscontrol/resourcepermissions"
"github.com/grafana/grafana/pkg/services/authz/zanzana"
"github.com/grafana/grafana/pkg/services/dashboards"
"github.com/grafana/grafana/pkg/services/featuremgmt"
"github.com/grafana/grafana/pkg/services/folder/foldertest"
"github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions"
"github.com/grafana/grafana/pkg/services/ngalert/store"
@ -38,11 +37,7 @@ func TestMain(m *testing.M) {
}
func getTestHelper(t *testing.T) *apis.K8sTestHelper {
return apis.NewK8sTestHelper(t, testinfra.GrafanaOpts{
EnableFeatureToggles: []string{
featuremgmt.FlagAlertingApiServer,
},
})
return apis.NewK8sTestHelper(t, testinfra.GrafanaOpts{})
}
func TestIntegrationResourceIdentifier(t *testing.T) {

View File

@ -28,7 +28,6 @@ import (
"github.com/grafana/grafana/pkg/services/accesscontrol/resourcepermissions"
"github.com/grafana/grafana/pkg/services/authz/zanzana"
"github.com/grafana/grafana/pkg/services/dashboards"
"github.com/grafana/grafana/pkg/services/featuremgmt"
"github.com/grafana/grafana/pkg/services/folder/foldertest"
"github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions"
ngmodels "github.com/grafana/grafana/pkg/services/ngalert/models"
@ -49,11 +48,7 @@ func TestMain(m *testing.M) {
}
func getTestHelper(t *testing.T) *apis.K8sTestHelper {
return apis.NewK8sTestHelper(t, testinfra.GrafanaOpts{
EnableFeatureToggles: []string{
featuremgmt.FlagAlertingApiServer,
},
})
return apis.NewK8sTestHelper(t, testinfra.GrafanaOpts{})
}
func TestIntegrationResourceIdentifier(t *testing.T) {

View File

@ -331,6 +331,14 @@ func CreateGrafDir(t *testing.T, opts GrafanaOpts) (string, string) {
_, err = featureSection.NewKey("enable", strings.Join(opts.EnableFeatureToggles, " "))
require.NoError(t, err)
}
if len(opts.DisableFeatureToggles) > 0 {
featureSection, err := cfg.NewSection("feature_toggles")
require.NoError(t, err)
for _, toggle := range opts.DisableFeatureToggles {
_, err = featureSection.NewKey(toggle, "false")
require.NoError(t, err)
}
}
if opts.NGAlertAdminConfigPollInterval != 0 {
ngalertingSection, err := cfg.NewSection("unified_alerting")
require.NoError(t, err)
@ -490,6 +498,7 @@ func SQLiteIntegrationTest(t *testing.T) {
type GrafanaOpts struct {
EnableCSP bool
EnableFeatureToggles []string
DisableFeatureToggles []string
NGAlertAdminConfigPollInterval time.Duration
NGAlertAlertmanagerConfigPollInterval time.Duration
NGAlertSchedulerBaseInterval time.Duration