Scopes: Add more logging in custom handler (#93263)

scope api:add more logging in custom handler

Signed-off-by: bergquist <carl.bergquist@gmail.com>
This commit is contained in:
Carl Bergquist
2024-09-12 15:03:16 +03:00
committed by GitHub
parent 29243658ce
commit 350c227da6
2 changed files with 8 additions and 2 deletions
+5
View File
@@ -13,8 +13,11 @@ import (
"k8s.io/apiserver/pkg/registry/rest"
scope "github.com/grafana/grafana/pkg/apis/scope/v0alpha1"
"github.com/grafana/grafana/pkg/infra/log"
)
var logger = log.New("find-scopenode")
type findREST struct {
scopeNodeStorage *storage
}
@@ -90,6 +93,8 @@ func (r *findREST) Connect(ctx context.Context, name string, opts runtime.Object
filterAndAppendItem(item, parent, query, results)
}
logger.FromContext(req.Context()).Debug("find scopenode", "raw", len(all.Items), "filtered", len(results.Items))
responder.Object(200, results)
}), nil
}
@@ -5,13 +5,12 @@ import (
"fmt"
"net/http"
scope "github.com/grafana/grafana/pkg/apis/scope/v0alpha1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/apis/meta/internalversion"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apiserver/pkg/registry/rest"
scope "github.com/grafana/grafana/pkg/apis/scope/v0alpha1"
)
type findScopeDashboardsREST struct {
@@ -93,6 +92,8 @@ func (f *findScopeDashboardsREST) Connect(ctx context.Context, name string, opts
}
}
logger.FromContext(req.Context()).Debug("find scopedashboardbinding", "raw", len(all.Items), "filtered", len(results.Items))
responder.Object(200, results)
}), nil
}