Commit Graph

959 Commits

Author SHA1 Message Date
Rafael Bortolon Paulovic
8c6ccdd1ab feat(dashboard): Org-aware cache for schema migration (#115025)
* fix: use dsIndexProvider cache on migrations

* chore: use same comment as before

* feat: org-aware TTL cache for schemaversion migration and warmup for single tenant

* chore: use LRU cache

* chore: change DefaultCacheTTL to 1 minute

* chore: address copilot reviews

* chore: use expirable cache

* chore: remove unused import
2025-12-10 16:09:16 +01:00
Nathan Marrs
6bbb00d0a2 Short URL: Change default expiration to never (#115029)
* Short Links: Change default expiration to never expire (-1)

Previously, short links defaulted to expiring after 7 days. This change
updates the default to -1 (never expire) to prevent automatic deletion
of shared dashboard links.

Changes:
- conf/defaults.ini: Set expire_time = -1 and update comment
- conf/sample.ini: Set expire_time = -1 and update comment
- pkg/setting/setting.go: Update MustInt default from 7 to -1

The cleanup logic already handles -1 correctly (only runs when > 0),
so no changes needed there.

This unblocks progress on short URL feature improvements by ensuring
shared links remain accessible indefinitely by default.

* fix go

* update docs / comments

* update missed comment in sample.ini

* Revert "fix go"

This reverts commit e0d099ae31.

* chore: update workspace dependencies

Run 'make update-workspace' to sync Go workspace dependencies.
This updates go.mod and go.sum files to match the current workspace state.

* chore: add modowner for apps/quotas dependency

Assign @grafana/grafana-search-and-storage as owner for apps/quotas
dependency to satisfy modowners CI check.
2025-12-09 20:23:27 +00:00
Mustafa Sencer Özcan
4c5d9cb95f feat: add unified storage data migration step for playlists (#114582)
* fix: add type

* feat: register step

* feat: add playlist support

* test: add test case

* fix: gen mock

* fix: go gen

* fix: lint

* fix: lint

* fix: tests

* fix: add resource

* fix: readd

* fix: address comments

* fix: independent playlist query for migrations

* fix: remove lock logic for sqlite

* fix: handle creation and update datetimes

* fix: query templating

* fix: simply resources and address comments
2025-12-04 15:15:00 +00:00
Rafael Bortolon Paulovic
31eaf1e898 chore: add log and metric before unified migration enforcement (#114598) 2025-12-01 17:56:59 +01:00
owensmallwood
df2f528612 Unified Storage: Adds overrides service to resource server (#113794)
* first pass of adding quotas service resource server

* passes prom reg as param

init quota service as part of server params

* init quota service as part of server params

* adds config and only creates quota service when overrides file path is defined

* when quota service enabled, check quota on create and log result

* update log message

* adds tests for quota service

* adds tests for config reloading when the file changes

* fix linter errors

* fix comment

* use startAndAwaitRunning

* Simplifies quotas service. Call manager.GetConfig() when getting quota instead of watching for changes.

* adds tracing to quotas service

* adds nsr attributes to traces when getting quotas and resource stats

* update comment

* update comment

remove check for nil overrides since it will (should) never happen

* fix linter error

* refactors naming to overrides service

checks quotas in separate function

* fix quotas naming

* fixes more quotas -> overrides naming

* use logger from ctx

* linter - remove trailing whitespace

* log FromContext() when checking quotas

* adds events to spans instead of create new spans

updates tenant -> namespace naming

few other minor fixes
2025-11-27 10:29:16 -06:00
maicon
7eb467e561 provisioning: acquire server lock before provisioning dashboards+folders (#114488)
* provisioning: acquire server lock before provisioning dashboards+folders

Signed-off-by: Maicon Costa <maiconscosta@gmail.com>

---------

Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
2025-11-26 16:24:34 -03:00
Matheus Macabu
0c965a9cb1 CloudMigrations: Remove feature toggle and introduce config setting to disable it (#114223) 2025-11-24 14:15:23 +01:00
Rafael Bortolon Paulovic
65fd15bbf9 feat: define unified disable migrations flag (#114120)
chore: add US data migrations config
2025-11-20 15:47:44 +01:00
Gareth
0efffd9ec8 Live: Add configuration for client_queue_max_size (#114225)
Live: add configuration for client_queue_max_size
2025-11-20 20:08:26 +09:00
Rafael Bortolon Paulovic
0fc0fb8db5 chore: move enable search to US configuration (#114070) 2025-11-18 17:32:25 +01:00
Matheus Macabu
4ee2112ea4 Secrets: Remove unused register_api_server setting (#113849) 2025-11-13 09:26:04 -08:00
Josh Hunt
96f34f8f56 EchoSrv: Enable auto route tracking for Azure App Insights (#113354)
* Echo: Enable auto route tracking with Azure App Insights

* Add server config option to disable auto route tracking

* fix not using minified js
2025-11-11 16:33:46 +00:00
Andres Martinez Gotor
1a2beae38a Preinstall: Replace auto update feature flag with a permanent one (#113586) 2025-11-10 15:06:30 +01:00
Alexander Zobnin
505e025d18 Zanzana: Fix namespace in remote client (#113433) 2025-11-05 11:12:41 +01:00
Michael Mandrus
cf242def3a Secrets: Refactor data_key_id out of the encoded secure value payload (#112077)
* Secrets: Refactor data_key_id out of the encoded secure value payload (#111852)

* everything compiles

* tests pass

* remove file included by accident

* add entry to gitignore

* some scaffolding for the migration executor

* remove file

* implement and test the migration

* use xkube.Namespace in our interfaces

* add todo

* update wire deps

* add some logs

* fix wire dependency ordering

* create tests to validate error conditions during migrations

* only run the migration as an MT api server

* formatting issues

* change detection of secrets running as MT server

* add todo

* use more specific initializer flags

* make secrets playwright tests work

* set new properties to true by default

* remove developer mode flag

* fix unit tests
2025-10-30 23:04:32 -04:00
Jack Baldry
1abb5aa0f9 Rename behavior related to the interactive learning plugin (#112752) 2025-10-22 09:06:21 +01:00
Ieva
0a0311a2b2 RBAC: Only write action sets (#112429)
* implementation + broken tests

* finish tests and cleanup

* fix a bug in logic where we'd return too early for non dash and folder resources
2025-10-20 16:02:56 +01:00
Matheus Macabu
93af167f9c Secrets: Add config for enabling gRPC client-side load balancing (#111989) 2025-10-20 14:04:59 +02:00
Hugo Häggmark
a30a71905e Chore: replace feature toggle filterOutBotsFromFrontendLogs with config (#112355)
* Chore: replace feature toggle with config

* chore: small fixes

* chore: updates after pr feedback

* chore: fixes writers toolkit error
2025-10-16 12:03:07 +00:00
maicon
3d112755de unistore: add timeout config for resource server joining the ring (#112392)
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
2025-10-14 15:27:08 -04:00
Jay Clifford
c9f402c764 Plugins: Install Grafana Pathfinder behind a feature flag (#109909)
Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
2025-10-14 11:40:40 +01:00
Josh Hunt
ea25b75966 Faro: Update configuration with best practices (#112108)
* Clean up faro configuration to align with best practices

* Update grafana docs

* remove fixme comment

* fix tests

* don't spread config in
2025-10-13 13:46:29 +01:00
Stephanie Hingtgen
7a26d48e88 Grafana controllers: Add generic disable setting (#112250) 2025-10-10 17:21:10 +00:00
Tania
21e26aefdb OpenFeature: Add context attributes to frontend settings (#112105)
* Update targeting key to namespace

* Pass eval ctx attributes to frontend

* Add context config to the frontend

* Fix OF namespace not defined in e2e tests

* Set default namespace and targeting key

* remove e2e server config now that namespace is default

---------

Co-authored-by: joshhunt <josh.hunt@grafana.com>
2025-10-10 13:43:24 +02:00
Andreas Christou
fa9d6be255 Azure: Use SSO settings in plugin context (#112058)
* Bump grafana-azure-sdk-go

* Set override values

* Add Azure settings helper covering SSO cases

* Ensure Azure settings are correctly created

- Add mock for sso settings service
- Add tests
- Update wire

* Minor improvements

* Test updates

* Move fake implementation

* add interface to limit leakage

* rename

* work sync

* Fix wire

* Add fake provider

* Update tests

* Actually fix the workspace

* More go dependency fixes

* Update tests

* Update workspace, again

* Add missing tests

* Fix dependencies

* These dependencies..

* More dependency things

* Okay now dependencies really are fixed

* Lint

* Update pkg/services/pluginsintegration/pluginconfig/request.go

Co-authored-by: Misi <mgyongyosi@users.noreply.github.com>

---------

Co-authored-by: Will Browne <wbrowne@tcd.ie>
Co-authored-by: Misi <mgyongyosi@users.noreply.github.com>
2025-10-10 11:46:26 +01:00
Peter Štibraný
3c6768460c Remove unused index_max_batch_size option to bleve backend. (#112171)
* Remove unused index_max_batch_size option to bleve backend.

* Remove batchSize argument.
2025-10-08 17:04:38 +02:00
Peter Štibraný
a44af81082 Unified storage search: Introduce min index update interval (#111978)
* Don't update index more often than specified index_min_update_interval.

* Add artificial sleep at the end of write operations.

* Improve test: check for number of update calls, make diff check less flaky.

* Make test less flaky by allowing for higher diff variance.

* Make test less flaky by allowing for expected update calls variance.
2025-10-06 10:02:03 +02:00
Stephanie Hingtgen
044407d9dc Provisioning: Allow configurable min interval (#111920) 2025-10-02 09:05:09 +03:00
Peter Štibraný
707c486a46 Rebuild search indexes asynchronously (#111829)
* Add "debouncer" queue, which can combine incoming elements.

* Rebuild indexes asynchronously.

* Remove duplicate method.

* Fix bleve tests.

* Extracted combineRebuildRequests and added test for it.

* Add TestShouldRebuildIndex

* Added TestFindIndexesForRebuild

* Added TestFindIndexesForRebuild

* Introduce index_rebuild_workers option.

* Add metric for rebuild queue length.

* Add TestRebuildIndexes.

* Fix import.

* Linter, review feedback.
2025-10-01 11:52:09 +02:00
Tania
c952de773d FeatureToggles: Removed deprecated code (#111750) 2025-09-29 20:05:44 +03:00
Sofia Papagiannaki
34b662c3e1 Chore: Deprecate direct access to Cfg (#111442)
Deprecate direct access to Cfg
2025-09-29 13:48:23 +03:00
Seunghun Shin
512c292e04 Alerting: Add jitter support for periodic alert state storage to reduce database load spikes (#111357)
What is this feature?

This PR implements a jitter mechanism for periodic alert state storage to distribute database load over time instead of processing all alert instances simultaneously. When enabled via the state_periodic_save_jitter_enabled configuration option, the system spreads batch write operations across 85% of the save interval window, preventing database load spikes in high-cardinality alerting environments.

Why do we need this feature?

In production environments with high alert cardinality, the current periodic batch storage can cause database performance issues by processing all alert instances simultaneously at fixed intervals. Even when using periodic batch storage to improve performance, concentrating all database operations at a single point in time can overwhelm database resources, especially in resource-constrained environments.

Rather than performing all INSERT operations at once during the periodic save, distributing these operations across the time window until the next save cycle can maintain more stable service operation within limited database resources. This approach prevents resource saturation by spreading the database load over the available time interval, allowing the system to operate more gracefully within existing resource constraints.

For example, with 200,000 alert instances using a 5-minute interval and 4,000 batch size, instead of executing 50 batch operations simultaneously, the jitter mechanism distributes these operations across approximately 4.25 minutes (85% of 5 minutes), with each batch executed roughly every 5.2 seconds.

This PR provides system-level protection against such load spikes by distributing operations across time, reducing peak resource usage while maintaining the benefits of periodic batch storage. The jitter mechanism is particularly valuable in resource-constrained environments where maintaining consistent database performance is more critical than precise timing of state updates.
2025-09-29 11:22:36 +02:00
Stephanie Hingtgen
15ee224da5 Provisioning: Allow disabling of image rendering instance wide (#111359) 2025-09-19 12:40:14 +03:00
Stephanie Hingtgen
cb11bc15fa Provisioning: Allow disabling of instance sync (#111270)
---------

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
2025-09-18 10:40:02 -05:00
Dana Axinte
1f071f5bd7 Secrets: Adding developer mode config (#111008)
adding developer mode and feature flags for e2e tests
2025-09-18 10:10:24 +01:00
Peter Štibraný
48250a1605 Introduced options to ignore old indexes based on build time and build version. (#111168) 2025-09-17 10:59:59 +02:00
Eric Leijonmarck
868e3a5e8e grafana-iam: Adds config opts for RBACRemoteClient for load balancing (#110819) 2025-09-16 09:49:37 +01:00
Ryan McKinley
afc08dbbbc Chore: go.mod updates (#110957) 2025-09-15 09:01:45 +00:00
Peter Štibraný
6fa6a5708a Cleanup of old search functionality (#110861)
* Remove support for initMinSize.
Remove support for searchAfterWrite option, now it defaults to true.

* Remove reference to deprecated feature toggle.

* Remove feature toggle completely.

* Remove code related to indexing on watch events.

* Fix compilation error.

* Remove unused field.
2025-09-11 08:23:03 +00:00
Roberto Jiménez Sánchez
acbc2cf01a Provisioning: Configurable Repository Types in monolith and operators (#110822)
* Configurable repository types in monolith and operator

* Default to Github in operators

* Regenerate wire

* Fix and implement unit tests

* Same types for enterprise tests

* Remove unnecessary conversion

* Remove the issue with import cycles
2025-09-09 19:13:22 +02:00
Hugo Häggmark
bc843913e4 Chore: Removes HideAngularDeprecation configuration (#110665)
* Chore: cleans up HideAngularDeprecation

* Trigger build
2025-09-08 12:39:01 +02:00
Stephanie Hingtgen
29ef525923 Provisioning: Allow disabling controllers (#110641) 2025-09-05 07:48:23 +02:00
Alexander Akhmetov
100528e274 Alerting: Support retry with backoff in alert rule evaluation (#99710) 2025-09-04 13:56:03 +02:00
Bruno
f8cd7049e8 Secrets: garbage collection (#110247)
* clean up older secret versions

* start gargbage collection worker as background service

* make gen-go

* fix typo

* make update-workspace

* undo go mod changes

* undo go work sum changes

* Update pkg/registry/apis/secret/garbagecollectionworker/worker.go

Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>

* Update pkg/registry/apis/secret/garbagecollectionworker/worker.go

Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>

* default gc_worker_batch_size to 1 minute

* fix typo

* fix typo

* add test to ensure cleaning up secure values is idempotent

* make gen-go

* make update-workspace

* undo go.mod and .sum changes

* undo enterprise imports

---------

Co-authored-by: Matheus Macabu <macabu.matheus@gmail.com>
Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>
2025-09-02 11:11:01 -03:00
Levente Balogh
d31e682345 Plugins: Expose core APIs only for certain plugins (#107967)
* feat(plugins): add a way to expose core apis only to certain plugins

* review: update naming

* review: update the owners of the feature toggle

* feat: share the restricted apis with extensions

* fix: linters

* feat: remove the `addPanel` api

* chore: fix linting and betterer issue

* tests: use `@ts-expect-error` for more clarity
2025-09-01 11:57:00 +02:00
Kyle Brandt
dd4ffc9918 SQL Expressions: Add setting to limit length of query (#110165)
sql_expression_query_length_limit

Set the maximum length of a SQL query that can be used in a SQL expression. Default is 10000 characters. A setting of 0 means no limit.
2025-08-27 12:08:25 -04:00
Steffen Baarsgaard
b047175330 Auth: Support JWT configs tls_client_ca and jwk_set_bearer_token_file (#109095)
* Auth.jwt: Support config tls_client_ca

* Auth.jwt: Support config jwk_set_bearer_token_file

* Docs: Document new JWKS url options and mention tls_skip_verify_insecure

* Docs: Fix note on JWKS response caching

* chore: Refactor getBearerToken into standalone function

* docs: Apply wording/formatting suggestions

Co-authored-by: Victor Cinaglia <victorcinaglia@gmail.com>

* chore: Simplify ca helper function using testcerts

Co-authored-by: Victor Cinaglia <victorcinaglia@gmail.com>

* chore: Update doc and add comment preventing potential erroneous optimization

Co-authored-by: Victor Cinaglia <victorcinaglia@gmail.com>

chore: Reword comment prevent an erroneous refactor

* docs: Update casing

Co-authored-by: Victor Cinaglia <victorcinaglia@gmail.com>

---------

Co-authored-by: Victor Cinaglia <victorcinaglia@gmail.com>
2025-08-26 09:50:06 -03:00
Will Assis
ac641e07fe unified-storage: increase sprinkles default limit from 100 to 10000 (#110135)
increase sprinkles default limit from 100 to 10000
2025-08-26 10:59:15 +02:00
Sarah Zinger
a38c113227 Create option to read ini file without validating frontend files (#109990) 2025-08-22 18:28:40 +00:00
Roberto Jiménez Sánchez
0b5fc9a736 Provisioning: Use loki for recent jobs (#109249) 2025-08-06 18:09:28 +00:00