16773 Commits

Author SHA1 Message Date
20cea80795 Provisioning: Add bulk delete job (#108580)
* Add delete job type

* Regenerate spec

* Add first implementation of worker

* Move interface and mock to repository package

* Add unit tests

* Add integration tests

* Fix linting and spec

* Regenerate client

* Format file

* go fmt

* fix

---------

Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>
2025-07-25 16:38:10 +00:00
a82a7f1340 deps(go): Tidying advisor and investigations go modules (#108703)
deps(go): Tidying apps/advisor go module

Signed-off-by: Dave Henderson <dave.henderson@grafana.com>
2025-07-25 12:27:57 -04:00
c1c5c2db8b FS: Handle unavailable backend (#108544)
* add dev mechanism for making backend unavailable

* handle unavailable backend in html

* fix ordering of /-/ routes

* Add new loader to index.html

* tweak light colours

* fix readme

* add error handling and error state

* use setTimeout for the retry loop

* easier on the comments:
2025-07-25 17:21:48 +01:00
b1b9cc43a8 SecretsManager: Adding ability to disable all DEKs (#108444)
* Adding dek deactivation and rename list dek

* disable data keys from manager

* separate interface and don't use in encryption manager
2025-07-25 17:11:17 +01:00
dcb965b7dc Remote Alertmanager: Optionally merge remote state before starting the internal Alertmanager (#107710)
* Remote Alertmanager: Use the same struct for Grafana stat and Mimir full state

* Alertmanager: Add methods to merge nflog and silences

* update grafana/alerting version

* make update-workspace

* update mocks

* remove unnecesary methods from the remote Alertmanager implementation, create separate StateMerger interface

* (WIP) Remote Alertmanager: Optionally merge remote state before starting the internal Alertmanager

* cleanup ngalert.go

* restore defaults.ini

* move state parsing logic to 'remote' package, clean up ngalert.go

* remove GetBase, implement MegeNflog and MergeSilences

* delete fmt.Println

* FetchRemoteState -> GetRemoteState

* UserGrafanaState -> UserState

* remove duplicate clusterpb import

* reorder MimirClient interface

* use general getState() method for Grafana state and Mimir full state

* remove unnecessary state merging methods from the Alertmanager interface

* remove pullState field

* reduce diff

* add info log after merging

* merge silences and nflog entries in the same method

* merge the remote state in the forked AM

* reduce diff

* update remote AM mock

* tests

* make error more specific

* typo
2025-07-25 15:06:59 +00:00
5f6fc38430 iam/authn: Introduce feature flag for authz resource mutations (#108698)
* iam/authz: introduce feature flag for authz resource mutations

* lint: fix typo
2025-07-25 12:05:32 -03:00
b1592b5e36 Cloud migrations: store snapshots in the database (#108551)
* Cloud migrations: store snapshots in the database

* update github.com/grafana/grafana-cloud-migration-snapshot to v1.9.0

* make update-workspace

* use new field name in test

* return error after call to fmt.Errorf

* create methods for readability / fix session deletiong not deleting snapshots

* remove debugging changes

* update sample.ini

* update tests to include OrgID in ListSnapshotsQuery

* lint

* lint

* Update pkg/services/cloudmigration/cloudmigrationimpl/snapshot_mgmt.go

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

* remove TODO

* Update pkg/services/cloudmigration/cloudmigrationimpl/snapshot_mgmt.go

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

* remove one of the debug logs

---------

Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>
2025-07-25 11:41:21 -03:00
69743ed1a4 SecretsManager: remove unused metric (#108694) 2025-07-25 14:04:43 +00:00
f67713726b add debug logs to search server distributor (#108679) 2025-07-25 12:36:35 +00:00
6747b60822 Plugins: Remove pluginsDetailsRightPanel feature toggle (#107321)
remove pluginsDetailsRightPanel feature toggle
2025-07-25 13:02:05 +01:00
761150fcb8 fix: enable dashboard api k8s list tests (#106508)
* fix: separate dashboard api tests

* fix: typo

* refactor: revert file rename

* fix: compilable

* fix: trial

* fix: remove unused func

* Pass the right value for kubernetesDashboardsEnabled flag

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

* Enable mode 3 for remaining tests

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

* Disable integration tests for MySQL and Postgres

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

* Run go work use

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

* Update go.mod

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

* Remove TODO comment

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

* Revert to go 1.24.5

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

* go.mod

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

* Remove duplicated block

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

* Experiment without reusing client

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

* Reenable integration tests on Postgres and MySQL

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

* Revert "Experiment without reusing client"

This reverts commit 0126e321a08dbafc482a623f2593edaf5561ed32.

* Reapply "Experiment without reusing client"

This reverts commit 5368b4c5318f78aef9b1a5c310846f3f5569fe78.

* Refactor how we get an adminClient

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

* Add TODO comments

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

---------

Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
Co-authored-by: Maicon Costa <maiconscosta@gmail.com>
2025-07-25 09:46:02 +02:00
16339b0788 Provisioning: Move repository file API (#108514)
* Bump nanogit version
* Embed git repository in the Github one
2025-07-24 23:28:59 -05:00
2196727226 TimeSeries: Add Time Comparison (#104672)
* TimeComparison: Add time comparison option

* Display control conditionally based on option

* Provide timeCompare option to panels that opt in

* Only render time compare if panel supports it

* Create a custom time range compare component

* Move custom component

* Remove button checked

* Move time compare options out of field config

* Fix types and remove from fieldConfigProperty enum

* Remove from field config registry

* Add headerActions to V2 schema

* Remove dependency on timeCompare support registry

* Add feature flag

* Subscribe to options change in wrapper

* Remove custom rendering to simplify wrapper

* Bump scenes version

* Hide checkbox

* Remove unneeded query refresh during disable

* Fix import order in timeseries module

* Add util tests

* Support time comparison toggle for new viz panels

* Revert grafana-app-sdk and manifest changes

* Revert yarn lock
2025-07-24 13:07:28 -07:00
d3b6d7c45e OpenFeature: Add config setting to disable API (#108620)
* Add config option to disable ofrep api

* Apply review feedback
2025-07-24 19:45:22 +00:00
183cd0843e keep instance in the ring on shutdown (#108609) 2025-07-24 15:39:12 -04:00
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
e9b9618fb0 Provisioning: Fix stage options for export (#108585)
* Add ref option to stage options

* Fix the issue with ref in export worker

* Add unit tests for export stage options

* Do not fail if ref is equal to the stage branch

* Format code again

* fix test

---------

Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>
2025-07-24 16:53:33 +00:00
e280b949e3 Alerting: Refactor remote Alertmanager and Mimir client (#107808)
* deduplicate config preparation logic squashes config preparation in 3 places into a single method buildConfiguration
* remove copying config from decrypt because we already use copy
* move logic from decryptConfiguration to buildConfiguration
* move logic from mergeExtraConfigs to buildConfiguration
* load default config with buildConfiguration method and skip if fails
---------

Co-authored-by: Santiago <santiagohernandez.1997@gmail.com>
2025-07-24 12:00:38 -04:00
915f47befd Provisioning: commit only once staged changes (#108590) 2025-07-24 10:57:02 -05:00
0895d63516 Alerting: Remote Alertmanager to compare current hash with hash from response (#108554) 2025-07-24 09:22:44 -04:00
4c17c1cbb6 IAM: Instantiate DualWriter only when in single-tenant mode (#108558)
* Instantiate dual writer only in ST case

* minor cleanup

---------

Co-authored-by: Charandas Batra <charandas.batra@grafana.com>
2025-07-24 09:33:53 -03:00
5bfed408ed SQL Expressions: Enable Auto-complete (#106511)
* First draft autocomplete

* Better naming

* Change suggestion to table/column population

* Remove all suggestions, just use table/column population but trigger on space

* Gate feature flag behind a feature flag

* Reorganize and add function list

* Add blurb about autocomplete to docs

* Update public/app/features/expressions/utils/metaSqlExpr.ts

Co-authored-by: Alex Spencer <52186778+alexjonspencer1@users.noreply.github.com>

* Add try catch, remove promise resolve

---------

Co-authored-by: Alex Spencer <52186778+alexjonspencer1@users.noreply.github.com>
2025-07-23 16:49:58 -05:00
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
60e0d2d136 OpenFeature: Update authenticated request check (#108539) 2025-07-23 20:27:21 +02:00
7c43c061a8 Alerting: Fix deadlocks in provenance table (#106370)
What is this feature?

This PR further improves concurrent updates to the provenance table (a follow-up for #101688). The fix explicitly checks for a provenance record using SELECT ... FOR UPDATE for the databases that support it before performing either an update or upsert operation. This preemptive locking reduces the possibility of deadlocks in MySQL.

This works only with the alertingProvenanceLockWrites feature flag enabled.

Why do we need this feature?

The current implementation (directly performing upserts without prior locking) may still encounter deadlocks because of the gap and insert-intention locks in some configurations, for example, with repeatable-read transaction isolation level in MySQL+InnoDB.

---------

Co-authored-by: William Wernert <william.wernert@grafana.com>
2025-07-23 20:16:06 +02:00
cc869e7668 Alerting: Fix active time intervals when time interval is renamed (#108534) 2025-07-23 13:08:11 -04:00
e3c1e75da5 Fix Readme (#108081) 2025-07-23 15:55:30 +00:00
b99e9484d2 CloudWatch: Fix broken test (#108520) 2025-07-23 15:15:44 +02:00
7c872f0e8a Alerting: Add feedback buttons for the new AI helpers (#108207)
* Add alerting ai buttons for cloud

* add tracking for ai buttons usage

* Empty commit to trigger GitHub Actions

* wip

* add FrontendOnly in ff

* update analytics folder

* prettier

* revert ff being frontend only

* add feedback button in templates

* review comments

* address some review comments

* refactor

* revert change and remove comment

* prettier

* update betterer

* remove unused property

* prettier

* update AIFeedbackComponent

* add feedback buttons for alert rule generation with ai

* remove tracking from oss

* fix analytics imports

* udpdate changes in go.mod go.sum

* prettier

* update translations

* update workspace

* fix betterer

* address pr comments

* move most of the ai feedback buttons code to enterprise

* prettier

* fix

* address pr feedback
2025-07-23 14:38:09 +02:00
24d898d6a7 Provisioning: Fix flake in delete resources integration test (#108507)
* Fix flake in delete resources test

* Fix linting issue
2025-07-23 11:43:57 +01:00
0e7b041b27 Secrets: Move decrypt types to contracts and export public at root pkg (#108376)
* Secrets: Move decrypt types to contracts and export public at root pkg

* Provisioning: Replace decrypt pkg imports

* Merge wire changes
2025-07-23 12:14:28 +02:00
838391cd31 I18n: Prepare locale format for preview (#108501)
* Promote toggle to public preview

* disable RTL locales

* update badge on prefs page to preview
2025-07-23 09:41:22 +00:00
946358900c Provisioning: Add warning job status and different strictness (#108446)
* Add warning job status

* Different strictness for export than for pulling

* Fix some unit tests

* Fix unit tests

* Update frontend to display the warning status

* Fix status badge

* Add missing return statement

* Improve text in alert
2025-07-23 09:33:25 +00:00
b2688dd5ff I18n: Default regional format to Accept-Language header value (#108468)
* I18n: Default regional format to Accept-Language header value

* comment

* rejigger

* rejigger preferences
2025-07-23 09:23:05 +01:00
aedd7b6e34 [--Dashboard-- data source] Implement AdHoc filtering (#108011)
Behind a feature toggle: `dashboardDsAdHocFiltering`
2025-07-23 09:12:25 +01:00
1bd9541507 FrontendService: Add tracing and logging middleware (#107956)
* FrontendService: Add tracing and logging middleware

* tests!

* middleware tests

* context middleware test

* revert http_server back to previous version

* fix lint

* fix test

* use http.NotFound instead of custom http handler

* use existing tracer for package

* use otel/trace.Tracer in request_tracing middleware

* tidy up tracing in contextMiddleware

* fix 404 test

* remove spans from contextMiddleware

* comment
2025-07-22 18:55:44 +01:00
52f6104230 Dependencies: Bump Go to v1.24.5 (#108175) 2025-07-22 17:08:40 +02:00
0dbede9ba5 Provisioning: Fix ImportAllPanelsFromLocalRepository test (#108441)
* Provisioning: Skip flaky test

* Fix flaky provisioning test

* Fix lint

---------

Co-authored-by: Roberto Jimenez Sanchez <roberto.jimenez@grafana.com>
2025-07-22 14:23:17 +00:00
482872c3bf Provisioning: Fix bug in job progress recording (#108440)
Fix bug in job progress recording
2025-07-22 14:21:22 +00:00
9402071d33 Secrets: Create more granular fixed roles for SecureValues (#108382) 2025-07-22 16:20:54 +02:00
71cb623cb7 improve logging and fail unified-storage migration with more than 0 errors (#108471)
improve logging and fail unified-storage migration with more than 0 errors
2025-07-22 13:44:04 +00:00
52a0485d5b App Installer: Authorizer support (#108419) 2025-07-22 06:45:01 -04:00
d72a70d246 Dashboards API: v2alpha2 missing pieces (#108293)
* Dashboards API: v2alpha2 missing pieces

* Fix issue with dashboard client scope for alpha versions

As we now have 2 different alpha versions for v2 we need to store the
clients separately.

* Improve debuggability of provisioning export test

- Add a helper function to print the tree structure.
- Be explicit about the expected file names expected in each case.

* Update pkg/registry/apis/dashboard/mutate.go

* Update pkg/services/authz/zanzana/server/server.go

Co-authored-by: Igor Suleymanov <radiohead@users.noreply.github.com>

* Review

* go lint

---------

Co-authored-by: Roberto Jimenez Sanchez <roberto.jimenez@grafana.com>
Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>
Co-authored-by: Igor Suleymanov <radiohead@users.noreply.github.com>
2025-07-22 11:44:05 +02:00
c3243bd100 Context: Clean up contexthandler.Middleware spans (#108188)
* Context: Clean up contexthandler.Middleware spans

* seperate the middleware span from the rest of the request

* shuffle

* put of back

* span name

* Update pkg/services/contexthandler/contexthandler.go

Co-authored-by: Dave Henderson <dave.henderson@grafana.com>

---------

Co-authored-by: Dave Henderson <dave.henderson@grafana.com>
2025-07-22 08:53:28 +00:00
7f065c94de Plugins: Remove pluginsCDNSyncLoader feature toggle (#108389)
* remove pluginsCDNSyncLoader feature toggle

* fix lint issues

* fix other linter issue
2025-07-22 09:33:23 +01:00
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
e5d2f92384 K8s: Add App SDK installer (#107773) 2025-07-21 13:32:15 -04:00
71b5c1d997 Alerting: Update test data for exports which now contain http_configs for receivers (#108405)
This was introduced in https://github.com/grafana/grafana/pull/108190 and missed in the integration
2025-07-21 16:32:21 +00:00
5489c814c0 Alerting: Fix Jira HCL export with fields & add export snapshots test (#108032)
* Alerting: Contact point export snapshot test

* Fix Jira.fields hcl export type to allow map[string]any

Since gohcl does not support this type, we marshal as a string instead
which will be handled in the TF provider.

* mapToJSONStringCodec encoder needed for
TestContactPointFromContactPointExports
2025-07-21 10:24:24 -04:00
12a7e03e2f Secrets: encryptionStoreImpl produces metrics (#108390) 2025-07-21 11:00:59 -03:00