Commit Graph

7837 Commits

Author SHA1 Message Date
Yuri Tseretyan
f8fa5286a1
Alerting: Introduce alert rule models in storage (#93187)
* introduce storage model for alert rule tables
* remove AlertRuleVersion from models because it's not used anywhere other than in storage
* update historian xorm store to use alerting store to fetch rules

* fix folder tests

---------

Co-authored-by: Matthew Jacobson <matthew.jacobson@grafana.com>
2024-09-12 13:20:33 -04:00
William Wernert
efe62086f9
Alerting: Add type label rule_group_rules metric (#91425)
* Add group and type labels to rule_group_rules metric

* Don't include group to avoid high cardinality

* Add comments

* Reset rule_group_rules before recording new values

* Edit description for rule_group_rules

* Include ruleGroup combo key in labels

* Fix lint
2024-09-12 17:27:09 +03:00
Ryan McKinley
45eb72e95a
K8s: Use wire to initalize the resource client (#93221) 2024-09-12 17:22:27 +03:00
Jean-Philippe Quéméner
eabf3b9f73
feat(alerting): add support for query service instant vectors (#92091) 2024-09-12 15:33:00 +02:00
Tito Lins
a910188675
Replace prom MustRegister with Register (#92725) 2024-09-12 10:24:12 +02:00
janlugt
9d6935388c
Notifications: Add Message-ID header to outgoing emails (#83752)
* Add Message-ID header to outgoing emails

* change message-id format

* parse adddresses with name
2024-09-12 03:58:06 +00:00
Faye Lin
634d590cf1
Search: Fix a bug when searching folders under the general folder (#91042)
* fix: search returns all folders when folder uid is general
* test: add unit test for FolderUIDFilter when NestedFolders is enabled
2024-09-12 05:55:28 +02:00
Will Browne
0469b0f52e
Plugins: Ensure fetch loading strategy cases for nested plugins (#93209)
* fix

* fix func name
2024-09-11 16:35:13 +03:00
Gilles De Mey
90ee52e8d9
Alerting: New search UI – Part 1 (#91620) 2024-09-11 14:29:26 +03:00
Yuri Tseretyan
cb372d3fa8
Alerting: Support secrets in contact points nested fields (#92035)
Back-end:
* update alerting module
* update GetSecretKeysForContactPointType to extract secret fields from nested options
* Update RemoveSecretsForContactPoint to support complex settings
* update PostableGrafanaReceiverToEmbeddedContactPoint to support nested secrets
* update Integration to support nested settings in models.Integration
* make sigv4 fields optional

Front-end:
* add UI support for encrypted subform fields
* allow emptying nested secure fields
* Omit non touched secure fields in POST payload when saving a contact point
* Use SecretInput from grafana-ui instead of the new EncryptedInput
* use produce from immer
* rename mapClone
* rename sliceClone
* Don't use produce from immer as we need to delete the fileds afterwards

---------

Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
Co-authored-by: Sonia Aguilar <soniaaguilarpeiron@gmail.com>
Co-authored-by: Matt Jacobson <matthew.jacobson@grafana.com>
2024-09-10 22:26:23 -04:00
Ryan McKinley
d724d463b1
DualWriter: Add mode 5 that always uses storage (#93169) 2024-09-10 13:07:06 -04:00
Gabriel MABILLE
697afc71b4
RBAC: FIX Allow specifying several valid scopes for a kind (#93176)
* PermRegistry: Fix regression with actions applying to multiple scopes

* Add tests

Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>

---------

Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
2024-09-10 17:22:40 +01:00
Gábor Farkas
c48caf0921
logging: log plugin request start (#92925)
log plugin request start
2024-09-10 13:25:50 +02:00
Arati R.
b12a29a1da
K8s: Implement partial folders api with k8s client (#93089)
* Add kubernetes folder feature toggle
* Add kubernetes routes for getting and creating a folder
* Add documentation for interacting with k8s folders
2024-09-10 11:22:08 +02:00
Eric Leijonmarck
f3ede1f53d
Datasources: allow for query but with warning (#93091)
allow for query but with warning
2024-09-10 10:19:02 +01:00
Aaron Godin
6ded6a8872
feat: Add feature toggle for groupAttributeSync (#93116) 2024-09-09 10:29:43 -05:00
Adela Almasan
af48d3db1e
Canvas: Add actions support (#90677)
Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
2024-09-09 09:11:55 -05:00
Andrej Ocenas
5e2ac24890
Sidecar: Add split view and basic APIs for extensions (#91648)
* Add split view and basic APIs to extensions

* Add comments

* Update public/app/AppWrapper.tsx

Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>

* Moved the .grafana-app element and deduplicate some code

* Remove the provider variants of usePluginLinks/Components

* Change buildPluginSectionNav

* Update comment

* Use eventBus

* Remove non existent exports

* refactor: use a sidecar service to encapsulate the state

* Don't wrap single app in split wrapper

* Use hook splitter

* Remove inline styles

* Type the style props from useSplitter

* Move the overflow style changes to appWrapper

* Deduplicate some common top level providers

* Move modals

* Move routes wrappers to it's own file

* Use better css and add comments

* Remove query rows app extension point

* Fix test

---------

Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2024-09-09 14:45:05 +02:00
Will Browne
2c47d246fc
Plugins: Introduce LoadingStrategy for frontend loading logic (#92392)
* do it all

* feat(plugins): move loadingStrategy to ds pluginMeta and add to plugin settings endpoint

* support child plugins and update tests

* use relative path for nested plugins

* feat(plugins): support nested plugins in the plugin loader cache by extracting pluginId from path

* feat(grafana-data): add plugin loading strategy to plugin meta and export

* feat(plugins): pass down loadingStrategy to fe plugin loader

* refactor(plugins): make PluginLoadingStrategy an enum

* feat(plugins): add the loading strategy to the fe plugin loader cache

* feat(plugins): load fe plugin js assets as script tags based on be loadingStrategy

* add more tests

* feat(plugins): add loading strategy to plugin preloader

* feat(plugins): make loadingStrategy a maybe and provide fetch fallback

* test(alerting): update config.apps mocks to include loadingStrategy

* fix format

---------

Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
2024-09-09 10:38:35 +01:00
Jean-Philippe Quéméner
368c4e53f1
feat(apiserver): refactor the hooking mechanism for standalone apiserver (#93001)
It now uses a full build handler chain that can be passed from up top to `SetupConfig`.

Co-authored-by: Charandas Batra <charandas.batra@grafana.com>
2024-09-06 14:12:12 -07:00
Tito Lins
539d363d2c
Create histogram and observe grafana config size (#93028) 2024-09-06 18:25:16 +02:00
Andre Pereira
72ed3107fa
Tempo: Remove usage of traceQLStreaming feature toggle (#93033)
* Remove usage of traceqlStreaming feature toggle and stop checking for Tempo version

* Increase Grafana Live's ClientQueueMaxSize to 4mb to support larger responses from Tempo
2024-09-06 16:12:21 +01:00
Laura Benz
1be0105eb7
RestoreDashboards: Show root location as 'Dashboards' in folder picker (#92936)
* refactor: replace label if its value is Root

* refactor: replace label in the backend
2024-09-06 14:19:39 +02:00
João Calisto
a45ec2670d
chore(tests): fix flaky SMTP test (#93031) 2024-09-06 13:17:26 +01:00
Claudiu Dragalina-Paraipan
d5ebaa0ef9
[authn] adding appPlatformAccessTokens featureflag (#92991)
Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
2024-09-05 19:18:44 +03:00
linoman
a0c886922e
Auth: Add LDAP scope to Grafana Admin (#92990)
Add LDAP scope to Grafana Admin
2024-09-05 17:15:47 +01:00
Matheus Macabu
95ef2a1eb2
CloudMigrations: Fix snapshot creation on Windows systems (#92941)
* cloudmigration: improve error logging stringify body

* deps: update migration snapshot library to v1.3.0 (fix to Windows)
2024-09-05 15:34:20 +02:00
Ashley Harrison
82fe497b9d
Chore: remove adhocFilterOneOf toggle (#92979)
remove adhocFilterOneOf toggle
2024-09-05 15:49:24 +03:00
Karl Persson
2bfa607ad0
ServiceAccount: Update service account api resource and add service account token (#92972)
* Create own legacy store function to list service accounts and update api model

* Add service account tokens as a sub resource for service accounts
2024-09-05 13:43:54 +02:00
Arati R.
47cd8288cd
SearchV2: Fix reading library panels (#92961)
* Fix reading of library panel field
* Add test to check reading of library panel field
2024-09-05 13:42:15 +02:00
Ryan McKinley
5441e4c752
Storage: create a client with access to all interfaces, not just ResourceStore (#92967) 2024-09-05 12:52:30 +03:00
Ryan McKinley
9338e40dc3
K8s/IAM: Move identity.grafana.app to iam.grafana.app (#92929) 2024-09-05 09:43:54 +03:00
Dave Henderson
c00a3bed42
chore(tests): Attempting to fix flaxy SMTP unit test (#92786)
Signed-off-by: Dave Henderson <dave.henderson@grafana.com>
2024-09-04 16:25:44 -04:00
Gabriel MABILLE
cffaefddc3
Signer: Fix typo (#92928) 2024-09-04 15:01:24 +02:00
Kyle Brandt
d382ea773a
Prometheus: Enable the promQLScope (Scopes, Adhoc filters and groupby) by default (#92080) 2024-09-03 09:56:25 -04:00
Alexander Zobnin
88259da745
RBAC: Optimize permissions caching (#92673)
* Access control: Use composite cache key for team permissions

* use composite key for teams

* use cache for hotpath (getCachedUserPermissions)

* don't cache empty teams set

* don't pass permissions as argument

* early return if no teams found

* reload cache correctly

* optimize allocations

* Clear user's teams cache

* remove composite cache for teams

* fix linter

* don't clear teams permissions

* pre-allocate memory for basic roles permissions
2024-09-03 15:46:56 +02:00
Ieva
46e81e98cf
RBAC: Always store action sets (#92833)
always store action sets, even if FT is disabled
2024-09-03 11:30:47 +01:00
Sven Grossmann
5ad7c47816
Plugin Instrumentation: Add target property to request logs (#91946)
* Plugin Instrumentation: Add `target` property to request logs

* remove comment

* remove error
2024-09-02 17:41:26 +02:00
Arati R.
f26f655615
Provisioning: Fix admin reloading of dashboard configuration (#92462)
* Set dashboard provisioner before provisioning dashboards
* Test provisioner instantiation during dashboard provisioning
2024-09-02 15:48:13 +02:00
Sergej-Vlasov
00ae49a61a
FeatureToggle - new filters UI feature toggle (#92189)
* add newFiltersUI experimental feature toggle

* adjust Ad hoc filter varibale layout property based on feature toggle

* restore file

* bump to latest scenes
2024-08-30 15:48:13 +03:00
Alexander Akhmetov
152d3540db
Alerting: Log number of dimensions instead of all evaluation results (#92733) 2024-08-30 12:35:02 +02:00
Leonor Oliveira
2e451b2ed7
Use dw dynamic config (#91882)
* Remove kubernetesPlaylists feature_toggle

* Remove unified_storage_mode

* Remove double import

* Read from config instead from feature_toggle

* cover scenario for when unified storage is not defined

* Be temporarily retro compatible with previous feature toggle

* Properly read unified_storage section

* [WIP] Read new format of config

* Fix test

* Fix other tests

* Generate feature flags file

* Use <group>.<resource> schema

* Use <group>.resource format on the FE as well

* Hide UniStore config from Frontend

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

* unwanted changes

* Use feature toggles in the FE. Enforce FTs are present before enabling dual writing
Co-authored-by: Ryan McKinley <ryantxu@users.noreply.github.com>

* use kubernetes playlists feature toggle on the FE

* Remove unwanted code

* Remove configs from the FE

* Remove commented code

* Add more explicit example

---------

Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
Co-authored-by: Maicon Costa <maiconscosta@gmail.com>
2024-08-30 11:59:42 +02:00
Jeff Levin
372d0acec8
Instrument tracing across dashboards (#91937)
Add tracing across dashboards and accesscontrol
2024-08-29 22:26:15 -08:00
Yuri Tseretyan
ce64d79027
Alerting: Integration tests for Receiver API (#90632)
---------

Co-authored-by: Matthew Jacobson <matthew.jacobson@grafana.com>
2024-08-29 22:27:26 -04:00
Matthew Jacobson
d5fd6aceca
Alerting: Stop redacting receivers by default in receiver_svc (#92631)
* Stop redacting receivers by default in receiver_svc

[REDACTED] is only used in provisioning API since response doesn't include
SecureFields. This is not necessary in k8s or notifications api, instead we do
not include the encrypted settings in Settings at all, leaving it to
SecureFields to specify when a secure field exists.

* Capitalize logs messages
2024-08-29 14:48:59 -04:00
Matthew Jacobson
e43ddd516d
Alerting: Ensure k8s receiver API create/update will never store nil settings (#92701)
Ensure Create/Update will never store nil Settings
2024-08-29 20:00:55 +03:00
Sven Grossmann
15a4ff992b
Explore Logs: Add feature flags (#92670) 2024-08-29 15:55:59 +02:00
Ryan McKinley
82417c916f
K8s: Use stacks plural not singular in grafana namespaces (#92550) 2024-08-29 14:15:00 +03:00
Andres Martinez Gotor
f9cd0fe5d1
Add debug headers when downloading plugins (#92579) 2024-08-29 11:30:21 +02:00
Laura Fernández
8aaa155cb0
singleTopNav: Create feature toggle (#92610) 2024-08-29 10:48:32 +02:00
Karl Persson
56487d37db
Authn: No longer hash service account token twice during authentication (#92598)
* APIKey: Only decode and hash token once during authentication

* Only update last used every 5 minutes
2024-08-29 09:56:23 +02:00
Charandas
4f024d94d8
Authn: resolve issues with setting up a nil identity (#92620) 2024-08-29 00:49:41 +03:00
Gabriel MABILLE
2a1a43fc9b
PermissionRegistry: Error on unknown kind (#91469)
* PermissionRegistry: Error on unknown kind

* Account for PR feedback

Co-authored-by: Eric Leijonmarck <eric.leijonmarck@gmail.com>

* Add missing alerting scope

---------

Co-authored-by: Eric Leijonmarck <eric.leijonmarck@gmail.com>
2024-08-28 15:58:25 +02:00
Todd Treece
2bb2183b41
Scopes: Move title and groups to status in ScopeDashboardBinding (#92377)
---------

Co-authored-by: Kyle Brandt <kyle@grafana.com>
Co-authored-by: Bogdan Matei <bogdan.matei@grafana.com>
2024-08-28 08:59:18 -04:00
Arati R.
34149c86d0
Provisioning: Prevent provisioning folder errors from failing startup (#92560)
* Prevent provisioning folder errors from failing startup
* Refactor setting of dashboard provisioner
2024-08-28 14:49:00 +02:00
Arati R.
c5b377f06e
Provisioning: Revert "Allow startup when there are dashboard provisioning failures" (#92568)
Revert "Provisioning: Allow startup when there are dashboard provisioning failures (#92201)"

This reverts commit 927ce6c700.
2024-08-28 14:19:59 +02:00
Aaron Godin
86e8e3b75d
Revert "RBAC: Optimize permissions caching" (#92548)
Revert "RBAC: Optimize permissions caching (#92412)"

This reverts commit 488e994d37.

Co-authored-by: gamab <gabriel.mabille@grafana.com>
2024-08-28 10:44:38 +02:00
Charandas
af2e79aa83
K8s: namespace mapper should use authlib's util (#92332) 2024-08-27 15:01:42 -07:00
maicon
de2c9a06bf
Unified Storage: First iteration Dual Write Syncer (#89809)
* Unified Storage: First iteration Dual Write Syncer

Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
Co-authored-by: Leonor Oliveira <9090754+leonorfmartins@users.noreply.github.com>
Co-authored-by: Dan Cech <dcech@grafana.com>
2024-08-27 13:31:40 -03:00
Stephanie Hingtgen
a4266df16d
SQL Store: Fix parse time setup (#92484) 2024-08-27 17:39:27 +03:00
Alexander Zobnin
0e0c877609
Zanzana: Model fixed roles as a part of schema (#92364)
* model fixed roles for dashboards and folders

* Correctly translate fixed role assignments

* minor refactor

* assign fixed roles to teams

* fix linter errors

* Migrate general folder permissions for fixed roles

* fix dashboards:create permission
2024-08-27 15:39:22 +02:00
Ryan McKinley
c59dddf7af
MySQL: Add parseTime=true to SQL connections (#92469) 2024-08-27 14:16:04 +03:00
Ryan McKinley
419edef4dc
LibraryPanels: Expose library panels in dashboard apiserver (#92213) 2024-08-27 12:12:22 +03:00
Alexander Zobnin
488e994d37
RBAC: Optimize permissions caching (#92412)
* Access control: Use composite cache key for team permissions

* use composite key for teams

* use cache for hotpath (getCachedUserPermissions)

* fix linter

* fix sorting

---------

Co-authored-by: Jeff Levin <jeff@levinology.com>
2024-08-27 10:31:52 +02:00
Alexander Akhmetov
7f6b6dea45
Alerting: Change expire placeholder for Pushover in the UI to 10800 seconds (#92379)
* Alerting: Change max retry for Pushover in the UI to 10800 seconds
* Update alerting to 70248a7a3a674e50e026a37205ebac86e1ec25fd
2024-08-27 11:13:58 +03:00
Yuri Tseretyan
4755eb5176
Alerting: Support template UID in template service (#92164)
* add uid to template and populate it
* update delete method to support both uid and name
* update UpdateTemplate to support search by UID and fallback to name + support renaming of the template
* update upsert to exit if template not found and uid is specified
* update Get method to address by name or uid

---------

Co-authored-by: Matthew Jacobson <matthew.jacobson@grafana.com>
2024-08-26 23:05:38 +03:00
Eric Leijonmarck
413b511452
Revert "feat: Add new read filtering to datasources guardian" (#92407)
Revert "feat: Add new read filtering to datasources guardian (#91345)"

This reverts commit 0176ead117.
2024-08-26 13:16:04 -04:00
Alexander Weaver
490d6ba2fd
Alerting: Extend scheduler user with datasources:read (#92410)
Add permission
2024-08-26 10:59:54 -05:00
Matthew Jacobson
32f06c6d9c
Alerting: Receiver API complete core implementation (#91738)
* Replace global authz abstraction with one compatible with uid scope

* Replace GettableApiReceiver with models.Receiver in receiver_svc

* GrafanaIntegrationConfig -> models.Integration

* Implement Create/Update methods

* Add optimistic concurrency to receiver API

* Add scope to ReceiversRead & ReceiversReadSecrets

migrates existing permissions to include implicit global scope

* Add receiver create, update, delete actions

* Check if receiver is used by rules before delete

* On receiver name change update in routes and notification settings

* Improve errors

* Linting

* Include read permissions are requirements for create/update/delete

* Alias ngalert/models to ngmodels to differentiate from v0alpha1 model

* Ensure integration UIDs are valid, unique, and generated if empty

* Validate integration settings on create/update

* Leverage UidToName to GetReceiver instead of GetReceivers

* Remove some unnecessary uses of simplejson

* alerting.notifications.receiver -> alerting.notifications.receivers

* validator -> provenanceValidator

* Only validate the modified receiver

stops existing invalid receivers from preventing modification of a valid
receiver.

* Improve error in Integration.Encrypt

* Remove scope from alert.notifications.receivers:create

* Add todos for receiver renaming

* Use receiverAC precondition checks in k8s api

* Linting

* Optional optimistic concurrency for delete

* make update-workspace

* More specific auth checks in k8s authorize.go

* Add debug log when delete optimistic concurrency is skipped

* Improve error message on authorizer.DecisionDeny

* Keep error for non-forbidden errutil errors
2024-08-26 10:47:53 -04:00
Julien Duchesne
3ac8760321
OpenAPI: Fix ValidationError message attribute (#90846)
It's `message`, not `msg`. It's been fixed for a while here: 9ef6983612/scripts/pull-schema.sh (L46-L49)

I've also reflected the change in the tests
2024-08-26 10:05:37 -04:00
Julien Duchesne
087df1d8e5
OpenAPI: Fix alerting DeleteMuteTiming errors (#91109)
The `GenericPublicError` is not what is actually returned by the API. Using `PublicError` describes the API correctly
2024-08-26 10:04:36 -04:00
Julien Duchesne
0075abe383
OpenAPI: Fix ProvisionedAlertRule.for type (#90841)
This override has been in the client for a while now: 9ef6983612/scripts/pull-schema.sh (L34-L39)

The API expects a string here and transforms it to a duration internally
2024-08-26 10:04:15 -04:00
Kristina
1dd830b9f1
Correlations: Migrate config type to root (#91855)
* WIP

* Validate new field, and add value in provisioning if not defined in correct spot

* Simplify logic, use correct value

* fix tests

* Fix linter errors

* fix swagger and tests

* 😬

* Auto-generation isnt doing this..

* Fix linter

* test if nullable is the issue…

* Change structure on the frontend fields

* Try with backtick

* try programatic quoting

* Try only quote non-ints

* quoting, no backticks

* Remove debugging
2024-08-26 08:02:48 -05:00
Kyle Brandt
84e5c3af22
Prometheus/Promlib: Remove the PrometheusDataplane feature so always enabled (#92218)
This has been default behavior since v10

---------

Co-authored-by: Brendan O'Handley <brendan.ohandley@grafana.com>
2024-08-26 08:53:38 -04:00
Karl Persson
ddee95cb6d
Team: Create permission type for team membership (#92352)
* Create permission type enum for team and remove usage of dashboard permission type
2024-08-23 12:34:34 +02:00
Arati R.
927ce6c700
Provisioning: Allow startup when there are dashboard provisioning failures (#92201)
* Stop returning an error if dashboard provisioning fails
* Test that Run() does not error when dashboard provisioning fails
2024-08-23 11:48:42 +02:00
Tito Lins
4a124469fa
Check is config is default by comparing hashes (#92296) 2024-08-23 11:22:06 +02:00
Sven Grossmann
ec857e1de9
Loki: Add dashboard and panel names as headers (#92096)
* feat(nameHeaders): add feature flag

* add safe parsing of headers

* use headers in loki datasource

* Loki: add option to pass headers to Loki

* Loki: add datasource tests for dashboard names

* cleanup

* DataSourceWithBackend: add test

* rename to `sanitizeHeader`

* Loki: add condition when to add headers

* Loki: add e2e tests

* Loki: change test name
2024-08-22 21:30:43 +02:00
Christian Inkster
922babb157
Alerting: Add mutex to Redis HA subs (#89870) 2024-08-22 16:01:33 +01:00
Alexander Akhmetov
832bb01f36
Alerting: Add MQTT notifications receiver (#91487)
* Alerting: Add MQTT notifications receiver
* Update alerting to 9daa6239cc41dc42bff0e916c8d0d27766caa8b9 (main)
---------

Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>
2024-08-22 16:47:48 +02:00
Andres Martinez Gotor
c20ba5b09d
Add some basic stats for plugin preinstalls (#92220) 2024-08-22 16:17:27 +03:00
William Wernert
dfbddd8262
Alerting: Fix recording rule export (#91405)
* Fix HCL export

* Update rule export struct to support new optional fields

* Omit `for` field in export API if empty
2024-08-22 09:04:21 -04:00
Aaron Godin
0176ead117
feat: Add new read filtering to datasources guardian (#91345)
* feat: Add new read filtering to datasources guardian

* Apply suggestion to use datasources read guardian check for frontend settings

---------

Co-authored-by: Eric Leijonmarck <eric.leijonmarck@gmail.com>
2024-08-22 11:26:46 +01:00
Ieva
41ac5b5ae7
RBAC: Fix an issue with server admins not being able to manage users in orgs that they don't belong to (#92024)
* look at global perms if user is not a part of the target org

* use constant

* update tests
2024-08-22 10:04:06 +01:00
Kristin Laemmert
2d0350e786
add spans to search v2 (#92223)
add tracing spans to search v2 service
2024-08-21 13:26:34 -04:00
Kristin Laemmert
aa913b5f39
chore: add tracing to quote API and service methods with contexts (#92211)
* chore: add tracing to quote API and service methods with contexts

I also fixed a typo (overriden -> overridden) and removed a method that looked like it wasn't useful anymore. (It seemed to exist to return an error, but never returned an error, and so just added many lines of unnecessary error checking).
2024-08-21 13:24:45 -04:00
Ryan McKinley
2136fd9a92
Storage: Remove unified storage feature flag (#92192)
remove unified storage flag
2024-08-21 19:28:30 +03:00
Dave Henderson
df3d8915ba
Chore: Bump Go to 1.23.0 (#92105)
* chore: Bump Go to 1.23.0

Signed-off-by: Dave Henderson <dave.henderson@grafana.com>

* update swagger files

Signed-off-by: Dave Henderson <dave.henderson@grafana.com>

* chore: update .bingo/README.md formatting to satisfy prettier

Signed-off-by: Dave Henderson <dave.henderson@grafana.com>

* chore(lint): Fix new lint errors found by golangci-lint 1.60.1 and Go 1.23

Signed-off-by: Dave Henderson <dave.henderson@grafana.com>

* keep golden file

* update openapi

* add name to expected output

* chore(lint): rearrange imports to a sensible order

Signed-off-by: Dave Henderson <dave.henderson@grafana.com>

---------

Signed-off-by: Dave Henderson <dave.henderson@grafana.com>
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2024-08-21 11:40:42 -04:00
Kristin Laemmert
a04d2f44f8
chore: add spans to publicdashboards service methods (#92149)
* chore: add spans to publicdashboards service methods

* add tracing to test service

* test fixture whackamole

* move tracer to a package var

* Update pkg/services/publicdashboards/service/service.go

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

---------

Co-authored-by: Dave Henderson <dave.henderson@grafana.com>
2024-08-21 10:55:16 -04:00
Andres Martinez Gotor
21bf013a8e
Add support for synchronous plugin installation (#92129) 2024-08-21 16:11:55 +02:00
Ryan McKinley
2e60f28044
Auth: remove id token flag (#92209) 2024-08-21 16:30:17 +03:00
Fayzal Ghantiwala
8d725a641c
Alerting: Integration test for testing template via remote alertmanager (#92147)
* Add integration test for testing template

* Update drone signature
2024-08-21 13:06:01 +01:00
Ryan McKinley
9563c896ee
Playlists: limit the total number of playlists (#92132) 2024-08-21 14:49:28 +03:00
Will Browne
aea8b60849
Plugins: Add support for fetching plugin includes from plugin CDN (#91476)
* update oss side

* add Rel func to plugins.FS

* update tests

* add comment

* fix fs paths for nested plugin

* fix test

* fix sources

* fix cdn class bug

* update tests

* remove commented out code
2024-08-21 09:46:41 +01:00
Ida Štambuk
0c55d0aa64
Features: Move openSearchBackendFlowEnabled toggle to GA (#92117) 2024-08-21 10:21:57 +02:00
Yuri Tseretyan
d27c3822f2
Alerting: Add Create and Update methods to Template service (#91981)
* rename SetTemplate to UpsertTemplate

* Introduce Create\Update methods

* update api endpoint to use GetTemplate
2024-08-20 15:23:01 -04:00
linoman
eecd56659c
LDAP: SSO Configuration page (#91875)
* Init screen for LDAP UI

* add ldap drawer

* update routes

* update definitions

* add definitions for ldap configurations

* improve readibility

* remove whitespace

* clean up

* Adjust LdapSettingsPage

* adjust form autocomplete from backend call
2024-08-20 17:31:13 +02:00
Will Browne
d35e9264bb
Plugins: Use plugins SDK constants for OAuth header names (#90892)
use SDK consts
2024-08-20 13:29:41 +01:00
Alexander Akhmetov
d32e1e009b
Alerting: Update prometheus/client_golang to v1.20 (#92070)
Update prometheus/client_golang to v1.20
2024-08-20 11:26:06 +02:00
Todd Treece
b97fb3bb78
Chore: Update storage and search feature toggle owners (#92098) 2024-08-19 16:57:00 -04:00
Alexander Weaver
ac5ebe6e4d
Alerting: Add enablement flag for recording rules (#92032)
* Add enablement flag

* Disable if toggle not enabled
2024-08-19 12:01:00 -05:00
Dan Cech
9020eb4b17
Auth: Update oauthtoken service to use remote cache and server lock (#90572)
* update oauthtoken service to use remote cache and server lock

* remove token cache

* retry is lock is held by an in-flight refresh

* refactor token renewal to avoid race condition

* re-add refresh token expiry cache, but in SyncOauthTokenHook

* Add delta to the cache ttl

* Fix merge

* Change lockTimeConfig

* Always set the token from within the server lock

* Improvements

* early return when user is not authed by OAuth or refresh is disabled

* Allow more time for token refresh, tracing

* Retry on Mysql Deadlock error 1213

* Update pkg/services/authn/authnimpl/sync/oauth_token_sync.go

Co-authored-by: Dan Cech <dcech@grafana.com>

* Update pkg/services/authn/authnimpl/sync/oauth_token_sync.go

Co-authored-by: Dan Cech <dcech@grafana.com>

* Add settings for configuring min wait time between retries

* Add docs for the new setting

* Clean up

* Update docs/sources/setup-grafana/configure-grafana/_index.md

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

---------

Co-authored-by: Mihaly Gyongyosi <mgyongyosi@users.noreply.github.com>
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
2024-08-19 18:57:37 +02:00
Alexander Zobnin
87c4f2448c
Zanzana: Use modular schema (#92001)
* Zanzana: Use modular schema

* Fix tests

* Add module transform tests
2024-08-19 11:10:51 +02:00
Jeff Levin
028e8ac59e
Instrument tracing across accesscontrol (#91864)
Instrument tracing across accesscontrol 

---------

Co-authored-by: Dave Henderson <dave.henderson@grafana.com>
2024-08-16 14:08:19 -08:00
Yuri Tseretyan
135f6571a9
Alerting: Update Time Interval service to support renaming of resources (#91856)
* add RenameTimeIntervalInNotificationSettings to storage
* update dependencies when the time interval is renamed
---------

Co-authored-by: William Wernert <william.wernert@grafana.com>
2024-08-16 20:55:03 +03:00
Ieva
ac72098248
RBAC: Update access action set toggle stage (#91976)
update access action set toggle stage
2024-08-16 13:57:09 +03:00
Todd Treece
e60b0aef83
Plugins: Add support for ResourceConversion (#91977) 2024-08-15 16:02:21 -04:00
Kristin Laemmert
c6ae2d7999
chore: add replDB to team service (#91799) 2024-08-15 12:19:38 -04:00
Fayzal Ghantiwala
e321dbb690
Alerting: Use remote Alertmanager to test templates and receivers when enabled (#91570)
* Initial impl

* Add code to test templates and receivers

* Fix linter

* Fix forked am tests

* Update mimir client

* Remove trailing whitespace

* re-trigger CI
2024-08-15 16:56:14 +01:00
Santiago
f852bf684a
Alerting: Fix duplicated silences in remote primary mode bug (#91902)
* Alerting: Fix duplicated silences in remote primary mode bug

* test that a new silence id returned by calling CreateSilence() on the internal Alertmanager is ignored
2024-08-15 17:14:55 +02:00
Alexander Zobnin
aaf33c7923
Zanzana: Migrate basic, fixed and custom roles (#91814)
* Zanzana: Migrate basic roles permissions

* add basic roles assignments

* refactor

* Sync basic roles permissions in all orgs

* migrate fixed roles

* map root folders to orgs

* fix basic role assignments in orgs

* migrate other roles

* migrate team roles assignments

* add notes about authorization schema

* don't migrate fixed roles
2024-08-15 16:13:27 +02:00
Yuri Tseretyan
5834981f86
Alerting: Add GetTemplate to template service and update tests (#91854)
* add GetTemplate to template service
* refactor GetTemplates to fetch all provenances at once
* refactor tests
2024-08-15 09:17:48 -04:00
Joao Silva
42efb14989
Bookmarks: Move building logic to the Frontend (#91849) 2024-08-15 13:35:20 +01:00
Ryan McKinley
a0cd89860e
Identity: Add endpoint to get display info for an identifier (#91828) 2024-08-15 14:38:43 +03:00
Alexander Akhmetov
c7fdf8ce70
Alerting: Add error to annotations on data source errors (#91594) 2024-08-15 12:34:50 +02:00
Karl Persson
5105fb7f3a
Identity: remove GetIDClaims (#91901)
remove GetIDClaims
2024-08-15 11:39:13 +02:00
Alexander Weaver
34ab5fe1f3
Alerting: Restart rule routines if the type changes (#90867)
* Restart when types change

* Wire up test hooks correctly

* testing
2024-08-14 14:57:47 -05:00
Karl Persson
8d36111420
IDForwarding: Set identity type and uid (#91830)
* Set identity type and uid

* Set uid without prefix

* Update authlib version

* Update to new claim name
2024-08-14 10:51:44 +02:00
Todd Treece
1b0e6b5c09
K8s: Data Plane Aggregator (#91228) 2024-08-13 22:28:17 +03:00
Yuri Tseretyan
7b919e3277
Alerting: MuteTimeService to support TimeInterval and MuteTimeInterval fields in Alertmanager config (#91500)
* update notification policy provisioing to consider time intervals
* change names of intervals to be in order
2024-08-13 11:37:21 -04:00
Leonor Oliveira
d52d04b6d8
Revert "Use dw dynamic config" (#91846)
Revert "Use dw dynamic config (#91222)"

This reverts commit 0258842f87.
2024-08-13 17:24:26 +02:00
Mihai Doarna
b4db8bb967
LDAP: Remove omitempty flag from json annotation (#91843)
* remove omitempty flag from json annotation

* fix unit test
2024-08-13 18:17:52 +03:00
Yuri Tseretyan
db33df5041
Alerting: Template API to return errutil errors (#91821) 2024-08-13 10:59:19 -04:00
Andres Martinez Gotor
9067797eb4
Feature: Allow to install plugins through configuration (#91790) 2024-08-13 16:57:55 +02:00
Bruno
90b44fdcbf
Cloud migrations: GetSnapshotList only returns snapshots that belong to a session that exists (#91798)
* Cloud migrations: GetSnapshotList only returns snapshots that belong to a session that exists

* Cloud migrations: test GetSnapshotList

* add one more test case for GetSnapshotList

* fix test

* store encryption key for testing
2024-08-13 09:57:53 -03:00
Alexander Akhmetov
149f02aebe
Alerting: Add rule_group label to grafana_alerting_rule_group_rules metric (#88289)
* Alerting: Add rule_group label to grafana_alerting_rule_group_rules metric (#62361)

* Alerting: Delete rule group metrics when the rule group is deleted

This commit addresses the issue where the GroupRules metric (a GaugeVec)
keeps its value and is not deleted when an alert rule is removed from the rule registry.
Previously, when an alert rule with orgID=1 was active, the metric was:

  grafana_alerting_rule_group_rules{org="1",state="active"} 1

However, after deleting this rule, subsequent calls to updateRulesMetrics
did not update the gauge value, causing the metric to incorrectly remain at 1.

The fix ensures that when updateRulesMetrics is called it
also deletes the group rule metrics with the corresponding label values if needed.
2024-08-13 13:27:23 +02:00
Jeff Levin
8961f392f0
add team_member index on user_id org_id (#91819)
This pr adds a composite index on on the team_member table on user_id and org_id
2024-08-13 13:58:00 +03:00
Alexander Akhmetov
b2eeb0dd6e
Alerting: update rule versions on folder move (#88376)
* Alerting: update rule versions on folder move (#88361)
* Add tracing to folder.Move and folder.Update
2024-08-13 12:26:26 +02:00
Yulia Shanyrova
8044cb50f1
Plugins: Plugin details right panel is added. All the details were moved from thee top to the right panel (#90325)
* PluginDetailsRight panel is added. All the details were moved from the top to the right panel

* Add feature toggle pluginsDetailsRightPanel,Fix build, fix review comments

* Fix the typo

Co-authored-by: Giuseppe Guerra <giuseppe.guerra@grafana.com>

* hasAccessToExplore

* changes after review, add translations

* fix betterer

* fix betterer

* fix css error

* fix betterer

* fix translation labels, fix position of the right panel

* fix the build

* add condition to show updatedAt for plugin details

* add test to check 2 new fields at plugin details right panel;

* change the gap and remove report abuse button from core plugins

* add more tests

---------

Co-authored-by: Giuseppe Guerra <giuseppe.guerra@grafana.com>
2024-08-13 11:55:30 +02:00
Ana Ivanov
8467838bef
Navigation: Remove grafana-aws-app from Infrastructure navigation (#91524)
Remove grafana-aws-app from Infrastructure navigation
2024-08-13 11:54:30 +03:00
Karl Persson
8bcd9c2594
Identity: Remove typed id (#91801)
* Refactor identity struct to store type in separate field

* Update ResolveIdentity to take string representation of typedID

* Add IsIdentityType to requester interface

* Use IsIdentityType from interface

* Remove usage of TypedID

* Remote typedID struct

* fix GetInternalID
2024-08-13 10:18:28 +02:00
Leonor Oliveira
0258842f87
Use dw dynamic config (#91222)
* Remove kubernetesPlaylists feature_toggle

* Remove unified_storage_mode

* Remove double import

* Regenerate feature-toggles

* Read from config instead from feature_toggle

* cover scenario for when unified storage is not defined
2024-08-13 10:03:28 +02:00
Konrad Lalik
b67bcdb9b8
Alerting: Handle namespace and group query string params in Ruler API (#91533)
* Handle namespace and group query string params in Ruler API

* Use the new namespace and group query params when slashes in names

* Add validation, add group handling in GMA Api

* Move constants

* Use checkForPathSeparator function

* Fix linter issue
2024-08-13 08:31:07 +02:00
Andres Martinez Gotor
d342e76f63
Chore: Add skeleton for background plugin installer (#91743) 2024-08-12 16:39:31 +02:00
Fayzal Ghantiwala
25dbb32cea
Alerting: Vendor in latest grafana/alerting package (#91786)
* temp

* vendor

* Remove dead code

* Vendoring
2024-08-12 15:37:15 +01:00
Vijay Samuel
c9ddc688a2
Prometheus: Add support to make parallel queries (#90316)
* Add support for prometheus datasource to make parallel queries

* Incorporate review comments

* Update pkg/promlib/querydata/request.go

Co-authored-by: ismail simsek <ismailsimsek09@gmail.com>

* Fix lint

* Add parallel queries behind feature flag

* Fixing lint issue

* Update go.mod

* Update pkg/promlib/querydata/request.go

* Update pkg/promlib/querydata/request.go

---------

Co-authored-by: ismail simsek <ismailsimsek09@gmail.com>
Co-authored-by: Charandas <542168+charandas@users.noreply.github.com>
2024-08-12 14:31:39 +02:00
Santiago
5487ea444a
Alerting: Update remote Alertmanager config marshalling in test (#91791) 2024-08-12 13:45:22 +02:00
Andreas Christou
82d051f336
AzureMonitor: Mark Azure Prometheus exemplars as public preview (#91674)
Mark Azure Prom exemplars as public preview
2024-08-12 11:11:45 +01:00
Ieva
6e7bc028d0
RBCA: Better separation between action set svc and store (#91491)
better separation between action set svc and store
2024-08-12 10:07:33 +01:00
Ashley Harrison
ab3e8652aa
Adhoc Filters: add new feature toggle for 'one of' operator (#91688)
add new feature toggle for 'one of'
2024-08-12 09:56:42 +01:00
Ryan McKinley
21d4a4f49e
Auth: use IdentityType from authlib (#91763) 2024-08-12 09:26:53 +03:00
Todd Treece
75f0b3a228
K8s: Test for changes to aggregator's postStartHooks (#91771) 2024-08-10 20:32:57 -04:00
Todd Treece
5972dd0b59
Chore: Update names of DisabledPostStartHooks (#91767) 2024-08-09 16:57:08 -04:00
Ryan McKinley
243c0935fc
Auth: Use claims.AuthInfo in requester (#91739) 2024-08-09 19:46:56 +03:00
Yuri Tseretyan
1108a00668
Alerting: Support for optimistic concurrency in priovisioning Tempate API (#91195)
* support optimistic concurrency in template service

* update request handler to get version from query parameter

* return not found if a new template is set with version

* update PUT api to set version

* update documentation + for mute timings

---------

Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>
2024-08-09 11:40:07 -04:00
Karl Persson
bcfb66b416
Identity: remove GetTypedID (#91745) 2024-08-09 18:20:24 +03:00
Michael Mandrus
eee3a75b8b
CloudMigrations: Misc cleanup before codefreeze (#91725)
* fix retry logic

* slight adjustments

* fix disconnect and connect events

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

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

---------

Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>
2024-08-09 17:38:08 +03:00
lean.dev
e20c7342a9
CloudMigration: Removes snapshot and resources when deleting a session (#91548) 2024-08-09 16:42:45 +03:00
Alexander Zobnin
1cc438a56c
Zanzana: Evaluate dashboard and folder permissions (#91539)
* Zanzana: basic folder permissions checks

* Fix managed permissions for teams

* fix sync batch size

* add dashboards actions translations

* migrate folder tree

* migrate dashboard folders

* remove action sets from schema

* Adding more dashboard and folder-related permissions

* refactor

* Correctly translate dashboard permissions in folders

* fix dashboard parent permissions
2024-08-09 13:48:56 +02:00
Todd Treece
122e291134
Chore: Add dataplaneAggregator feature toggle (#91715) 2024-08-09 04:41:07 -04:00
Kristin Laemmert
54177ca619
experiment: use read replica for Get and Find Dashboards (#91706) 2024-08-08 14:22:55 -04:00
Kristin Laemmert
299c142f6a
QuotaService: refactor to use ReplDB for Get queries (#91333)
* Feature (quota service): Use ReplDB for quota service Gets

This adds the replDB to the quota service, as well as some more test helper functions to simplify updating tests. My intent is that the helper functions can be removed when this is fully rolled out (or not) and we're consistently using the ReplDB interface (or not!)

* test updates
2024-08-08 13:41:33 -04:00
Todd Treece
b4126d3bce
Chore: Update k8s.io dependencies (#91692) 2024-08-08 18:39:44 +03:00
Alexander Zobnin
0e5d7633f7
Access Control: Make it possible to exclude role grants (#91647) 2024-08-08 14:11:17 +02:00
Joey Orlando
cb540a28bd
Plugins: add IRM plugin to "Alerts & IRM" left-hand navigation group (#91423)
add IRM plugin to "Alerts & IRM" left-hand navigation group
2024-08-07 09:44:43 -04:00
Kristin Laemmert
a117b090cf
chore: preallocate slices where we have a good idea of requirements (#91596)
* chore: preallocate slices where we have a good idea of requirements

* pr feedback
2024-08-07 08:34:52 -04:00
Andre Pereira
d84fd94936
Tempo: Add migration to enable TraceQL streaming for Tempo datasources (#91340)
* Add migration to enable TraceQL streaming for Tempo datasources

* lint

* Always run migration but exit early if feature flag is disabled

* Require feature toggle OR datasource config to enable streaming
2024-08-06 18:09:06 +01:00
Michael Mandrus
6cd0971dc6
CloudMigration: Show warning message for successfully migrated non-core data sources (#91545)
* minor performance improvement

* apply a warning to any non-core plugins that successfully migrate

* commit frontend wip while I refactor some stuff

* update api

* repurpose error dialog to be a generic details dialog

* whitespace

* add unit test

* fixes from testing

* fix migration summary

* add comment

* fix localization stuff

* fix backend test

* reduce number of queries to the db

* some PR feedback

* whitespace
2024-08-06 19:35:10 +03:00
Yuri Tseretyan
ee78bb653f
Alerting: Log rule evaluation error in scheduler (#91585) 2024-08-06 19:27:02 +03:00
owensmallwood
2387798719
Unified Storage: Propagate traces from the apiserver grpc client (#91226) 2024-08-06 09:52:11 -06:00
Jeff Levin
d4916207a0
chore(tracing): add tracing for frontend and db session (#91509)
This PR adds instrumentation for loading frontend SPA along with select methods in the dashboard service, and cleans up span handling in sqlstore.

---------

Co-authored-by: Dave Henderson <dave.henderson@grafana.com>
2024-08-05 17:17:39 -08:00
Kristin Laemmert
b6de9e9d3c
search v2: pre-allocate dashboardQueryResult slice capacity for performance (#91536)
* search v2: pre-allocate dashboardQueryResult slice for performance
* use limit parameter for starting slice size
2024-08-05 13:54:57 -04:00
Matthew Jacobson
53cfdf0ef8
Alerting: Remove option to return settings from api/v1/receivers and restrict provisioning action access (#90861)
* Remove provisioning action access to v1/receivers api

* Separate ListOnly functionality to its own method without decryption
2024-08-05 11:49:23 -04:00
Michael Mandrus
4d23382497
Caching: Handle memcached reconnects (#91498)
* update library version

* update tls memcached feature toggle

* update to latest version

* updae gomemcache version
2024-08-05 11:21:11 -04:00
AvivGuiser
93aa5a56ad
Alerting: Use stable identifier of a group,contact point,mute timing when export to HCL (#90917)
---------

Signed-off-by: Aviv Guiser <avivguiser@gmail.com>
2024-08-05 09:56:17 -04:00
Ryan McKinley
a223c46506
APIServer: Make TableConverter part of ResourceInfo (#91520) 2024-08-05 15:38:12 +03:00
Matthew Jacobson
a397bca02e
Alerting: Fix panic with nil annotations & Nodata=alerting/ok/keep (#91506) 2024-08-02 22:15:57 +03:00
Vardan Torosyan
1747cd1747
[Auth] Enable cloudRBACRoles feature toggle for self-serve (#91036)
Enable cloudRBACRoles feature toggle for self-serve
2024-08-02 16:47:00 +02:00
Alexander Weaver
72ecde5045
Alerting: Make orgID a direct arg of writer interface (#91422)
make orgID a direct arg of writer interface
2024-08-02 09:37:28 -05:00
Leonor Oliveira
6f6a06435d
Remove unified_storage_mode reference in the grafana repo (#91481) 2024-08-02 15:40:05 +02:00
Claudiu Dragalina-Paraipan
e2435f92f1
[authn]: add GetIDClaims() to Requester (#91387)
* authn: add GetIDClaims() to Requester

Co-Authored-By: Gabriel MABILLE <gamab@users.noreply.github.com>

* authn: update StaticRequester

Co-Authored-By: Gabriel MABILLE <gamab@users.noreply.github.com>

* update auth/idtest/mock

Co-Authored-By: Gabriel MABILLE <gamab@users.noreply.github.com>

* Fix test

Co-authored-by: Claudiu Dragalina-Paraipan <claudiu.dragalina@grafana.com>

---------

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
Co-authored-by: gamab <gabriel.mabille@grafana.com>
2024-08-02 12:36:02 +03:00
Gabriel MABILLE
8988e04044
RBAC: Add permission registry (#91247)
* RBAC: Permission registry

* Populate permission registry

* Wire

* conflic_user_cmd

* Update pkg/services/accesscontrol/permreg/permreg_test.go

Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>

* PR feedback

Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>

* Remove ToDo, tackle in subsequent PR

---------

Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
2024-08-02 09:32:06 +02:00
Nathan Marrs
b63694d75f
XYChart: Promote to generally available (#91417) 2024-08-01 16:54:36 -07:00
Alexander Akhmetov
3952f627eb
Alerting: Parse secret fields case-insensitively when creating or updating a contact point (#90968)
* Alerting: Handle case-insensitive secret fields in contact point settings
2024-08-01 19:03:47 +02:00
William Wernert
a1ee84f757
Alerting: Remove duplicate tracing middleware from prom writer (#91353)
Remove duplicate tracing middleware from prom writer
2024-08-01 11:57:14 -04:00
Ieva
2e2ddc5c42
Folders: Allow folder editors and admins to create subfolders without any additional permissions (#91215)
* separate permissions for root level folder creation and subfolder creation

* fix tests

* fix tests

* fix tests

* frontend fix

* Update pkg/api/accesscontrol.go

Co-authored-by: Eric Leijonmarck <eric.leijonmarck@gmail.com>

* fix frontend when action sets are disabled

---------

Co-authored-by: Eric Leijonmarck <eric.leijonmarck@gmail.com>
2024-08-01 18:20:38 +03:00
Gabriel MABILLE
c76d1e04e8
Authz: Fix on-prem grpc authentication (#91341)
* Authz: Fix on-prem grpc authentication

Co-authored-by: Claudiu Dragalina-Paraipan <claudiu.dragalina@grafana.com>

* Remove noAuth override

---------

Co-authored-by: Claudiu Dragalina-Paraipan <claudiu.dragalina@grafana.com>
2024-08-01 16:30:13 +03:00
Charandas
a3d3f9a1e4
Revert "Identity: Remove id token from extra info (#91169)" (#91350)
This reverts commit 10170cb839.
2024-07-31 21:27:46 +03:00
Haris Rozajac
e81fa0e4c5
Explore: Check for RBAC permissions when hitting query history endpoints (#91156)
* Check for RBAC permissions when hitting query history endpoints; extract checking logic into a middleware

* Fix lint errors

* Fix test

* Use permissions for patch path; rename callback handler
2024-07-31 12:10:52 -06:00
lean.dev
235f223aef
CloudMigrations: Fix typo in trace name (#91261) 2024-07-31 10:24:40 -03:00
colin-stuart
057c04ed9d
IDToken: Add current user's DisplayName to the ID token (#90992)
Set claims.Rest.DisplayName from the IDService
2024-07-31 09:11:37 -04:00
Joao Silva
85d0e17dc4
Bookmarks: Store URLs instead of ids (#91121) 2024-07-31 13:56:39 +01:00
Ieva
702fc3477d
RBAC: Fix folder move check when action sets are disabled (#91200)
fox folder move check when action sets are disabled
2024-07-31 09:49:09 +01:00
Giuseppe Guerra
95f340738c
Angular deprecation: Disable dynamic angular inspector if CheckForPluginUpdates is false (#91194)
* Angular deprecation: Disable dynamic angular inspector if CheckForPluginUpdates is false

* Add tests

* add type checks for dynamic service
2024-07-31 10:10:12 +02:00
Ryan McKinley
160fe2a3a4
Storage: Remove entity store (#91233) 2024-07-31 09:25:39 +03:00
Ryan McKinley
10170cb839
Identity: Remove id token from extra info (#91169) 2024-07-31 09:14:13 +03:00
Ryan McKinley
68f1a0619d
Snapshots: Remove deprecated option snapshot_remove_expired (#91231) 2024-07-31 08:47:15 +03:00
Nathan Marrs
fc1139e51a
Transformations: Promote format string as generally available (#91161) 2024-07-31 05:10:07 +03:00
Nathan Marrs
0423c67495
Transformations: Promote add field from calc stat function cumulative and window calcs as generally available (#91160) 2024-07-31 03:30:24 +03:00
Yuri Tseretyan
537f1fb857
Alerting: Fix persisting result fingerprint that is used by recovery threshold (#91224)
* fix persister to save result fingerprint

* revert change

* fmt
2024-07-30 18:07:13 -04:00
Nihal
9ad9b4989b
Alerting: Include a list of ref_Id and aggregated datasource UIDs to alerts when state reason is NoData (#88819)
* include a list of ref_Id and datasource UID to alerts when state reason is NoData. 

---------

Signed-off-by: Syed Nihal <syed.nihal@nokia.com>
2024-07-30 12:55:59 -04:00
Kristin Laemmert
ac0b4bb34d
refactor replCfg to look more like plugins/plugin config (#91142)
* refactor replCfg to look more like plugins/plugin config
* validateReplicaConfigs must handle inconsistencies in type names due to the WithHooks suffix
2024-07-30 12:09:56 -04:00
Alexander Weaver
4c71cadd5f
Alerting: Detach condition validator from condition evaluator (#91150)
* Detach validator from evaluator

* Drop unnecessary interface and type
2024-07-30 10:55:37 -05:00
Claudiu Dragalina-Paraipan
cf55ac5813
authz: set authzv1.ReadResponse.Found (#91212)
Co-authored-by: Gabriel MABILLE <gabriel.mabille@grafana.com>
2024-07-30 18:26:54 +03:00
github-actions[bot]
66b1a219f4
Alerting: Update Swagger spec (#79850)
* chore: update alerting swagger spec
* update public swagger

---------

Co-authored-by: rwwiv <rwwiv@users.noreply.github.com>
Co-authored-by: Yuri Tseretyan <yuriy.tseretyan@grafana.com>
2024-07-30 18:17:23 +03:00
Yuri Tseretyan
2023821100
Alerting: update Loki backend of state history to batch requests by folder (#89865)
* refactor `selectorString` and remove Selector struct

* move code from selector string to BuildLogQuery

* batch requests by folder UID

* update historian annotation store to handle multiple queries

* sort folder uids to make consistent queries

* add logs to loki http

* log batch size but not content. content is logged by the client
2024-07-30 11:07:10 -04:00
Claudiu Dragalina-Paraipan
05ab4cdd1f
[authz]: use authlib client (#91205)
authz: use authlib client

Co-authored-by: Gabriel MABILLE <gabriel.mabille@grafana.com>
2024-07-30 17:49:46 +03:00
Michael Mandrus
3e138449bb
CloudMigrations: Fix bugs found during local testing (#91163)
* send dashboard commands instead of dashboards

* move status updates before goroutine to ensure frontend polls

* fix syncing issues between snapshot state and resources

* make sessionUid a requirement for modifying snapshots

* move the function I meant to move earlier

* remove accidental commit

* another accidental commit

* verify UpdateSnapshot is called with sessionUid

* revert

* pass in session uid everywhere

* forgot to save

* fix unit test

* fix typo

* tiny tweak
2024-07-30 09:02:41 -04:00
Vardan Torosyan
e20f8c566d
RBAC sync: Fix removal of roles which need to be added (#91152)
* RBAC sync: Fix removal of roles which need to be added

* Optimize code

* cleanup: appease the linter

---------

Co-authored-by: Victor Cinaglia <victor@grafana.com>
2024-07-30 09:00:47 +02:00
Ryan McKinley
728150bdbd
Identity: extend k8s user.Info (#90937) 2024-07-30 08:27:23 +03:00
Yuri Tseretyan
8323b688c6
Alerting: Improve logging in scheduler and states (#91003)
* handle metadata map nil

* remove double context

* clean up logging in scheduler

* do not reuse loggers from previous ticks

* log the dropped tick

* log tick instead of ticknum

* replace with processing tick logs

* log sending notifications

* update logging in persister to fetch context

* logs to historian

moved them upstream to be able to log when store is overridden
2024-07-29 16:01:48 -04:00
Matthew Jacobson
62f67e38b8
Alerting: Implement receiver auth service (#90857) 2024-07-29 15:49:10 -04:00
Gabriel MABILLE
b982259950
RBAC: Default to plugins.app:access for plugin includes (#90969)
* Default to app access for includes

* Check plugin type
2024-07-29 20:56:09 +02:00
Yuri Tseretyan
34dbfefc86
Alerting: Template service to check for provenance status of update\delete (#90688) 2024-07-29 14:10:03 -04:00
lean.dev
d8555019f1
CloudMigrations: Fix migration in docker (#91147) 2024-07-29 15:00:43 -03:00
Michael Mandrus
a6088e4ee4
CloudMigrations: Improvements to backend (#91012)
* E2C: Add stat rollup to MigrationSummary

* fix report event url

* open form in new page

* sort folders by heirarchy

* undo accidental commit

* remove another commit

* make folder sorting dynamic

---------

Co-authored-by: joshhunt <josh@trtr.co>
2024-07-29 17:55:22 +00:00
Kristin Laemmert
af19f039b6
Chore (sqlstore): add validation and testing for repl config (#90683)
* add some validation and testing for repl cf
* connection strings are secrets
2024-07-29 10:32:56 -04:00
Leonor Oliveira
8345af928c
[Dual writer] Read kind value passed as dualwriter's argument (#91113)
* Include kind on the dualwriter to be used on metrics

* Use kind as argument

* Skip dual writer in mode4
2024-07-29 13:57:44 +02:00
Ida Štambuk
ec3dc74080
Features: Release Cloudwatch Metric Insights cross-account querying to public preview (#91066) 2024-07-29 12:23:46 +02:00
Will Browne
1b3fa8c47f
Plugins: Hide version information when plugin is managed (#88065)
* first pass

* fixup

* fix linter issues

* fix API test

* update naming

* rework

* update var name

* empty check

* prettier

* fix test

* fix lint
2024-07-29 11:18:43 +01:00
Matthew Jacobson
a1f0b599a7
Alerting: Refactor receiver_svc and provisioning config store into legacy_storage package (#90856)
* Add more receivers api tests

* Move provisioning config store to new legacy_storage package
2024-07-26 17:45:33 -04:00
Yuri Tseretyan
6b0d20c96a
Alerting: time interval service to support addressing intervals by Base64 encoded name (#90563)
* rename to getMuteTimingByName

* add UID to api model of MuteTiming

* update GetMuteTiming to search by UID

* update UpdateMuteTiming to support search by UID

* update DeleteMuteTiming to support uid

* make sure UID is populated

* update usages

* use base64 url-safe, no padding encoding for UID
2024-07-26 16:43:40 -04:00
Alexander Weaver
b7220b532e
Alerting: Fix bug where patching recording rule queries wouldn't apply (#91011)
* the fix

* tests
2024-07-26 11:02:54 -05:00
Ryan McKinley
ec6c6bd6c3
Identity: Add read-only identity apiserver (#90418) 2024-07-26 17:09:08 +03:00
Ryan McKinley
be7b1ce2df
Chore: Replace appcontext.User(ctx) with identity.GetRequester(ctx) (#91030) 2024-07-26 16:39:23 +03:00
Kristin Laemmert
daedb358dd
chore (replstore): fix registration with multiple sql drivers, again (#90990)
* replstore: fix registration with multiple sql drivers, again
* only compile regex once
2024-07-25 15:13:36 -04:00
Georges Chaudy
4baca6947d
ResourceServer: make the resource store the default unified storage backend (#90899)
* make the resource store the default unified storage backend

* add integration tests

* fix test non passing

* Update pkg/storage/unified/sql/test/integration_test.go

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>

* lint

* fix tests

* fix no rows

---------

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2024-07-25 18:17:39 +02:00
Kevin Minehart
c326d865c5
RBAC: Allow plugins to use scoped actions (#90946)
Co-authored-by: gamab <gabriel.mabille@grafana.com>
2024-07-25 17:22:42 +03:00
Ryan McKinley
9db3bc926e
Identity: Rename "namespace" to "type" in the requester interface (#90567) 2024-07-25 12:52:14 +03:00
Sven Grossmann
94dd4105e2
Loki: Allow alert headers to be forwarded (#90890)
* Loki: Allow alert headers to be forwarded

* Loki: fix tests

---------

Co-authored-by: Yuri Tseretyan <yuriy.tseretyan@grafana.com>
2024-07-25 07:39:34 +02:00
Michael Mandrus
dc355331a6
CloudMigrations: Store encryption key in unified secrets table (#90908)
* store encryption key in unified secrets table

* fix local dev mode

* make metadata more realistic

* fix tests

* fix sql queries against postgres

* fix stats endpoint
2024-07-25 06:34:25 +03:00
Ieva
9bb2cf4968
RBAC: Allow omitting default permissions when a new resource is created (#90720)
* Cfg: Move rbac settings to own struct

* Cfg: Add setting to control if resource should generate managed permissions when created

* Dashboards: Check if we should generate default permissions when dashboard is created

* Folders: Check if we should generate default permissions when folder is created

* Datasource: Check if we should generate default permissions when datasource is created

* ServiceAccount: Check if we should generate default permissions when service account is created

* Cfg: Add option to specify resources for wich we should default seed

* ManagedPermissions: Move providers to their own files

* Dashboards: Default seed all possible managed permissions if configured

* Folders: Default seed all possible managed permissions if configured

* Cfg: Remove service account from list

* RBAC: Move utility function

* remove managed permission settings from the config file examples, change the setting names

* remove ini file changes from the PR

* fix setting reading

* fix linting errors

* fix tests

* fix wildcard role seeding

---------

Co-authored-by: Karl Persson <kalle.persson@grafana.com>
Co-authored-by: jguer <me@jguer.space>
2024-07-24 19:31:26 +03:00
Vardan Torosyan
82236976ae
Add support ticket fixed roles to cloud role sync (#90864)
* Add support ticket fixed roles to cloud role sync

* Adding tests

* Fix the linter
2024-07-24 17:58:21 +02:00
Jo
93a979d46d
Auth: Fix grafana-auth-app menu not being displayed (#90882)
Auth: Fix grafana-auth-app menu not being displayed if user only has access to cloud access policies
2024-07-24 15:10:19 +02:00
Santiago
b79b38f02c
Alertmanager: Support limits for silences (#90826)
* Alertmanager: support limits for silences

* update grafana/alerting to latest main
2024-07-24 14:22:29 +02:00
Leonor Oliveira
ec343f276f
Dual writer: mode 4 (#90581)
* Itroduce watcher and mode4

* Logging

* Mode4 should be initialized from the dual writer for observability

* Comment watch while it's not implemented

* Lint

* Use mode log when dual writer is initiated

* Use error from logger
2024-07-24 14:10:10 +02:00
Sven Grossmann
80b2e793ab
Loki: Remove unnecessary featuremgmt (#90874)
Loki: Remove unnecessary featuremgmt
2024-07-24 11:00:41 +02:00
Ieva
c2e0952553
Folders: Improve folder move permission checks (#90588)
* check that a user doesn't have higher plugin access on the destination folder than they have on the source folder when moving folders

* Update pkg/services/folder/folderimpl/folder_test.go

---------

Co-authored-by: Jo <joao.guerreiro@grafana.com>
2024-07-23 17:07:27 +01:00
Dave Henderson
a59c9525c1
notifications: Fix flaky SMTP tests (#90801)
Signed-off-by: Dave Henderson <dave.henderson@grafana.com>
2024-07-23 08:22:00 -04:00
Alex Khomenko
8966083132
Pin Nav Items: Add tracking for pinned items clicks (#90803)
* Pin Nav Items: Add tracking for pinned items clicks

* Update id

* Simplify onClick logic
2024-07-23 14:58:50 +03:00
Ashley Harrison
8f9dc4a923
Navigation: move bodyScrolling to be public preview (#90811)
move bodyScrolling to be publicPreview
2024-07-23 10:02:06 +01:00
Michael Mandrus
8e3e64460b
CloudMigrations: Change onPremToCloudMigrations feature toggle to public preview (#90757)
* update feature toggle stage

* a word

* update docs
2024-07-23 03:30:51 +03:00
William Wernert
45f298120e
Alerting: Return error when writing recorded metrics instead of default writing NaN (#90743)
* Return error instead of default writing NaN
2024-07-22 15:47:02 -04:00
Jean-Philippe Quéméner
bf09d8f615
chore(tests): skip flaky test (#90763) 2024-07-22 21:18:05 +04:00
Diego Augusto Molina
399d77a0fd
Resource server improvements and fixes (#90715)
* cleanup dependencies and improve list method
* Improve Resource Server API, remove unnecessary dependencies
* Reduce the API footprint of ResourceDBInterface and its implementation
* Improve LifecycleHooks to use context
* Improve testing
* reduce API size and improve code
* sqltemplate: add DialectForDriver func and improve naming
* improve lifecycle API
* many small fixes after adding more tests
2024-07-22 20:08:30 +03:00
Bruno
8d8f2ba587
Cloud migration: encryption key is a byte slice (#90739)
* Cloud migrations: include metadata returned by CMS in the index file

* Cloud migrations: make EncryptionKey a []byte in structs

* test
2024-07-22 11:25:12 -03:00
Bruno
07685646a3
Cloud migrations: include metadata returned by CMS in the index file (#90658) 2024-07-22 10:11:57 -03:00
Ida Štambuk
5b17cd93c5
Cloudwatch: Remove awsDatasourcesNewFormStyling feature toggle (#90128)
* Remove toggle from cloudwatch plugin

* Remove feature toggle from registry

---------

Co-authored-by: Kevin Yu <kevinwcyu@users.noreply.github.com>
2024-07-22 14:48:17 +02:00
Joao Silva
546f4aa700
Navigation: Show list of pinned items on MegaMenu (#90280)
* Navigation: Show list of pinned ites on the navigation

* Rename section to 'Bookmarks'

* Internationalization

* Rename everything to bookmarks

* Update public/app/core/reducers/navBarTree.ts

Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>

* Ignore empty message as well

* Dont update navigation if there is an error patching

---------

Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
2024-07-22 11:43:40 +01:00
Ieva
4c7d8c8cdd
RBAC: Refactor RBAC plugin interface code (#90679)
move plugin RBAC registration ifaces to pluginsintegrations
2024-07-22 09:31:36 +01:00
Piotr Jamróz
042c239a56
Query History: Enable query history test (#90597)
* Enable query history test

* Fix time range in the test
2024-07-22 09:22:41 +02:00
Michael Mandrus
ee90cd3031
CloudMigrations: Send local events to gms during the migration process (#90637)
* add gms client function

* add timeout config for endpoint

* report events to gms

* fix lint error

* clean up report calls and make sure reports all have local ids

* extra validation

* improve error logging and fix url
2024-07-20 07:02:31 +03:00
Kristina
a0268a9ad2
Query History: Prevent viewers from accessing (#88735)
* Add permissions check for viewer without viewers_can_edit

* Add test

* fix lint

* Add role checks on other handlers

* Linter and fix Go issue

* Fix conflict

* Remove invalid way of testing for error
2024-07-19 14:44:58 -05:00
Eric Leijonmarck
248af65f9c
Actionsets: Add ability for plugins to add actions for core actionsets (i.e. folders:edit) (#88776)
* initial commit

* Action sets stored
remove the dependancy for actionsets
got the actionsets registered
storing the permissions

* fix golanglinting

* remove unused struct field

* wip

* actionset registry for a plugin from the actionsetservice

* update to make declareactionset the primary way of plugin registration and modification

* declare actually extends actionsets

* tests fixed

* tests skipped

* skip tests

* skip tests

* skip tests

* skip tests

* change to warning instead

* remove step from pipeline to see if it fails due to plugin not registering

* reintroduce step but remove features dependancy

* add back the tests that were failing

* remove comments and another skip test

* fix a comment and remove unneeded changes

* fix and clean up, put the behaviour behind a feature toggle

* clean up

* fixing tests

* hard-code allowed action sets for plugins

* Apply suggestions from code review

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>

* small cleanup

---------

Co-authored-by: IevaVasiljeva <ieva.vasiljeva@grafana.com>
Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
2024-07-19 16:16:23 +01:00
AvivGuiser
96c3e9c550
Alerting: Use stable identifier of a group when export to HCL (#90196)
* change the rule-group to be hashed when exporting to HCL

Signed-off-by: Aviv Guiser <avivguiser@gmail.com>

---------

Signed-off-by: Aviv Guiser <avivguiser@gmail.com>
2024-07-19 18:13:26 +03:00
Nathan Vērzemnieks
f8c43d0bf3
Elasticsearch: Decouple backend from infra/tracing (#90528) 2024-07-19 09:26:10 +02:00
Dave Henderson
05b66aac5f
notifications: Fix confused trace spans in SMTP client (#90559)
Signed-off-by: Dave Henderson <dave.henderson@grafana.com>
2024-07-18 23:20:40 -04:00
Alexander Weaver
418b077c59
Alerting: Integration testing for recording rules including writes (#90390)
* Add success case and tests for writer using metrics

* Use testable version of clock

* Assert a specific series was written

* Fix linter

* Fix manually constructed writer
2024-07-18 17:14:49 -05:00
Alexander Weaver
0e269db8a9
Alerting: Expose recordingWriter on ngalert (#90573)
Expose recordingWriter on ngalert
2024-07-18 13:24:06 -05:00
Michael Mandrus
71a97b925a
CloudMigrations: Add and fix logging (#90616)
* add logs so we can see how long async processes take

* fix a bunch of error logs:

* fix logs again
2024-07-18 21:16:56 +03:00