Grafana indexing poc - load and watch index (#93843)

* list resources and load into index
* watch for changes and update index
This commit is contained in:
Scott Lepper
2024-10-08 09:43:23 -04:00
committed by GitHub
parent 0e13719ec6
commit 52b70ca976
9 changed files with 525 additions and 28 deletions
+3 -2
View File
@@ -32,6 +32,7 @@ func ProvideUnifiedStorageClient(
DataPath: apiserverCfg.Key("storage_path").MustString(filepath.Join(cfg.DataPath, "grafana-apiserver")),
Address: apiserverCfg.Key("address").MustString(""),
}
ctx := context.Background()
switch opts.StorageType {
case options.StorageTypeFile:
@@ -45,7 +46,7 @@ func ProvideUnifiedStorageClient(
if err != nil {
return nil, err
}
backend, err := resource.NewCDKBackend(context.Background(), resource.CDKBackendOptions{
backend, err := resource.NewCDKBackend(ctx, resource.CDKBackendOptions{
Bucket: bucket,
})
if err != nil {
@@ -76,7 +77,7 @@ func ProvideUnifiedStorageClient(
// Use the local SQL
default:
server, err := sql.NewResourceServer(db, cfg, features, tracer)
server, err := sql.NewResourceServer(ctx, db, cfg, features, tracer)
if err != nil {
return nil, err
}