Unified Storage Search: Add sprinkles (#97820)

* Wire up sprinkles to oss and enterprise. Fetching sprinkles not implemented yet.

* Adds wireset for initializing document builders. Had to init it when creating the service to avoid cyclical imports.

* updates to int64 for stats

* adds config for sprinklesApiServer and gets sprinkles from there when its present

* add comment for later

* adds feature toggle for sprinkles. returns empty results when flag not enabled.

* adds unified storage config setting for sprinkles apiserver page limit

* fixes bug where dashboard uid was not getting set

* when creating dashboard summary, use metadata.name as the dashboard uid

* cleans up wire. use existing oss and enterprise sets to generate doc builders

* remove old wireset

* fix linter - adds missing arg for doc builders

* update dashboard stats in tests

* updates test-data dashboards

* log a warning instead of returning an error if we can't get sprinkles for a namespace

* dont read uid from dashboard json
This commit is contained in:
owensmallwood
2024-12-18 11:00:54 -06:00
committed by GitHub
parent 54e603e552
commit 4837585cab
18 changed files with 108 additions and 38 deletions
+5 -1
View File
@@ -131,7 +131,11 @@ func (s *ModuleServer) Run() error {
//}
m.RegisterModule(modules.StorageServer, func() (services.Service, error) {
return sql.ProvideUnifiedStorageGrpcService(s.cfg, s.features, nil, s.log, nil)
docBuilders, err := InitializeDocumentBuilders(s.cfg)
if err != nil {
return nil, err
}
return sql.ProvideUnifiedStorageGrpcService(s.cfg, s.features, nil, s.log, nil, docBuilders)
})
m.RegisterModule(modules.ZanzanaServer, func() (services.Service, error) {
+6 -1
View File
@@ -8,6 +8,7 @@ package server
import (
"github.com/google/wire"
"github.com/grafana/grafana/pkg/storage/unified/resource"
sdkhttpclient "github.com/grafana/grafana-plugin-sdk-go/backend/httpclient"
@@ -229,7 +230,6 @@ var wireBasicSet = wire.NewSet(
wire.Bind(new(login.AuthInfoService), new(*authinfoimpl.Service)),
authinfoimpl.ProvideStore,
datasourceproxy.ProvideService,
unifiedsearch.ProvideDocumentBuilders,
search.ProvideService,
searchV2.ProvideService,
searchV2.ProvideSearchHTTPService,
@@ -475,3 +475,8 @@ func InitializeAPIServerFactory() (standalone.APIServerFactory, error) {
wire.Build(wireExtsStandaloneAPIServerSet)
return &standalone.NoOpAPIServerFactory{}, nil // Wire will replace this with a real interface
}
func InitializeDocumentBuilders(cfg *setting.Cfg) (resource.DocumentBuilderSupplier, error) {
wire.Build(wireExtsSet)
return &unifiedsearch.StandardDocumentBuilders{}, nil
}
+4
View File
@@ -6,6 +6,7 @@ package server
import (
"github.com/google/wire"
search2 "github.com/grafana/grafana/pkg/storage/unified/search"
"github.com/grafana/grafana/pkg/infra/metrics"
"github.com/grafana/grafana/pkg/plugins"
@@ -106,6 +107,9 @@ var wireExtsBasicSet = wire.NewSet(
wire.Bind(new(auth.IDSigner), new(*idimpl.LocalSigner)),
manager.ProvideInstaller,
wire.Bind(new(plugins.Installer), new(*manager.PluginInstaller)),
search2.ProvideDashboardStats,
wire.Bind(new(search2.DashboardStats), new(*search2.OssDashboardStats)),
search2.ProvideDocumentBuilders,
)
var wireExtsSet = wire.NewSet(