OpenFeature: Add debug logs (#112724)

This commit is contained in:
Tania
2025-10-21 17:03:19 +02:00
committed by GitHub
parent e930b3e6c4
commit 451004d152
2 changed files with 5 additions and 2 deletions
+2
View File
@@ -251,6 +251,7 @@ func (b *APIBuilder) oneFlagHandler(w http.ResponseWriter, r *http.Request) {
r = r.WithContext(ctx)
b.logger.Debug("validating namespace in oneFlagHandler handler")
if !b.validateNamespace(r) {
_ = tracing.Errorf(span, namespaceMismatchMsg)
span.SetAttributes(semconv.HTTPStatusCode(http.StatusUnauthorized))
@@ -295,6 +296,7 @@ func (b *APIBuilder) allFlagsHandler(w http.ResponseWriter, r *http.Request) {
r = r.WithContext(ctx)
b.logger.Debug("validating namespace in allFlagsHandler handler")
if !b.validateNamespace(r) {
_ = tracing.Errorf(span, namespaceMismatchMsg)
span.SetAttributes(semconv.HTTPStatusCode(http.StatusUnauthorized))
+3 -2
View File
@@ -188,8 +188,9 @@ func (s *ServiceImpl) GetNavTree(c *contextmodel.ReqContext, prefs *pref.Prefere
treeRoot.RemoveSectionByID(navtree.NavIDCfg)
}
enabled := openfeature.NewDefaultClient().Boolean(ctx, featuremgmt.FlagPinNavItems, true, openfeature.TransactionContext(ctx))
if enabled && c.IsSignedIn {
flagDetails, err := openfeature.NewDefaultClient().BooleanValueDetails(ctx, featuremgmt.FlagPinNavItems, true, openfeature.TransactionContext(ctx))
s.log.Debug("flag evaluation: ", "flagDetails", flagDetails, "err", err)
if flagDetails.Value && c.IsSignedIn {
treeRoot.AddSection(&navtree.NavLink{
Text: "Bookmarks",
Id: navtree.NavIDBookmarks,