From 4cb9042e4cca67e43d255b8bc1c55ac9a4c1b512 Mon Sep 17 00:00:00 2001 From: owensmallwood Date: Fri, 21 Mar 2025 14:30:05 -0600 Subject: [PATCH] Unified Storage: Update docs for search and load tests (#102648) * add index on dashboard_tag table for dashboard_uid column * updates US docs for search and load tests * Update pkg/storage/unified/README.md Co-authored-by: Will Assis <35489495+gassiss@users.noreply.github.com> --------- Co-authored-by: Will Assis <35489495+gassiss@users.noreply.github.com> --- pkg/storage/unified/README.md | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/pkg/storage/unified/README.md b/pkg/storage/unified/README.md index f08da73b33a..8efde1c2c91 100644 --- a/pkg/storage/unified/README.md +++ b/pkg/storage/unified/README.md @@ -253,23 +253,24 @@ go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest - make changes in `.proto` file - to compile all protobuf files in the repository run `make protobuf` at its top level -## Setting up search (EXPERIMENTAL) -Unified storage now exposes an **experimental** search API. It can be used to search for specific resources, or to filter/query resources. +## Setting up search To enable it, add the following to your `custom.ini` under the `[feature_toggles]` section: ```ini [feature_toggles] +; Used by the Grafana instance +unifiedStorageSearchUI = true +kubernetesClientDashboardsFolders = true + +; Used by unified storage unifiedStorageSearch = true +; (optional) Allows you to sort dashboards by usage insights fields when using enterprise +; unifiedStorageSearchSprinkles = true +; (optional) Will skip search results filter based on user permissions +; unifiedStorageSearchPermissionFiltering = false ``` -To access the api through Grafana, go to Explore -> Query Type -> Search. +The dashboard search page has been set up to search unified storage. Additionally, all legacy search calls (e.g. `/api/search`) will go to +unified storage when the dual writer mode is set to 3 or greater. When <= 2, the legacy search api calls will go to legacy storage. -The query needs to be a valid [Bleve query string](https://blevesearch.com/docs/Query-String-Query/). - -Some example queries are: -- `*` - returns all objects -- `Kind:Playlist` - returns all playlists -- `Spec.inveral:5m` - returns all objects with the spec.inverval field set to 5m -- `+Kind:Playlist +Spec.title:p4` - returns all playlists with the title matching "p4" -- `*foo*` - returns all objects containing "foo" in any field -- `CreatedAt:>="2024-10-17"` - returns all objects created after 2024-10-17 -- `+CreatedAt:>="2024-10-17" +Kind:Playlist` - returns all playlists created after 2024-10-17 +## Running load tests +Load tests and instructions can be found [here](https://github.com/grafana/grafana-api-tests/tree/main/simulation/src/unified_storage).