From 5e0af5f57ce6d5fc2ece289df4729da6e817ed6c Mon Sep 17 00:00:00 2001 From: Tania <10127682+undef1nd@users.noreply.github.com> Date: Mon, 13 Oct 2025 16:33:03 +0200 Subject: [PATCH] OpenFeature: Add logs to MTFF namespace validation (#112331) --- pkg/registry/apis/ofrep/register.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkg/registry/apis/ofrep/register.go b/pkg/registry/apis/ofrep/register.go index b765bbadc32..49c755ecc92 100644 --- a/pkg/registry/apis/ofrep/register.go +++ b/pkg/registry/apis/ofrep/register.go @@ -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 ""