OpenFeature: Add logs to MTFF namespace validation (#112331)

This commit is contained in:
Tania
2025-10-13 16:33:03 +02:00
committed by GitHub
parent 4e901b9317
commit 5e0af5f57c
+8 -1
View File
@@ -319,8 +319,12 @@ func writeResponse(statusCode int, result any, logger log.Logger, w http.Respons
}
func (b *APIBuilder) namespaceFromEvalCtx(body []byte) string {
// Extract namespace from request body without consuming it
// TODO: eval ctx should be added to span attributes, not log
// Adding it temporary for debugging
b.logger.Debug("evaluation context from request", "ctx", body)
var evalCtx struct {
// Extract namespace from request body without consuming it
Context struct {
Namespace string `json:"namespace"`
} `json:"context"`
@@ -331,6 +335,9 @@ func (b *APIBuilder) namespaceFromEvalCtx(body []byte) string {
return ""
}
// Adding it temporary for debugging
b.logger.Debug("evaluation context decoded", "namespace", evalCtx.Context.Namespace)
if evalCtx.Context.Namespace == "" {
b.logger.Debug("namespace missing from evaluation context", "namespace", evalCtx.Context.Namespace)
return ""