OpenFeature: Initialize early (#108594)
* Move OpenFeatureInit * Remove unused import * Remove todo
This commit is contained in:
@@ -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{
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user