OpenFeature: Add context attributes to frontend settings (#112105)
* Update targeting key to namespace * Pass eval ctx attributes to frontend * Add context config to the frontend * Fix OF namespace not defined in e2e tests * Set default namespace and targeting key * remove e2e server config now that namespace is default --------- Co-authored-by: joshhunt <josh.hunt@grafana.com>
This commit is contained in:
@@ -40,7 +40,11 @@ func InitOpenFeatureWithCfg(cfg *setting.Cfg) error {
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to initialize OpenFeature: %w", err)
|
||||
}
|
||||
openfeature.SetEvaluationContext(openfeature.NewEvaluationContext(cfg.OpenFeature.TargetingKey, cfg.OpenFeature.ContextAttrs))
|
||||
contextAttrs := make(map[string]any)
|
||||
for k, v := range cfg.OpenFeature.ContextAttrs {
|
||||
contextAttrs[k] = v
|
||||
}
|
||||
openfeature.SetEvaluationContext(openfeature.NewEvaluationContext(cfg.OpenFeature.TargetingKey, contextAttrs))
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user