OpenFeature: Add debug logs (#112724)
This commit is contained in:
@@ -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))
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user