diff --git a/packages/grafana-data/src/types/featureToggles.gen.ts b/packages/grafana-data/src/types/featureToggles.gen.ts index c88173cf331..7e8ca9cf848 100644 --- a/packages/grafana-data/src/types/featureToggles.gen.ts +++ b/packages/grafana-data/src/types/featureToggles.gen.ts @@ -938,6 +938,10 @@ export interface FeatureToggles { */ metricsFromProfiles?: boolean; /** + * Enables creating alerts from Tempo data source + */ + tempoAlerting?: boolean; + /** * Enables auto-updating of users installed plugins */ pluginsAutoUpdate?: boolean; diff --git a/pkg/plugins/config/config.go b/pkg/plugins/config/config.go index d3a5392be4a..8a7be65e3bc 100644 --- a/pkg/plugins/config/config.go +++ b/pkg/plugins/config/config.go @@ -35,6 +35,9 @@ type Features struct { SriChecksEnabled bool PluginsCDNSyncLoaderEnabled bool LocalizationForPlugins bool + // Needed only until Tempo Alerting / metrics TraceQL is stable + // https://github.com/grafana/grafana/issues/106888 + TempoAlertingEnabled bool } // NewPluginManagementCfg returns a new PluginManagementCfg. diff --git a/pkg/services/featuremgmt/registry.go b/pkg/services/featuremgmt/registry.go index c6a388c9660..009190be1f4 100644 --- a/pkg/services/featuremgmt/registry.go +++ b/pkg/services/featuremgmt/registry.go @@ -1609,6 +1609,13 @@ var ( Owner: grafanaObservabilityTracesAndProfilingSquad, FrontendOnly: true, }, + { + Name: "tempoAlerting", + Description: "Enables creating alerts from Tempo data source", + Stage: FeatureStageExperimental, + Owner: grafanaObservabilityTracesAndProfilingSquad, + FrontendOnly: true, + }, { Name: "pluginsAutoUpdate", Description: "Enables auto-updating of users installed plugins", diff --git a/pkg/services/featuremgmt/toggles_gen.csv b/pkg/services/featuremgmt/toggles_gen.csv index d071dbd8d91..079fdfcfc62 100644 --- a/pkg/services/featuremgmt/toggles_gen.csv +++ b/pkg/services/featuremgmt/toggles_gen.csv @@ -210,6 +210,7 @@ localizationForPlugins,experimental,@grafana/plugins-platform-backend,false,fals unifiedNavbars,GA,@grafana/plugins-platform-backend,false,false,true logsPanelControls,preview,@grafana/observability-logs,false,false,true metricsFromProfiles,experimental,@grafana/observability-traces-and-profiling,false,false,true +tempoAlerting,experimental,@grafana/observability-traces-and-profiling,false,false,true pluginsAutoUpdate,experimental,@grafana/plugins-platform-backend,false,false,false multiTenantFrontend,experimental,@grafana/grafana-frontend-platform,false,false,false alertingListViewV2PreviewToggle,privatePreview,@grafana/alerting-squad,false,false,true diff --git a/pkg/services/featuremgmt/toggles_gen.go b/pkg/services/featuremgmt/toggles_gen.go index 9fbc4ee06fb..e5b5bb90af3 100644 --- a/pkg/services/featuremgmt/toggles_gen.go +++ b/pkg/services/featuremgmt/toggles_gen.go @@ -851,6 +851,10 @@ const ( // Enables creating metrics from profiles and storing them as recording rules FlagMetricsFromProfiles = "metricsFromProfiles" + // FlagTempoAlerting + // Enables creating alerts from Tempo data source + FlagTempoAlerting = "tempoAlerting" + // FlagPluginsAutoUpdate // Enables auto-updating of users installed plugins FlagPluginsAutoUpdate = "pluginsAutoUpdate" diff --git a/pkg/services/featuremgmt/toggles_gen.json b/pkg/services/featuremgmt/toggles_gen.json index e63024c3a52..94b96a800f5 100644 --- a/pkg/services/featuremgmt/toggles_gen.json +++ b/pkg/services/featuremgmt/toggles_gen.json @@ -2997,6 +2997,19 @@ "frontend": true } }, + { + "metadata": { + "name": "tempoAlerting", + "resourceVersion": "1750158458662", + "creationTimestamp": "2025-06-17T11:07:38Z" + }, + "spec": { + "description": "Enables creating alerts from Tempo data source", + "stage": "experimental", + "codeowner": "@grafana/observability-traces-and-profiling", + "frontend": true + } + }, { "metadata": { "name": "timeRangeProvider", diff --git a/pkg/services/pluginsintegration/pipeline/pipeline.go b/pkg/services/pluginsintegration/pipeline/pipeline.go index 2ffba23f4b5..1a564788287 100644 --- a/pkg/services/pluginsintegration/pipeline/pipeline.go +++ b/pkg/services/pluginsintegration/pipeline/pipeline.go @@ -6,6 +6,7 @@ import ( "github.com/grafana/grafana/pkg/infra/tracing" "github.com/grafana/grafana/pkg/plugins" "github.com/grafana/grafana/pkg/plugins/auth" + "github.com/grafana/grafana/pkg/plugins/backendplugin/coreplugin" "github.com/grafana/grafana/pkg/plugins/config" "github.com/grafana/grafana/pkg/plugins/envvars" "github.com/grafana/grafana/pkg/plugins/manager/loader/angular/angularinspector" @@ -41,9 +42,16 @@ func ProvideDiscoveryStage(cfg *config.PluginManagementCfg, pr registry.Service) } func ProvideBootstrapStage(cfg *config.PluginManagementCfg, sc plugins.SignatureCalculator, a *assetpath.Service) *bootstrap.Bootstrap { + disableAlertingForTempoDecorateFunc := func(ctx context.Context, p *plugins.Plugin) (*plugins.Plugin, error) { + if p.ID == coreplugin.Tempo && !cfg.Features.TempoAlertingEnabled { + p.Alerting = false + } + return p, nil + } + return bootstrap.New(cfg, bootstrap.Opts{ ConstructFunc: bootstrap.DefaultConstructFunc(cfg, sc, a), - DecorateFuncs: bootstrap.DefaultDecorateFuncs(cfg), + DecorateFuncs: append(bootstrap.DefaultDecorateFuncs(cfg), disableAlertingForTempoDecorateFunc), }) } diff --git a/pkg/services/pluginsintegration/pluginconfig/config.go b/pkg/services/pluginsintegration/pluginconfig/config.go index 9fd70c38d1a..1c8b2325a6d 100644 --- a/pkg/services/pluginsintegration/pluginconfig/config.go +++ b/pkg/services/pluginsintegration/pluginconfig/config.go @@ -35,6 +35,7 @@ func ProvidePluginManagementConfig(cfg *setting.Cfg, settingProvider setting.Pro SriChecksEnabled: features.IsEnabledGlobally(featuremgmt.FlagPluginsSriChecks), PluginsCDNSyncLoaderEnabled: features.IsEnabledGlobally(featuremgmt.FlagPluginsCDNSyncLoader), LocalizationForPlugins: features.IsEnabledGlobally(featuremgmt.FlagLocalizationForPlugins), + TempoAlertingEnabled: features.IsEnabledGlobally(featuremgmt.FlagTempoAlerting), }, cfg.GrafanaComAPIURL, cfg.DisablePlugins,