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>
This commit is contained in:
owensmallwood
2025-03-21 22:30:05 +02:00
committed by GitHub
co-authored by Will Assis
parent 64e939fd5d
commit 4cb9042e4c
+14 -13
View File
@@ -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).