Bruno Abrantes
f3b8a891af
chore: use native histogram for search shadow traffic match percentage ( #109189 )
...
Signed-off-by: Bruno Abrantes <bruno@brunoabrantes.com >
2025-08-06 08:56:59 +02:00
Bruno Abrantes
cb921dc47a
feat: compare legacy and unified search results via histogram ( #109022 )
...
* feat: compare legacy and unified search results via histogram
Signed-off-by: Bruno Abrantes <bruno@brunoabrantes.com >
* fix: handle cases where request type is not set
Signed-off-by: Bruno Abrantes <bruno@brunoabrantes.com >
* fix: use struct instead of bool because it's more memory efficient
Signed-off-by: Bruno Abrantes <bruno@brunoabrantes.com >
* fix: calculate recall percentage rather than union between legacy and unified
Signed-off-by: Bruno Abrantes <bruno@brunoabrantes.com >
---------
Signed-off-by: Bruno Abrantes <bruno@brunoabrantes.com >
2025-08-05 11:17:32 +02:00
Stephanie Hingtgen
172a69da75
Feature toggle: Cleanup old ones ( #109072 )
2025-08-01 19:29:42 +00:00
Peter Štibraný
372f115db9
Finish building index even if original context is canceled. ( #108969 )
2025-07-31 13:45:55 +02:00
Serge Zaitsev
6b1143565a
Chore: Make cgo optional (for sqlite) ( #108756 )
...
* make cgo optional for sqlite
* update go.mod; check error code differently
* reduce api surface even more
* move test errors into sqlite package
* add a comment
2025-07-31 09:25:19 +00:00
Bruno Abrantes
91e5e8019d
chore: add documentation on unified search ( #108847 )
...
* chore: add documentation on unified search
Signed-off-by: Bruno Abrantes <bruno@brunoabrantes.com >
* fix: add additional needed feature flags for unified search
Signed-off-by: Bruno Abrantes <bruno@brunoabrantes.com >
* fix: add docs about index_min_count and index_max_count
Signed-off-by: Bruno Abrantes <bruno@brunoabrantes.com >
* fix: add documentation about sortable fields and the discrepancy with search/sortable
Signed-off-by: Bruno Abrantes <bruno@brunoabrantes.com >
* fix: kubernetesClientDashboardsFolders feature flag is no more, remove it from the docs
Signed-off-by: Bruno Abrantes <bruno@brunoabrantes.com >
* fix: simplify request flow diagrams
Signed-off-by: Bruno Abrantes <bruno@brunoabrantes.com >
---------
Signed-off-by: Bruno Abrantes <bruno@brunoabrantes.com >
2025-07-31 07:18:29 +00:00
Peter Štibraný
c28b2215e0
Improve indexing observability ( #108901 )
...
* Add details to tracing spans when creating index.
* Log reason for building index.
* Log reason for building index.
* Remove initialization of labels to avoid unnecessary metrics.
* Track succcessful, failed and skiped index builds. Track index build time for individual index, not all indexes.
* Revert removal of labels initialization.
2025-07-30 16:34:15 +02:00
Stephanie Hingtgen
1f025fe1a3
K8s: Remove kubernetesClientDashboardsFolders feature flag ( #108626 )
2025-07-29 16:52:57 -05:00
Peter Štibraný
41319f90bb
search: Handle index build errors gracefully ( #108862 )
...
* Close new index if we fail to build it.
* Respect context cancellation in getOrCreateIndex.
2025-07-29 17:40:16 +02:00
Peter Štibraný
d9daf2e424
search: Track number of open indexes per storage type. ( #108842 )
...
* Track number of open indexes per storage type.
* Fix tests after changing description.
2025-07-29 12:46:34 +02:00
Stephanie Hingtgen
38cdcb5efd
Unistore: Fix federated stats ( #108738 )
2025-07-29 10:42:20 +02:00
Will Assis
aa7ae5fc65
unified-storage: add tracing to distributor methods ( #108791 )
...
* add tracing to distributor methods
2025-07-28 12:35:20 -04:00
Bruno Abrantes
3a54c3abae
chore: adds documentation around the dual writer ( #108687 )
...
* chore: adds documentation around the dual writer
Signed-off-by: Bruno Abrantes <bruno@brunoabrantes.com >
* fix: innacuracies in error returned, disambiguate (validation) and move table upwards for more clarity
Signed-off-by: Bruno Abrantes <bruno@brunoabrantes.com >
---------
Signed-off-by: Bruno Abrantes <bruno@brunoabrantes.com >
2025-07-28 15:50:26 +02:00
Serge Zaitsev and Matheus Macabu
a95fb3a37c
Chore: Omit integration tests if short test flag is passed ( #108777 )
...
* omit integration tests if short test flag is passed
* Update pkg/services/ngalert/models/receivers_test.go
Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com >
* Update pkg/tests/api/alerting/api_ruler_test.go
Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com >
* Update pkg/tests/api/alerting/api_ruler_test.go
Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com >
* Update pkg/tests/api/alerting/api_ruler_test.go
Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com >
* Update pkg/tests/api/alerting/api_ruler_test.go
Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com >
* Update pkg/tests/api/alerting/api_ruler_test.go
Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com >
* Update pkg/services/ngalert/models/receivers_test.go
Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com >
* Update pkg/cmd/grafana-cli/commands/datamigrations/to_unified_storage_test.go
Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com >
* Update pkg/services/ngalert/models/receivers_test.go
Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com >
* fix the rest
* false positive
---------
Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com >
2025-07-28 13:38:54 +02:00
Will Assis
f67713726b
add debug logs to search server distributor ( #108679 )
2025-07-25 12:36:35 +00:00
Will Assis
183cd0843e
keep instance in the ring on shutdown ( #108609 )
2025-07-24 15:39:12 -04:00
Arati R. and Will Assis
16aee8047c
Unified Search: Randomise instance selected by distributor ( #108619 )
...
* Randomise instance selected by distributor
* add namespace to distributor logging
---------
Co-authored-by: Will Assis <william@williamassis.com >
2025-07-24 19:38:35 +00:00
Will Assis and Mustafa Sencer Özcan
981fdb29d4
update storage-api to only build index if it owns the namespace ( #108418 )
...
* update storage-api to only build index if it owns the namespace
---------
Co-authored-by: Mustafa Sencer Özcan <mustafasencer.ozcan@grafana.com >
2025-07-23 15:59:24 -04:00
Will Assis
34f1be796d
unified-storage: expose ring replication factor config ( #106345 )
...
* config ring replication factor
* change default
* rename
* fix test
* fix
2025-07-22 09:32:22 +02:00
Bruno Abrantes
6c84461b7a
fix: Always return searchWrapper to enable shadow traffic ( #108373 )
...
Signed-off-by: Bruno Abrantes <bruno@brunoabrantes.com >
2025-07-21 13:53:44 +02:00
maicon
4b440cf45d
Remove timeout info from logs when shadow request to search succeeds ( #108324 )
...
Signed-off-by: Maicon Costa <maiconscosta@gmail.com >
2025-07-18 14:03:42 +00:00
2dba473015
Feature/unified storage search dual reader ( #108291 )
...
* Add UnifiedStorageSearchDualReaderEnabled feature flag
Signed-off-by: Maicon Costa <maiconscosta@gmail.com >
* Refactor UniSearch Dual Reader
Signed-off-by: Maicon Costa <maiconscosta@gmail.com >
* Run make gen-feature-toggles
Signed-off-by: Maicon Costa <maiconscosta@gmail.com >
* fix: unit tests search_client
Signed-off-by: Bruno Abrantes <bruno@brunoabrantes.com >
* feat: cancels shadow search requests after 500ms
Signed-off-by: Bruno Abrantes <bruno@brunoabrantes.com >
---------
Signed-off-by: Maicon Costa <maiconscosta@gmail.com >
Signed-off-by: Bruno Abrantes <bruno@brunoabrantes.com >
Co-authored-by: Will Assis <william@williamassis.com >
Co-authored-by: Bruno Abrantes <bruno@brunoabrantes.com >
2025-07-18 14:43:56 +02:00
Mustafa Sencer Özcan
4a779c4ccb
fix: unified resource server list queries order column ( #108094 )
2025-07-16 08:09:31 +02:00
Mustafa Sencer Özcan
84a4ed612b
fix: re-order db initialization logic for resource server ( #108059 )
2025-07-14 10:25:42 +00:00
mohammad-hamid
2cd0be3cbd
Update authlib version ( #107939 )
...
* update authlib version
* add latest versions
* make update-workspace
* typo
* Trigger Build
* Trigger Build
2025-07-11 14:55:52 -04:00
Ryan McKinley
9786389ae8
SecureValues: Support inline secure values in GrafanaMetaAccessor ( #107996 )
2025-07-11 16:47:54 +00:00
Georges Chaudy
7002ab90ae
unistore: save returns a writecloser ( #107955 )
...
* unistore: save returns a writecloser
* go-lint
* address comments
2025-07-11 18:25:48 +02:00
Jean-Philippe Quéméner
602b7826c4
refactor(unified-storage): remove resource_server config option ( #107649 )
2025-07-11 15:33:51 +02:00
Georges Chaudy
ea0ddb3fc9
unistore: refactor get to return a reader ( #107951 )
2025-07-11 11:10:19 +02:00
Peter Štibraný
8fd5739576
[unified-storage/search] Don't expire file-based indexes, check for resource stats when building index on-demand ( #107886 )
...
* Get ResourceStats before indexing
* Replaced localcache.CacheService to handle expiration faster (localcache.CacheService / gocache.Cache only expires values at specific interval, but we need to close index faster)
* singleflight getOrBuildIndex for the same key
* expire only in-memory indexes
* file-based indexes have new name on each rebuild
* Sanitize file path segments, verify that generated path is within the root dir.
* Add comment and test for cleanOldIndexes.
2025-07-10 11:54:10 +00:00
Georges Chaudy
b6dd08da2f
unistore: fix delete and db closed in kv store ( #107918 )
...
* fix delete and db closed
* fix tests
2025-07-10 11:34:36 +02:00
Peter Štibraný
9d2eadcfd2
PoC: replace using testing.Short in storage/unified package with integration test skip method ( #107887 )
...
* PoC: check if testing.Short is called from integration tests only.
* Rename helper function.
* Fix logic.
* Remove skipping of integration tests from non-integration tests.
* Remove skipping of integration tests from non-integration tests.
* Fix import.
2025-07-09 15:32:10 +00:00
Ryan McKinley
3f502f305d
Chore: Update mocks with recent mockery ( #107816 )
2025-07-09 09:15:34 +02:00
Georges Chaudy
7787ff6b2e
unistore: add more kvstore tests ( #107692 )
...
add more kvstore tests
2025-07-07 15:00:40 +02:00
Arati R.
650abfd2ff
Unified Storage: Remove distributor todo comment ( #107623 )
...
Remove todo
2025-07-04 12:59:22 +00:00
Georges Chaudy
6bb74ff56a
unistore: add key validation ( #107622 )
2025-07-04 12:52:24 +00:00
Arati R.
dcb853d309
Unified Search: Remove resource-server-specific methods from distributor ( #107607 )
...
* Remove resource-server-specific methods from distributor
* Remove BlobStoreServer interface implementation from distributor
2025-07-04 12:48:27 +02:00
Georges Chaudy
8d8b824f73
unistore: skipping badger test failing atm ( #107572 )
...
skipping badger test failing atm
2025-07-03 12:31:07 +00:00
Mustafa Sencer Özcan
b7153d4d20
fix: grpc resource delete error when qos enabled ( #107560 )
2025-07-03 12:02:05 +02:00
Peter Štibraný
041c343a86
Unified storage: Respect GF_DATABASE_URL override ( #105331 )
...
* Database for unified storage resources now reuses DB code that respects URL override.
Access instrument_queries via section getter.
2025-07-03 09:57:40 +00:00
Peter Štibraný and Mustafa Sencer Özcan
e076c74869
sqltemplate, dbimpl: Remove single-method function types ( #107525 )
...
* Remove dbProviderFunc function.
This removes one extra indirection that made the code bit more difficult to navigate.
* Remove indirection function types implementing single-method interfaces.
This streamlines the code and makes it bit easier to navigate.
* Update pkg/storage/unified/sql/sqltemplate/dialect_mysql.go
Co-authored-by: Mustafa Sencer Özcan <32759850+mustafasencer@users.noreply.github.com >
---------
Co-authored-by: Mustafa Sencer Özcan <32759850+mustafasencer@users.noreply.github.com >
2025-07-03 10:38:12 +02:00
Georges Chaudy
d55541735a
unistore: use different ns for each test ( #107509 )
...
use different ns for each test
2025-07-02 13:50:30 +02:00
Georges Chaudy and Peter Štibraný
696657bdd1
unistore: add kv based storage backend ( #107305 )
...
* Add datastore
* too many slashes
* lint
* add metadata store
* simplify meta
* Add eventstore
* golint
* lint
* Add datastore
* too many slashes
* lint
* pr comments
* extract ParseKey
* readcloser
* remove get prefix
* use dedicated keys
* parsekey
* sameresource
* unrelated
* name
* renmae tests
* add key validation
* fix tests
* refactor a bit
* lint
* allow empty ns
* get keys instead of list
* rename the functions
* refactor yield candidate
* update test
* unistore: add LastResourceVersion to datastore
* lint
* use map string
* missing err check
* fix
* Add storage backend
* remove hasmore
* fix tests
* small refactor
* pre-alloc
* extract the folder
* lint
* refactor
* handle context canceled in ListHistory to pass the tests
* fix the resource test
* unistore: provide generic tests for the kv interface (#107443 )
unistore: move the kv tests to the testing package
* Update pkg/storage/unified/resource/storage_backend_test.go
Co-authored-by: Peter Štibraný <pstibrany@gmail.com >
* address comments
* comments
* comments
* comments
* normalise the names and add helper method
* events comments
* rename function
---------
Co-authored-by: Peter Štibraný <pstibrany@gmail.com >
2025-07-02 10:57:37 +00:00
Mustafa Sencer Özcan
3674d952a6
fix: use database section for resource server db engine configuration ( #107495 )
2025-07-02 09:00:51 +00:00
Will Assis
fe7ca61a51
unified-storage: Missing rename of index_server to search_server ( #107469 )
...
* rename
2025-07-01 14:35:46 -04:00
Will Assis
f09e85c048
unified-storage: Distributor rename to better reflect that it'll be used for search ( #107409 )
...
* rename distributor/ring references to "storage-api" to "search-server"
2025-07-01 11:15:10 -04:00
Jean-Philippe Quéméner
9a92900ef3
fix(unified-storage): remove 's' in config parameter ( #107457 )
2025-07-01 14:06:21 +02:00
Jean-Philippe Quéméner
d76e55371a
fix(unified-storage): use the provided connection config parameters ( #107455 )
...
* fix(unified-storage): use the provided connection config parameters
* extend tests
* make update-workspace
2025-07-01 11:25:16 +00:00
Mustafa Sencer Özcan
974a2c47f9
feat(unified-storage): add qos support for the resource server ( #105939 )
2025-07-01 09:22:55 +00:00
Georges Chaudy
46094a16c7
unistore: add LastResourceVersion to the datastore ( #107303 )
...
* Add datastore
* too many slashes
* lint
* add metadata store
* simplify meta
* Add eventstore
* golint
* lint
* Add datastore
* too many slashes
* lint
* pr comments
* extract ParseKey
* readcloser
* remove get prefix
* use dedicated keys
* parsekey
* sameresource
* unrelated
* name
* renmae tests
* add key validation
* fix tests
* refactor a bit
* lint
* allow empty ns
* get keys instead of list
* rename the functions
* refactor yield candidate
* update test
* unistore: add LastResourceVersion to datastore
* lint
* use map string
* missing err check
* fix
2025-06-30 15:49:26 +02:00