OpenFeature: Initialize early (#108594)

* Move OpenFeatureInit

* Remove unused import

* Remove todo
This commit is contained in:
Tania
2025-07-28 16:05:57 +02:00
committed by GitHub
parent 2e07475605
commit 27c395694d
3 changed files with 11 additions and 6 deletions
+6
View File
@@ -11,6 +11,7 @@ import (
"syscall"
"time"
"github.com/grafana/grafana/pkg/services/featuremgmt"
_ "github.com/grafana/pyroscope-go/godeltaprof/http/pprof"
"github.com/urfave/cli/v2"
@@ -105,6 +106,11 @@ func RunServer(opts standalone.BuildInfo, cli *cli.Context) error {
metrics.SetBuildInformation(metrics.ProvideRegisterer(), opts.Version, opts.Commit, opts.BuildBranch, getBuildstamp(opts))
// Initialize the OpenFeature feature flag system
if err := featuremgmt.InitOpenFeatureWithCfg(cfg); err != nil {
return err
}
s, err := server.Initialize(
cfg,
server.Options{
@@ -7,6 +7,7 @@ import (
"runtime/debug"
"strings"
"github.com/grafana/grafana/pkg/services/featuremgmt"
"github.com/urfave/cli/v2"
"github.com/grafana/grafana/pkg/api"
@@ -91,6 +92,10 @@ func RunTargetServer(opts standalone.BuildInfo, cli *cli.Context) error {
metrics.SetBuildInformation(metrics.ProvideRegisterer(), opts.Version, opts.Commit, opts.BuildBranch, getBuildstamp(opts))
// Initialize the OpenFeature client with the configuration
if err := featuremgmt.InitOpenFeatureWithCfg(cfg); err != nil {
return err
}
s, err := server.InitializeModuleServer(
cfg,
server.Options{
-6
View File
@@ -11,7 +11,6 @@ import (
"strconv"
"sync"
"github.com/grafana/grafana/pkg/services/featuremgmt"
"golang.org/x/sync/errgroup"
"github.com/prometheus/client_golang/prometheus"
@@ -132,11 +131,6 @@ func (s *Server) Init() error {
return err
}
// Initialize the OpenFeature feature flag system
if err := featuremgmt.InitOpenFeatureWithCfg(s.cfg); err != nil {
return err
}
return s.provisioningService.RunInitProvisioners(s.context)
}