Commit Graph

6703 Commits

Author SHA1 Message Date
Sofia Papagiannaki
c1547162e4
Dashboards: Restore deleted index (#81859)
Dashboards: Recreate deleted index
2024-02-05 11:35:13 +02:00
Gabriel MABILLE
d9f7eda284
AuthN: Switch externalServiceAccounts toggle to public preview (#81583) 2024-02-05 09:31:20 +01:00
Sofia Papagiannaki
ec5bc7c4ab
Folders: Fix failure to update folder in SQLite (#81795) 2024-02-05 10:06:11 +02:00
Ryan McKinley
202eecccbc
K8s: Update common openapi generation scripts (#81857) 2024-02-04 22:37:10 +02:00
Ryan McKinley
ba3ee60711
K8s: Allow more control over the final openapi results (#81829) 2024-02-02 14:19:45 -08:00
Ryan McKinley
651faff08a
Chore: go mod tidy after apiserver refactor (#81824) 2024-02-02 23:03:19 +02:00
Gabriel MABILLE
4a1e8f3d98
RBAC: Reject plugin registrations without a name (#81719)
* RBAC: Reject plugin registrations without a name

* Lint'
2024-02-02 11:12:00 +01:00
Sofia Papagiannaki
6f02d193f6
Provisioning: Fix failure to save dashboard (#81694) 2024-02-02 09:55:29 +00:00
Ryan McKinley
795eb4a8d8
K8s/Snapshots: Add dashboardsnapshot api group (#77667) 2024-02-01 22:40:11 -08:00
Michael Mandrus
7464ea4346
Feature Toggles: Switch feature toggle admin page over to k8s API (#80854)
* add handling for legacy and k8s apis to frontend

* use backend srv directly not redux

* add unit test to make sure the correct apis are being called

* require api server flag

* fix feature toggle name

* ensure both pages work correctly

* make consistent with legacy api

* implement webhook update

* fix unit test

* remove old apis and update

---------

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2024-02-01 23:52:02 -05:00
Ryan McKinley
9c9e5e68c8
User: Add uid colum to user table (#81615) 2024-02-01 18:14:10 -08:00
Todd Treece
67b6be5515
K8s: Refactor config/options for aggregation (#81739) 2024-02-01 17:27:30 -05:00
Yuri Tseretyan
d1073deefd
Alerting: Time intervals API (read only endpoints) (#81672)
* declare new API and models GettableTimeIntervals, PostableTimeIntervals
* add new actions alert.notifications.time-intervals:read and alert.notifications.time-intervals:write.
* update existing alerting roles with the read action. Add to all alerting roles.
* add integration tests
2024-02-01 15:17:13 -05:00
William Wernert
7e939401dc
Alerting: Introduce initial common receiver service (#81211)
* Create locking config store that mimics existing provisioning store

* Rename existing receivers(_test).go

* Introduce shared receiver group service

* Fix test

* Move query model to models package

* ReceiverGroup -> Receiver

* Remove locking config store

* Move convert methods to compat.go

* Cleanup
2024-02-01 14:42:59 -05:00
ismail simsek
8fc8b03d1d
Prometheus: Remove featuremgmt imports (#81586)
* remove featuremgmt imports

* pass down feature flags instead of reading them for every query execution
2024-02-01 18:07:32 +01:00
Alyssa Bull
312fdf9ce0
Cloud Monitoring: Fix naming (#81654) 2024-02-01 09:05:54 -07:00
George Robinson
0726c7c3fa
Alerting: Prevent inhibition rules in Grafana Alertmanager (#81712)
This commit prevents saving configurations containing inhibition
rules in Grafana Alertmanager. It does not reject inhibition
rules when using external Alertmanagers, such as Mimir. This meant
the validation had to be put in the MultiOrgAlertmanager instead of
in the validation of PostableUserConfig. We can remove this when
inhibition rules are supported in Grafana Managed Alerts.
2024-02-01 14:53:15 +00:00
Ashley Harrison
3e01ba0f57
QueryEditor: remove slateAutocomplete toggle (#81696)
remove toggle
2024-02-01 13:03:11 +00:00
Gabriel MABILLE
3df0611f81
RBAC: Fix authorize in org (#81552)
* RBAC: Fix authorize in org

* Implement option 2

* Fix typo

* Fix alerting test

* Add test to cover the not member case
2024-02-01 12:37:01 +01:00
ismail simsek
536153c336
InfluxDB: Run queries in parallel behind influxdbRunQueriesInParallel feature toggle (#81209)
* create the feature flag

* bring the concurrency in to the play

* Update feature flag

* Use concurrency number from settings

* update influxdb dependency

* use ConcurrentQueryCount from plugin-sdk-go

* use helper method for concurrent query count

* log the error

* add value guard

* add unit tests

* handle concurrency error
2024-02-01 11:58:24 +01:00
idafurjes
1a51240dc7
Remove some folderIDs from database test (#81643)
* Remove some folderIDs from database test

* Add folderUID to insertTestDashboardForPlugin
2024-02-01 10:13:15 +01:00
Matthew Jacobson
0ce1ccd6f9
Alerting: Fix inconsistent AM raw config when applied via sync vs API (#81655)
AM config applied via API would use the PostableUserConfig as the AM raw
config and also the hash used to decide when the AM config has changed.
However, when applied via the periodic sync the PostableApiAlertingConfig would
be used instead.

This leads to two issues:
- Inconsistent hash comparisons when modifying the AM causing redundant applies.
- GetStatus assumed the raw config was PostableUserConfig causing the endpoint
to return correctly after a new config is applied via API and then nothing once
 the periodic sync runs.

Note: Technically, the upstream GrafanaAlertamanger GetStatus shouldn't be
returning PostableUserConfig or PostableApiAlertingConfig, but instead
GettableStatus. However, this issue required changes elsewhere and is out of
scope.
2024-01-31 21:05:30 +02:00
Ryan McKinley
e013cd427c
K8s: Add basic query service (#80325) 2024-01-31 20:36:51 +02:00
Ieva
c310a20966
AuthZ: add headers for IP range AC checks for cloud data sources (#80208)
* add feature toggle

* add a middleware that appens headers for IP range AC

* sort imports

* sign IP range header and only append it if the request is going to allow listed data sources

* sign a random generated string instead of IP, also change the name of the middleware to make it more generic

* remove the DS IP range AC options from the config file; remove unwanted change

* add test

* sanitize the URLs when comparing

* cleanup and fixes

* check if X-Real-Ip is present, and set the internal request header if it is not present

* use split string function from the util package
2024-01-31 18:09:24 +01:00
Andrej Ocenas
cb945aa5df
NodeGraph: Use layered layout instead of force based layout (#78957) 2024-01-31 17:26:12 +01:00
Mihai Doarna
395a06ab86
Auth: fix swagger responses for the SSO settings API (#81639)
fix swagger responses for the sso settings API
2024-01-31 18:06:22 +02:00
Alexander Zobnin
1bcd597bc0
Nested folders: Improve performance of shared with me dashboards listing (#81590)
* Nested folders: Improve performance of shared with me dashboards listing

* Fix tests

* Clean up guardian
2024-01-31 16:25:11 +01:00
Alexander Zobnin
b4d363e8fe
Chore: Fix broken anonymous devices test (#81649) 2024-01-31 17:09:32 +02:00
Ashley Harrison
39057552dc
QueryField: Handle autocomplete better (#81484)
* extract out function + add unit tests

* add feature toggle and default it to on
2024-01-31 10:01:20 +00:00
Michael Mandrus
cbd2032aea
Feature Toggles: Remove DocsURL from FeatureFlag struct (#79774)
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2024-01-31 08:25:16 +02:00
Ryan McKinley
2ffd56c23b
K8s: Improve OpenAPI behaviour (#81606) 2024-01-31 01:17:14 +02:00
Alyssa Bull
be6efd9518
Cloud Monitoring: Add standalone files and modify plugin.json (#81596) 2024-01-30 15:52:44 -07:00
Yuri Tseretyan
131c72d655
Alerting: Fix scheduler to group folders by the unique key (orgID and UID) (#81303) 2024-01-30 17:14:11 -05:00
Ryan McKinley
e041055012
K8s/Folders: Rename api group to singular (#81443) 2024-01-30 08:50:37 -08:00
Sofia Papagiannaki
89d3b55bec
Folders: Reduce DB queries when counting and deleting resources under folders (#81153)
* Add folder store method for fetching all folder descendants

* Modify GetDescendantCounts() to fetch folder descendants at once

* Reduce DB calls when counting library panels under dashboard

* Reduce DB calls when counting dashboards under folder

* Reduce DB calls during folder delete

* Modify folder registry to count/delete entities under multiple folders

* Reduce DB calls when counting

* Reduce DB calls when deleting
2024-01-30 18:26:34 +02:00
ismail simsek
0139ac205d
Chore: Remove disablePrometheusExemplarSampling feature toggle (#81579)
remove disablePrometheusExemplarSampling ft
2024-01-30 17:00:04 +01:00
Tania
b84dde7b4a
Chore: Change response status for dashboard import with invalid input (#81521)
* Return BadRequest when dashboard import failed due to invalid input
2024-01-30 16:57:01 +01:00
Arati R
77775d548a
Chore: Add some tests for the Create method (#81364)
* Add test for create method
    Co-authored-by: Tania B <10127682+undef1nd@users.noreply.github.com>
* Change structure of entity package to break import cycle
* Update wire file

---------

Co-authored-by: Tania B <10127682+undef1nd@users.noreply.github.com>
2024-01-30 14:15:12 +01:00
Nathan Vērzemnieks
ec4fafa08f
Cloudwatch: Deprecate cloudwatchNewRegionsHandler feature toggle and remove core imports from featuremgmt (#81310)
* Remove core imports from grafana/pkg/services/featuremgmt in CloudWatch
2024-01-30 13:11:52 +01:00
Ida Štambuk
6e8495822a
Feature Management: Move awsDatasourcesNewFormStyling to Public Preview (#81257) 2024-01-30 12:25:16 +01:00
Gabriel MABILLE
08f305797f
RBAC: Add metric to count search user permissions cache hits (#81451) 2024-01-30 10:37:47 +01:00
Dominik Prokop
f77c831e3f
Data query: Allow logging panel plugin id when executing queries (#81164)
* Data query: Allo logging panel plugin id when executing queries

* Update tracing header middleware

* Test fix

* Add panelPluginType to query analytics

* Cleanup
2024-01-30 00:06:31 -08:00
Kyle Brandt
43d0664340
Prometheus: (Experimental) Inject label matchers into queries (also change drone to fix ARM rpm build and Update Swagger) (#81396)
- Feature Toggle is `promQLScope`.
 - Query property is:

"scope": {
  "matchers": "{job=~\".*\"}"
 }

Misc:
 - Also updates drone GO version to address ARM bug https://github.com/golang/go/issues/58425
 - Also updates Swagger defs that were causing builds to fail

---------

Co-authored-by: Kevin Minehart <kmineh0151@gmail.com>
2024-01-29 22:22:17 +02:00
Alyssa Bull
2d432d6ff3
Plugins: Externalize Cloud Monitoring data source (#80181) 2024-01-29 09:24:23 -07:00
William Wernert
de662810cf
Alerting: Create instance of alert rule generator in historian annotation tests (#81394)
* Create generator variable to ensure closures have correct context
2024-01-29 11:22:43 -05:00
Mihai Doarna
6b28669e1f
Send empty http response when body is nil (#80196)
* build empty response if body is nil

* fix test
2024-01-29 14:17:56 +02:00
Misi
bcc2409564
Auth: Add validation to Generic OAuth API and UI (#81345)
* wip

* Update validation

* Chore: Remove InputControl usage

* Fixes, validation

* Remove empty option

* Validation changes

* Add tests, rename

* lint

---------

Co-authored-by: Clarity-89 <homes89@ukr.net>
2024-01-29 12:04:22 +01:00
Misi
7e96a2be56
Auth: Reload OAuth provider after deletion of the current settings (#81374)
* Reload after deletion of the current settings

* Add grafana_ssosettings_setting_reload_failure_total counter

* Returns successfully if data reload failed
2024-01-29 12:02:04 +01:00
Ryan McKinley
1fab107e79
FeatureFlags: Avoid using cfg.IsFeatureToggleEnabled (#81407) 2024-01-28 15:22:45 -08:00
Ieva
048d1e7c86
RBAC: Annotation permission migration (#78899)
* add annotation permissions to dashboard managed role and add migrations for annotation permissions

* fix a bug with conditional access level definitions

* add tests

* Update pkg/services/sqlstore/migrations/accesscontrol/dashboard_permissions.go

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

* apply feedback

* add batching, fix tests and a typo

* add one more test

* undo unneeded change

* undo unwanted change

* only check the default basic permissions for non-OSS instances

* account for all wildcards and simplify the check a bit

* error handling and extra conditionals to avoid test failures

* fix a bug with admin permissions not appearing for folders

* fix the OSS check

---------

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
2024-01-26 17:17:29 +00:00
Yuri Tseretyan
a081abdd25
Folders: GetFolders to return empty respons if user does not have any permissions (#81304)
add check for list of permissions
2024-01-26 19:12:45 +02:00
idafurjes
f44592a97a
Remove folderID from service tests (#80615)
* Remove folderID from service tests

* Remove folderID from ngalert migration tests

* Remove tests related to folderIDs

* Roll back change

Before removing FolderID from this test, we need to adjust the code

* Remove FolderID from publicdashboard pkg

* Add back annotations test
2024-01-26 17:36:35 +02:00
Ashley Harrison
04396c001a
Navigation: Move asserts app to root, add asserts icon (#81362)
* move asserts app to root, add asserts icon

* remove width/height/fill from asserts icon
2024-01-26 15:30:36 +00:00
Jo
f3f36e37fa
AuthInfo: No mandatory auth_id in Auth Info service (#81335)
* fix auth info update not having mandatory auth_id

* remove uneeded newline
2024-01-26 11:54:00 +01:00
Gabriel MABILLE
7512b1a519
RBAC: Search fix userID filter (#81337) 2024-01-26 12:23:48 +02:00
Gabriel MABILLE
19194ea122
RBAC: Remove redundant search endpoint (#81331) 2024-01-26 11:11:41 +02:00
Gabriel MABILLE
722b78f3e0
RBAC: Add userLogin filter to the permission search endpoint (#81137)
* RBAC: Search add user login filter

* Switch to a userService resolving instead

* Remove unused error

* Fallback to use the cache

* account for userID filter

* Account for the error

* snake case

* Add test cases

* Add api tests

* Fix return on error

* Re-order imports
2024-01-26 09:43:16 +01:00
Alexander Weaver
ae2e1aeee4
Alerting: Upgrade feature toggle stages for jitterAlertRules and jitterAlertRulesWithinGroups (#81314)
Upgrade jitter toggle stages
2024-01-25 16:46:22 -06:00
Sofia Papagiannaki
b1eec36df3
Alerting: Fix authorisation to use namespace UIDs for scope (#81231) 2024-01-25 15:19:51 -05:00
William Wernert
2af8158f99
Remove Loki annotation toggle (#81296) 2024-01-25 12:56:09 -05:00
Ieva
dc9e590b7b
RBAC: Return the underlying error instead of internal server or bad request for managed permission endpoints (#80974)
* return not found instead of an internal server error when listing/updating permissions

* openapi gen
2024-01-25 16:24:52 +00:00
Sergej-Vlasov
9ba13dd309
Dashboards: Remove emptyDashboardPage feature flag (#81188)
* remove emptyDashboardPage feature toggle from DashNav

* remove emptyDashboardPage feature toggle from NewDashboardWithDS

* remove emptyDashboardPage feature toggle from DashboardGrid

* remove emptyDashboardPage feature toggle from DashboardModel

* remove emptyDashboardPage feature toggle from initDashboard

* remove unused AddPanelWidged component

* remove add-panel type from test

* remove emptyDashboardPage feature flag from registry.go
2024-01-25 14:04:29 +00:00
Hugo Kiyodi Oshiro
d66d7a9642
Plugins: Change managedPluginsInstall to public preview (#81053) 2024-01-25 14:32:31 +01:00
Alexander Zobnin
3094531b63
Folders: Optimize shared folders listing (#81245)
* Folders: Expose function for getting all org folders with specific UIDs

* lint

* Fix test

* fixup

* Apply suggestion from code review

* Remove changes in alerting scheduler

* fixup

* fixup after merge with main

* Add batching

* Use strings.Builder

* Return all org folders if UIDs is empty

* Filter out not accessible folders by the user

* Remove comment

* Fix batching when count is zero

* Do not include dashboard permissions

* Add some tests

* fix test

* Use batch request for folders

* Use batch request to deduplicate folders

* Refactor

* Fix after merging main

* Refactor

---------

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
2024-01-25 13:02:32 +01:00
idafurjes
0880a239f8
Add leftover metrics for FolderID (#81246) 2024-01-25 12:14:18 +01:00
Misi
4577e61ee7
Auth: Improve /admin/authentication permission checks and include new SSO pages (#81183)
* Move evalAuthSettings to ssoutils

* Improve permission check for auth page
2024-01-25 11:13:24 +01:00
idafurjes
7e5544ab21
Add MFolderIDsServiceCount to count folderIDs in services pkg (#81237) 2024-01-25 11:10:35 +01:00
Sofia Papagiannaki
478d7d58fa
Nested folders: Allow creating folders with duplicate names in different locations (#77076)
* Add API test

* Add move tests

* Fix create folder

* Fix move

* Fix test

* Drop and re-create index so that allows a folder to contain a dashboard and a subfolder with same name

* Get folder by title defaults to root folder and optionally fetches folder by provided parent folder

* Apply suggestions from code review
2024-01-25 11:29:56 +02:00
Sofia Papagiannaki
6e827889b4
Chore: Fix folders flaky test (#81234)
It used to wrongly assume slice ordering
2024-01-25 10:55:44 +02:00
Sofia Papagiannaki
5e88d29814
Folders: Introduce folder service function for fetching folders by org and UIDs that contain optionally the folder full path (#80716)
* Folders: Expose function for getting all org folders with specific UIDs

* Return all org folders if UIDs is empty

* Filter out not accessible folders by the user

* Modify query to optionally returning a string that contains the UIDs of all parent folders separated by slash.
2024-01-25 09:27:13 +02:00
William Wernert
2203bc2a3d
Alerting: Refactor provisioning tests/fakes (#81205)
* Fix up test Alertmanager config JSON

* Move fake AM config and provisioning stores to fakes package
2024-01-24 17:15:55 -05:00
Matthew Jacobson
e45f664ca4
Alerting: Replace index role_id, action, scope with action, scope, role_id on permission table (#80336)
* Alerting: Add action, scope, role_id to permission table

The existing role_id, action, scope index has the wrong ordering to be most
effectively used in dashboard/folder permission requests.

On a large tests set, the slow database calls were on the order of ~30-40ms, so
when performed individually they don't have that large of a latency impact.
However, when done in bulk in the migration this adds up to some very slow
requests.

After the index is added these same database calls are reduced to ~4-5ms

* Change index to action, scope, role_id

* Make new index unique and drop [role_id, action, scope] index
2024-01-24 16:18:14 -05:00
Matthew Jacobson
71e70c424f
Alerting: During legacy migration reduce the number of created silences (#78505)
* Alerting: During legacy migration reduce the number of created silences

During legacy migration every migrated rule was given a label rule_uid=<uid>.
This was used to silence DatasourceError/DatasourceNoData alerts for
migrated rules that had either ExecutionErrorState/NoDataState set to
keep_state, respectively.

This could potentially create a large amount of silences and a high cardinality
label. Both of these scenarios have poor outcomes for CPU load and latency in
unified alerting.

Instead, this change creates one label per ExecutionErrorState/NoDataState when
they are set to keep_state as well as two silence rules, if rules with said
labels were created during migration. These silence rules are:

- __legacy_silence_error_keep_state__ = true
- __legacy_silence_nodata_keep_state__ = true

This will drastically reduce the number of created silence rules in most cases
as well as not create the potentially high cardinality label `rule_uid`.
2024-01-24 15:56:19 -05:00
Santiago
fbbda6c05e
Alerting: Retry readiness check to the remote Alertmanager on 5xx status code responses (#81174) 2024-01-24 21:39:06 +01:00
Marcus Efraimsson
20fe0eb173
Chore: Extract DatabaseConfig parsing from SQLStore (#81157)
Extract the parsing/creating of database config/connectiong from SQLStore string 
to a separate DatabaseConfig struct.
2024-01-24 16:49:49 +01:00
Misi
c47b55ae10
Auth: Add SSO settings usage stats (#81143)
* Add usage stats

* UsageStats test + svc rename

* Fix test
2024-01-24 15:39:50 +01:00
Alexander Zobnin
7872a128a2
Folders: Add metric for listing subfolders duration (#81144) 2024-01-24 14:15:32 +01:00
Karl Persson
28bb6979f5
IDForwading: cache based on expires in (#81136)
* IDFowarding: Cache based on expires in

* IDFowarding: Change default expires in

---------

Co-authored-by: Victor Cinaglia <victor@grafana.com>
2024-01-24 13:56:44 +01:00
Gabriel MABILLE
63679813b0
RBAC: prevent seeding oncall access (#80862)
* RBAC: prevent seeding oncall access

* Add comments and an early exit

* Test SeedAssignmentOnCallAccessMigrator

* imports

* Comment rework

* Check error

* Nit.
2024-01-24 09:23:40 +01:00
George Robinson
05d858635c
Alerting: Add metric for inhibition rules (#81119)
This commit adds a metric for the number of inhibition rules.
It matches the metric added upstream in #3681.
2024-01-23 19:43:17 +00:00
Matthew Jacobson
2607528b52
Alerting: Update legacy migration docs to include Upgrade Preview (#80628)
* Alerting: Update legacy migration docs to include Upgrade Preview
2024-01-23 14:09:52 -05:00
Ryan McKinley
2b355ff280
K8s: Remove grafanaAPIServer feature toggle (#81030) 2024-01-23 08:27:28 -08:00
Jean-Philippe Quéméner
aa25776f81
Alerting: Add a feature flag to periodically save states (#80987) 2024-01-23 17:03:30 +01:00
George Robinson
85b9edcd28
Alerting: Fix incorrect initialization of logger (#81099) 2024-01-23 17:29:38 +02:00
Misi
ea1ab0d84f
Auth: Remove DevModeRequired from the SsoSettingsApi feature toggle (#81091)
Remove DevModeRequired from ft
2024-01-23 16:11:26 +01:00
Misi
8246d97587
Auth: Introduce configurable_providers config option for SSO settings (#80911)
* Add SSOSettingsConfigurableProviders config option

* Add check to Delete and ListWithRedactedSecrets

* Add check to GET, small improvements
2024-01-23 15:48:06 +01:00
Jo
9f5a8bf926
AuthInfo: Revert #81013. Fix cache invalidation (#81050)
* Revert "Auth: Revert "Auth: Cache Auth Info" (#81013)"

This reverts commit ce84f7c540.

* fix cache invalidation during user takeover

* fix incomplete test
2024-01-23 15:26:38 +01:00
Eric Leijonmarck
b43b2608b5
Chore: Enable and Fix flaky test in anonimpl service (#80896)
* fix: flaky test

* set fixed time instead

* flaky
2024-01-23 12:27:26 +00:00
Marcus Efraimsson
6768c6c059
Chore: Remove public vars in setting package (#81018)
Removes the public variable setting.SecretKey plus some other ones. 
Introduces some new functions for creating setting.Cfg.
2024-01-23 12:36:22 +01:00
Karl Persson
147bf01745
IDForwarding: Always forward id tokens to plugins (#81041)
* Always forward id tokens to plugins
2024-01-23 12:12:32 +01:00
Ryan McKinley
c7c594dba0
K8s/DataSource: Introduce PluginConfigProvider (#80928) 2024-01-22 11:32:25 -08:00
Misi
ce84f7c540
Auth: Revert "Auth: Cache Auth Info" (#81013)
Revert "Auth: Cache Auth Info"
2024-01-22 21:25:24 +02:00
Michael Mandrus
cf13cb9f70
Cloud Migrations: Create new service for cloud migrations (#80949)
* introduce feature toggle

* create base service structure

* fix sample metric

* register metrics

* add to codeowners

* separate api dtos from service models

* remove leading newline
2024-01-22 11:09:08 -05:00
Tania
07aa173939
Nested Folders: Add back syncing of folders between folder and dashboard tbls (#80972)
Add back syncing of folders between folder and dashboard tbls

This partially reverts commit 06d2ae3ada.
2024-01-22 17:04:18 +01:00
Sofia Papagiannaki
4243079cb5
Folders: Fix creating/updating a folder whose title has leading and trailing spaces (#80909)
* Add tests

* Folders: Fix creating folder whose title has leading and trailing spaces

* Fix folder update

* Remove redundant argument

* Fix test
2024-01-22 18:03:30 +02:00
Dave Henderson
e0402115ea
Notifications: Optional trace propagation through SMTP (#80481)
* Notifications: Optional trace propagation through SMTP

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

* fix failing test

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

* Add documentation

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

---------

Signed-off-by: Dave Henderson <dave.henderson@grafana.com>
2024-01-22 10:50:05 -05:00
Joey
f3c64a7337
Tempo: Remove profiling toggles (#80792)
* Remove traceToProfiles toggle

* Remove tracesEmbeddedFlameGraph toggle

* Remove superfluous import

* Update ConfigDescriptionLink

* Update getting of profiles from standalone build PR
2024-01-22 14:21:14 +00:00
Misi
20bb0a3ab1
AuthN: Support reloading SSO config after the sso settings have changed (#80734)
* Add AuthNSvc reload handling

* Working, need to add test

* Remove commented out code

* Add Reload implementation to connectors

* Align and add tests, refactor

* Add more tests, linting

* Add extra checks + tests to oauth client

* Clean up based on reviews

* Move config instantiation into newSocialBase

* Use specific error
2024-01-22 14:54:48 +01:00
Jean-Philippe Quéméner
eb7e1216a1
feat(alerting): add async state persister (#80763) 2024-01-22 13:07:11 +01:00
Sven Grossmann
61ed0ef73f
Tests: Update geomap golden json (#80964)
update geomap golden json
2024-01-22 13:25:51 +02:00
Piotr Jamróz
98e3a01aff
Correlations: Enable correlations feature toggle by default (#80881)
* Enable correlations by default

* Update docs
2024-01-22 09:27:11 +01:00
colin-stuart
e241188f00
Auth: Implement the SSO Settings List endpoint (#80769)
* add list endpoint & initial tests

* add tests and ETag

* format service_test.go

* add list swagger param, generate openAPI, remove ETag, use RedactedPassword

* correct swagger param name

* Align tests to latest changes

* use setting.RedactedValue()

* add string assertion

* lint & require no error on res.Body.Close()

* add custom response type

---------

Co-authored-by: Mihaly Gyongyosi <mgyongyosi@users.noreply.github.com>
2024-01-19 14:39:09 -05:00
Julien Duchesne
40312c527b
ngalert openapi: Fix ObjectMatchers definition (#79477)
These don't get marshalled and unmarshalled in the same way as they are represented in Go
This PR changes the OpenAPI spec to reflect what the API accepts and sends back
2024-01-19 14:37:11 -05:00
Will Browne
d5bec225ed
Plugins: Fix Plugin Context method docs (#80906)
* fix method docs

* add docs for new method
2024-01-19 16:22:17 +01:00
Will Browne
3f30cbf91c
DataSources: Add datasource fetching + querying interface (#80749)
* first pass

* separate oss + enterprise

* tidy things up

* add ctx

* fix tests

* use standalone svcs

* mv plugin context provide

* fix wire

* fix import
2024-01-19 15:56:52 +01:00
Alexander Zobnin
08082104e1
Access control: Add permissions cache hit/miss metrics (#80883)
* Access control: Add permissions cache hit/miss metrics

* Add metrics to OSS

* Fix imports
2024-01-19 13:47:58 +01:00
Alexander Weaver
18b9c8fd5f
Alerting: Nilcheck JitterStrategyFrom so it can be used in contexts without feature toggles (#80841)
Nilcheck so tests can have a nil feature toggles
2024-01-18 15:43:41 -06:00
Alexander Weaver
00a260effa
Alerting: Add setting to distribute rule group evaluations over time (#80766)
* Simple, per-base-interval jitter

* Add log just for test purposes

* Add strategy approach, allow choosing between group or rule

* Add flag to jitter rules

* Add second toggle for jittering within a group

* Wire up toggles to strategy

* Slightly improve comment ordering

* Add tests for offset generation

* Rename JitterStrategyFrom

* Improve debug log message

* Use grafana SDK labels rather than prometheus labels
2024-01-18 12:48:11 -06:00
Juan Cabanas
fb4125dfbb
PublicDashboards: Add middleware function (#80582) 2024-01-18 15:12:29 -03:00
Isabella Siu
0ba7866e2c
Update feature toggle registry description for sseGroupByDatasource (#80830) 2024-01-18 13:07:57 -05:00
Ryan McKinley
96fe605d95
FeatureFlags: fix setting flags to false in startup (#80836) 2024-01-18 20:03:45 +02:00
Laura Fernández
5800e40fba
ReturnToPrevious: create feature toggle (#80831) 2024-01-18 18:12:14 +01:00
William Wernert
e74313e171
Alerting/Annotations: Return nothing from Loki historian store if query type is annotation (#80742)
* Return empty slice if query type is `annotation`

* Add test + fix related test
2024-01-18 11:39:33 -05:00
Mihai Doarna
b8cf8ec8d7
Auth: fix swagger response for get SSO settings endpoint (#80817)
fix swagger response for get SSO settings endpoint
2024-01-18 18:27:44 +02:00
Jo
c767481dee
Auth: Cache Auth Info (#80620)
* leverage cache for auth info

* fix tests and integration

* fix panic

* fix panic
2024-01-18 15:22:19 +01:00
Sofia Papagiannaki
bb2e0dad22
Chore: Rename folder service query variables for consistency (#80735)
Chore: Rename service query variables for consistency
2024-01-18 16:12:49 +02:00
Ezequiel Victorero
9bd214516e
Chore: Folder id deprecation in public dashboards (#80579) 2024-01-18 10:27:09 -03:00
Will Browne
3885497553
Plugins: Update renderer plugin source (#80643)
* rework renderer plugin source

* add tests
2024-01-18 11:06:33 +01:00
Ryan McKinley
41e523bde7
K8s/FeatureFlags: Add an apiserver to manage feature flags (dev only) (#80501)
* add deployment registry API cloud only

* update versions

* add feature flag endpoints

* use helpers

* merge main

* update AllowSelfServie and re-run code gen

* fix package name

* add allowselfserve flag to payload

* remove config

* update list api to return the full registry including states

* change enabled check

* fix compile error

* add feature toggle and split path in frontend

* changes

* with status

* add more status/state

* add back config thing

* add back config thing

* merge main

* merge main

* now on the /current api endpoint

* now on the /current api endpoint

* drop frontend changes

* change group name to featuretoggle (singular)

* use the same settings

* now with patch

* more common refs

* more common refs

* WIP actually do the webhook

* fix comment

* fewer imports

* registe standalone

* one less file

* fix singular name

---------

Co-authored-by: Michael Mandrus <michael.mandrus@grafana.com>
2024-01-17 21:32:44 -08:00
Michael Mandrus
db83eb30a2
Caching: Remove useCachingService feature toggle (#80695)
remove useCachingService feature toggle
2024-01-17 16:53:25 -05:00
Julien Duchesne
c9211fbd69
ngalert openapi: Use same basePath as rest of Grafana (#79025)
* ngalert openapi: Use same `basePath` as rest of Grafana
Currently, there are two issues that prevent easily merging `ngalert` and grafana openapi specs:
- The basePath is different. `grafana` has `/api` and `ngalert` has `/api/v1`. I changed `ngalert` to use `/api`
- The `ngalert` endpoints have their basePath in the each operation path. The basePath should actually be omitted
---------

Co-authored-by: Yuriy Tseretyan <yuriy.tseretyan@grafana.com>
2024-01-17 11:53:16 -05:00
Gabriel MABILLE
dce9d1e87c
RBAC: Search endpoint support wildcards (#80383)
* RBAC: Search endpoint support wildcards

* Allow wildcard filter with RAM permissions as well
2024-01-17 17:07:47 +01:00
Eric Leijonmarck
81a49e8016
Anon: Fix comment out flaky test in anonimpl (#80728)
* fix: flaky test

* add one line
2024-01-17 15:19:29 +00:00
Misi
da6926f6f7
Auth: SSOSettings handle secret update (#80591)
* first touches

* Merge missing SSO settings to support Advanced Auth pages

* fix

* Update secrets correctly

* Add test for upsert with redactedsecret

* Verify decryption in the List tests
2024-01-17 15:55:55 +02:00
Andres Martinez Gotor
67fe33aa62
Datasources: Ensure the 'Host' custom header functions as expected (#80715)
Supports "Host" custom header.

Co-authored-by: Pei-Tang Huang <tangtheone@gmail.com>
2024-01-17 13:38:45 +01:00
Jean-Philippe Quéméner
82638d059f
feat(alerting): add state persister interface (#80384) 2024-01-17 13:33:13 +01:00
Santiago
3217a0dc05
Alerting: Fix state sync errors counter increment (#80702) 2024-01-17 11:04:27 +01:00
Karl Persson
7b58f71b33
AuthN: Add auth hook that can sync grafana cloud role to rbac cloud role (#80416)
* AuthnSync: Rename files and structures

* AuthnSync: register rbac cloud role sync if feature toggle is enabled

* RBAC: Add new sync function to service interface

* RBAC: add common prefix and role names for cloud fixed roles

* AuthnSync+RBAC: implement rbac cloud role sync

Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
2024-01-17 10:55:47 +01:00
Ieva
def1b05a93
RBAC: Clean up data source permissions after data source deletion (#80654)
* clean up data source permissions after data source deletion

* remove a comment
2024-01-17 09:49:33 +00:00
Sofia Papagiannaki
d1dab5828d
Alerting: Update rule API to address folders by UID (#74600)
* Change ruler API to expect the folder UID as namespace

* Update example requests

* Fix tests

* Update swagger

* Modify FIle field in /api/prometheus/grafana/api/v1/rules

* Fix ruler export

* Modify folder in responses to be formatted as <parent UID>/<title>

* Add alerting test with nested folders

* Apply suggestion from code review

* Alerting: use folder UID instead of title in rule API (#77166)

Co-authored-by: Sonia Aguilar <soniaaguilarpeiron@gmail.com>

* Drop a few more latent uses of namespace_id

* move getNamespaceKey to models package

* switch GetAlertRulesForScheduling to use folder table

* update GetAlertRulesForScheduling to return folder titles in format `parent_uid/title`.

* fi tests

* add tests for GetAlertRulesForScheduling when parent uid

* fix integration tests after merge

* fix test after merge

* change format of the namespace to JSON array

this is needed for forward compatibility, when we migrate to full paths

* update EF code to decode nested folder

---------

Co-authored-by: Yuri Tseretyan <yuriy.tseretyan@grafana.com>
Co-authored-by: Virginia Cepeda <virginia.cepeda@grafana.com>
Co-authored-by: Sonia Aguilar <soniaaguilarpeiron@gmail.com>
Co-authored-by: Alex Weaver <weaver.alex.d@gmail.com>
Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
2024-01-17 11:07:39 +02:00
Karl Persson
43b6b6b2a4
IDForwarding: add "authenticatedBy" to id token (#80622)
* IDForwading: Set authenticated by for users
2024-01-17 09:52:05 +01:00
Alexander Weaver
3c796ecc8f
Alerting: Add metric counting rule groups per org (#80669)
* Refactor, fix bad map hint

* Count groups per org
2024-01-16 16:35:56 -06:00
Andre Pereira
6b37a887d5
Data trails: Move and rename to explore metrics (#80649)
* Move data trails to /explore/metrics

* Fix breadcrumbs

* Fix label option link
2024-01-17 00:05:44 +02:00
Ryan McKinley
48a5c1e850
FeatureFlags: Remove the unsupported/undocumented option to read flags from a file (#79959) 2024-01-16 23:18:25 +02:00
Alexander Weaver
68d4e8a930
Annotations: Remove extraneous, debug log messages (#80670)
* drop log messages

* Revert timer

* fix returns, no need to capture vars for log lines anymore
2024-01-16 14:48:11 -06:00
Ryan McKinley
e1d387d826
K8s/Storage: Register field-selector on all kinds (#79822)
Co-authored-by: Dan Cech <dcech@grafana.com>
2024-01-16 08:30:01 -08:00
Santiago
3afd94185c
Alerting: Add metric to check for default AM configurations (#80225)
* Alerting: Add metric to check for default AM configurations

* Use a gauge for the config hash

* don't go out of bounds when converting uint64 to float64

* expose metric for config hash

* update metrics after applying config
2024-01-16 17:12:24 +01:00
Eric Leijonmarck
28009228e5
Anonymous: Fix flaky tests (#80631)
fix: flaky tests
2024-01-16 15:41:28 +00:00
Ashley Harrison
127decee1e
Release: Deprecate latest.json and replace with api call to grafana.com (#80537)
* remove latest.json and replace with api call to grafana.com

* remove latest.json

* Revert "remove latest.json"

This reverts commit bcff43d898.

* Revert "remove latest.json and replace with api call to grafana.com"

This reverts commit 02b867d84e.

* add deprecation message to latest.json
2024-01-16 11:19:32 +00:00
Timur Olzhabayev
c02d57c6a9
Chore: removing folderId from plugindashboard service (#80570)
* removing folderId from plugindashboard service

* fixing linting
2024-01-16 11:08:39 +01:00
Gabriel MABILLE
48ff532ca8
RBAC: Add histogram metric on search endpoint (#80553)
RBAC: Add histogram on search endpoint
2024-01-15 17:56:01 +01:00
arukiidou
bffb28c177
refactor: use golang.org/x/oauth2 pkce option (#80511)
Signed-off-by: junya koyama <arukiidou@yahoo.co.jp>
2024-01-15 16:24:02 +01:00
Eric Leijonmarck
3979ea0c47
Anonymous Access: Pagination for devices (#80028)
* first commit

* add: pagination to anondevices

* fmt

* swagger and tests

* swagger

* testing out test

* fixing tests

* made it possible to query for from and to time

* refactor: change to query for ip adress instead

* fix: tests
2024-01-15 12:13:38 +00:00
Ashley Harrison
ec53487c99
NestedFolderPicker: separate toggle to force enable picker without nestedFolders (#80461)
* separate nestedFolderPickerOverride toggle to force enable it without nestedFolders

* let's call it newFolderPicker

* update unit tests and keyboard handling

* reduce spacing when no folder open chevron

---------

Co-authored-by: Josh Hunt <joshhunt@users.noreply.github.com>
2024-01-15 11:43:19 +00:00
Ashley Harrison
15af2e5053
Connections: Pass keywords from the backend to CommandPalette (#80276)
* pass keywords from the backend to CommandPalette

* add csv and json to keywords
2024-01-15 11:30:55 +00:00
Yuri Tseretyan
4b071f5452
Alerting: Fix MuteTiming Get API to return provenance status (#80494) 2024-01-13 00:16:54 +02:00
Julien Duchesne
2fb03dfa56
fix(swagger): Mute Timing PUT OK status is 202 (#80459) 2024-01-12 16:58:20 -05:00
Dan Cech
d76defe517
K8s: Move GrafanaMetaAccessor into grafana-apiserver and remove usage of kinds metadata (#79602)
* move GrafanaMetaAccessor into pkg/apis, add support for Spec.Title & Spec.Name

* K8s: Move GrafanaMetaAccessor (PR into another) (#79728)

* access titles

* remove title

* remove title

* remove kinds metadata accessor

* remove kinds metadata accessor

* fixes

* error handling

* fix tests

---------

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2024-01-12 16:18:14 -05:00
Ryan McKinley
bb05a6f58f
K8s: Move shared apis to a common folder with shared openapi spec (#80484) 2024-01-12 12:05:30 -08:00
Alexander Weaver
81c45bfe44
Annotations: Split cleanup into separate queries and deletes to avoid deadlocks on MySQL (#80329)
* Split subquery when cleaning annotations

* update comment

* Raise batch size, now that we pay attention to it

* Iterate in batches

* Separate cancellable batch implementation to allow for multi-statement callbacks, add overload for single-statement use

* Use split-out utility in outer batching loop so it respects context cancellation

* guard against empty queries

* Use SQL parameters

* Use same approach for tags

* drop unused function

* Work around parameter limit on sqlite for large batches

* Bulk insert test data in DB

* Refactor test to customise test data creation

* Add test for catching SQLITE_MAX_VARIABLE_NUMBER limit

* Turn annotation cleanup test to integration tests

* lint

---------

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
2024-01-12 14:05:04 -06:00
Yuri Tseretyan
4479e7218d
Alerting: MuteTiming service return errutil + GetTiming by name (#79772)
* add get mute timing by name to MuteTimingService
* update get mute timing request handler to use the service method

* replace validation, uniqueness and used errors with errutils
* update mute timing methods return errutil responses
* use the term "time interval" in errors bevause mute timings are deprecated in Alertmanager and will be replaced by time intervals in the future.

* update create and update methods to return struct instead of pointer
2024-01-12 21:23:44 +02:00
idafurjes
cb419e799b
Remove folderid service test (#80433)
* Remove FolderID from service tests

* Add models

* Add folderID pack to publicdashboard tests

* Remove folderID from dashboard tests

* Remove folderID from folders

* Remove folderID from ngalert tests

* Remove nolint comment

* Add back some tests after rebase
2024-01-12 16:43:39 +01:00
Misi
c196bde2e0
Auth: Include missing SSO settings from system settings on read paths (#80421)
* first touches

* Merge missing SSO settings to support Advanced Auth pages

* fix
2024-01-12 15:20:50 +01:00
Mihai Doarna
39e4f8ec1b
Auth: configure SSO settings reload interval from the ini file (#80290)
* configure sso reload interval from ini file

* change section name to sso_settings
2024-01-12 10:24:16 +02:00
Matthew Jacobson
5ecc7dd2fa
Alerting: Increase size of kvstore value type for MySQL to LONGTEXT (#80331)
* Alerting: Increase size of kvstore value type for MySQL to LONGTEXT

alertmanager uses the kvstore to persist its notification log and the current
column limit for MySQL (16.7mb) puts the maximum entries at a level that is
potentially achievable for heavy alerting users (~40-80k entries).

In comparison, the current type for PSQL (TEXT) is effectively unlimited and
I believe SQLIte defaults to 2gb which is also plenty of leeway.
2024-01-11 22:51:36 +02:00
Arati R
ca9d147a44
Give dialects control over how insert and update queries are performed (#79946)
* Refactor insert, update
* Add separate insert, update methods
* Refactor Insert, Update signatures
2024-01-11 19:55:45 +01:00
Gabriel MABILLE
c9ac069076
RBAC: Add origin column to seed_assignment (#80326)
* RBAC: Add origin column to seed_assignment

* Add OnCall permission migration
2024-01-11 18:43:43 +01:00
Yuri Tseretyan
77db6a9ca4
Alerting: Fix GetAlertRulesForScheduling to use folder table and join by org_id (#80330) 2024-01-11 09:21:03 -05:00
Tania
1947919516
Chore: Add dashboard retrieval by FolderUID (#80288)
* Add dashboard retrieval by uid

Co-authored-by: Serge Zaitsev <serge.zaitsev@grafana.com>
2024-01-11 15:02:13 +01:00
Mihai Doarna
4bf5c63657
Auth: tidy up the database layer from the SSO Settings Service (#80341)
tidy up the database layer
2024-01-11 14:45:01 +02:00
Santiago
6c87d9a1e7
Alerting: Stop retries on 4xx status code responses (remote Alertmanager readiness check) (#80350) 2024-01-11 12:12:35 +01:00
Ryan McKinley
85d68b88cf
FeatureFlags: Remove enabled from FeatureFlag model (#79960) 2024-01-10 21:34:18 -08:00
William Wernert
48b5ac779b
Alerting/Annotations: Add annotation backend for Loki alert state history (#78156)
* Move scope type vars to testutil package

* Expose parts of state historian for use in annotation backend

* Implement Loki ASH Annotation store

This store will only implement the `Get` method of a RepositoryImpl since alert state history
writes to Loki elsewhere.

* Use interface for Loki HTTP Client

* Add tests for Loki ASH Annotation store

* Add missing test

* Fix lint

* Organize tests

* Add filter tests

* Improve tests

* Move filter logic into outer function

* Fix lint

* Add comment

* Fix tests

* Fix lint

* Rename historian store + refactor

* Cleanup historian store

* Fix tests

* Minor cleanup

* Use new `ShouldRecordAnnotation` filter

* Fix logic and add tests for this check

* Fix typos, remove unused variables, `< 1` -> `== 0`

* More closely mimic RBAC filter from xorm to ensure correct logic

* Move off weaveworks client

* Address PR comments
2024-01-10 18:42:35 -05:00
Ryan McKinley
2c09f969f1
K8s: Add dashboard service (requires dev mode) (#78565) 2024-01-11 01:20:30 +02:00
Matthew Jacobson
afa33f12b2
Alerting: Create alertingQueryOptimization feature flag for alert query optimization (#78932)
* Alerting: Create feature flag for alert query optimization

Adds a feature flag alertingQueryOptimization for an already existing 
functionality: alert query optimization. This feature flag will now be disabled 
by default.
2024-01-10 15:52:58 -05:00
Matthew Jacobson
f365d35cf8
Alerting: Show warning when query optimized (#78751)
* Alerting: Show warning when query optimized

* Use frame.AppendNotices

* Improve warning to include why and a prompt for action
2024-01-10 14:40:00 -05:00
Tania
744c1032ee
Provisioning: Fix dual write of folders (#80140)
* Provisioning: Store folders in folders table

* Solve linting issues

* Remove a comment
2024-01-10 16:48:28 +01:00
Ryan McKinley
ee7daeb2a7
APIServer: Move shared code to a utility/helper function (#80261) 2024-01-10 07:30:16 -08:00
Mihai Doarna
772e5993b6
Auth: reload SSO settings for HA setups (#80231)
* reload SSO settings for HA setups

* remove check for grafana HA

* add unit tests

* fetch all sso settings with one sql query

* register background service
2024-01-10 16:01:37 +02:00
Karl Persson
5b3cd9f55b
features: Add feature flag for grafana cloud rbac roles (#80283) 2024-01-10 14:19:01 +01:00
Giuseppe Guerra
b40d3e7487
Plugins: Add enablePluginsTracingByDefault feature flag (#80195)
* Add enablePluginsTracingByDefault feature flag

* Enable tracing for all plugins if enablePluginsTracingByDefault is set

* fix docstrings for IsEnabled and IsEnabledGlobally

* fix tests

* do not use separate feature manager

* add test case

* Revert "fix tests"

This reverts commit 46a2420ed1.

* cleanup

* fix plugin tracing disabled if wrong plugin setting is present

* add test case for enabled on plugin with wrong plugin setting but with enablePluginsTracingByDefault feature flag

* Add RequiresRestart = true to enablePluginsTracingByDefault

* re-generate feature flags

* pr review feedback
2024-01-10 13:25:54 +02:00
Santiago
9e78faa7ba
Alerting: Add metrics to the remote Alertmanager struct (#79835)
* Alerting: Add metrics to the remote Alertmanager struct

* rephrase http_requests_failed description

* make linter happy

* remove unnecessary metrics

* extract timed client to separate package

* use histogram collector from dskit

* remove weaveworks dependency

* capture metrics for all requests to the remote Alertmanager (both clients)

* use the timed client in the MimirAuthRoundTripper

* HTTPRequestsDuration -> HTTPRequestDuration, clean up mimir client factory function

* refactor

* less git diff

* gauge for last readiness check in seconds

* initialize LastReadinesCheck to 0, tweak metric names and descriptions

* add counters for sync attempts/errors

* last config sync and last state sync timestamps (gauges)

* change latency metric name

* metric for remote Alertmanager mode

* code review comments

* move label constants to metrics package
2024-01-10 11:18:24 +01:00
Matthew Jacobson
1d4419fbe4
Alerting: Fix NoData & Error alerts not resolving when rule is reset (#80184)
* Alerting: Fix NoData & Error alerts not resolving when rule is reset

On rule reset, when creating the PostableAlerts StateToPostableAlert did not
attach the correct NoData/Error alertname and rulename labels to expire/resolve
the active alerts when the previous cached state was NoData/Error.
2024-01-09 14:47:19 -05:00
Alexander Weaver
542741f748
Alerting: Log scheduler maxAttempts, guard against invalid retry counts, log retry errors (#80234)
* Log maxAttempts, add guard, log retry errors

* fix whitespace

* Initialize evaluator in TestProcessTicks
2024-01-09 13:19:37 -06:00
Ryan McKinley
1caaa56de0
FeatureFlags: Use interface rather than manager (#80000) 2024-01-09 10:38:06 -08:00
Mihai Doarna
3332562900
Auth: use Empty() for sending empty http responses in SSO Settings API (#80200)
use Empty() for sending empty http response
2024-01-09 15:27:55 +02:00
Mihai Doarna
adb7295bab
Auth: Send an empty http response without the json header in SSO Settings API (#80197)
send an empty http response without the json header
2024-01-09 12:14:39 +02:00
Charandas
48612063dd
Grafana app platform: an aggregator cmd and package (#79948) 2024-01-08 22:33:42 +02:00
Matias Chomicki
cff1ad4922
Logs popover: enabled by default (#80146) 2024-01-08 17:03:39 +01:00
Jo
c3d8c6e0ea
JWT: Fallthrough to fetch keyset in case of cache error (#80081)
fallthrough to fetch keyset in case of cache error. Fixes #67582
2024-01-08 16:02:31 +01:00
colin-stuart
062e772bb2
Auth: Implement the SSO Settings GET endpoint (#79144)
* Return data in camelCase from the OAuth fb strategy

* changes

* wip

* Add defaults for oauth fb strategy

* revert other changes

* basic includeDefaults query param implementation

* basic secret removal and etag implementation

* correct imports

* rebase

* move default settings filter to models

* only replace ClientSecret value if set

* first GetForProvider test & use FNV for ETag to avoid Blocklisted import error

* add tests

* add annotation for the openapi spec & generate spec

* remove TODO

* use IsSecret, improve tests, remove DefaultOAuthSettings

* add comment explaining generateFNVETag

* add error handling for generateFNVETag

* run go generate

* Update pkg/services/ssosettings/api/api.go

Co-authored-by: Mihai Doarna <mihai.doarna@grafana.com>

* move isSecret to service, create GetForProviderWithRedactedSecrets func

* add unit test for GetForProviderWithRedactedSecrets & remove duplicated code

* regen openapi/swagger

* revert dependency bumps

---------

Co-authored-by: Mihaly Gyongyosi <mgyongyosi@users.noreply.github.com>
Co-authored-by: Mihai Doarna <mihai.doarna@grafana.com>
2024-01-08 09:35:14 -05:00
Adam Bannach
505196bcd5
Chore: Remove costManagementUi toggle (#80098)
* chore: remove cost management ff; fallback to adding AM and LVE to apps drawer

* chore: revert fallback app drawer placement
2024-01-08 14:25:11 +00:00
Misi
eae6adf002
Auth: Use cfg.Raw in OAuthStrategy for loading settings (#80136)
Use cfg.Raw in OAuthStrategy, remove unnecessary tests
2024-01-08 15:36:15 +02:00
Will Browne
78ae795e06
Plugins: Fix loading of dist folders (#80015)
* end to end

* tidy

* fix whitespace

* remove unused code

* fix linter

* fix gosec + add sort

* fix test

* apply cr feedback
2024-01-08 11:45:03 +01:00
Nathan Marrs
2ff1e40a7f
chore: Update DataViz feature toggles related to 10.3 release to be public preview (#80109)
Update feature toggles for tooltips / canvas to be public preview
2024-01-05 17:40:11 -08:00
Matthew Jacobson
aa03b8f8a7
Alerting: Guided legacy alerting upgrade dry-run (#80071)
This PR has two steps that together create a functional dry-run capability for the migration.

By enabling the feature flag alertingPreviewUpgrade when on legacy alerting it will:
    a. Allow all Grafana Alerting background services except for the scheduler to start (multiorg alertmanager, state manager, routes, …).
    b. Allow the UI to show Grafana Alerting pages alongside legacy ones (with appropriate in-app warnings that UA is not actually running).
    c. Show a new “Alerting Upgrade” page and register associated /api/v1/upgrade endpoints that will allow the user to upgrade their organization live without restart and present a summary of the upgrade in a table.
2024-01-05 18:19:12 -05:00
Yuri Tseretyan
72182e02a4
Alerting: Mute timing service tests (#79817)
split tests for mute timing service to functions for each method this makes it clear the scope of tests
2024-01-06 00:26:15 +02:00
Arati R
90fb6a0122
Update unified storage readme (#79934)
* Update unified storage readme

Co-authored-by: Dan Cech <dcech@grafana.com>
2024-01-05 23:44:34 +02:00
Yuri Tseretyan
494f36e0bd
Alerting: Update provisioning services that handle Alertmanager configuraiton to access config via storage (#79814)
* extract get and save operations to a alertmanagerConfigStore. this removes duplicated code in service (currently only mute timings) and improves testing
* replace generic errors with errutils one with better messages.
* update provisioning services to use new store

---------

Co-authored-by: Alexander Weaver <weaver.alex.d@gmail.com>
2024-01-05 16:15:18 -05:00
Isabella Siu
8dc04ea63a
AWS Datasources: Enable awsAsyncQueryCaching by default (#80045) 2024-01-05 14:56:30 -05:00
Oscar Kilhed
583b9797af
Transformations: Move moving average, regression analysis and format string transformations to public preview (#80067)
* move transformation features to public preview

* update docs

* Update docs/sources/panels-visualizations/query-transform-data/transform-data/index.md

Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>

* Update docs/sources/panels-visualizations/query-transform-data/transform-data/index.md

Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>

* Update docs/sources/panels-visualizations/query-transform-data/transform-data/index.md

Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>

* fix formating of ffs

---------

Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>
2024-01-05 19:39:02 +01:00
Matthew Jacobson
49891d6a72
Alerting: Add feature flag alertingPreviewUpgrade for migration preview + dry-run (#80036)
* Add feature flag

* Remove from docs for now
2024-01-05 13:31:05 -05:00
Yuri Tseretyan
3a966fc6ca
Alerting: Enable recovery threshold feature by default (#80088) 2024-01-05 12:59:41 -05:00
Alexander Weaver
a8fb01a502
Swap weaveworks/common utilities for equivalents in grafana/dskit (#80051)
* Replace histogram collector and grpc injectors

* Extract request timing utility

* Also vendor test file

* Suppress erroneous linter warn
2024-01-05 10:08:38 -06:00
Agnès Toulet
41eff02d75
Docs: Add table data in PDF (#80059)
* Docs: Add table data in PDF

* fix lint issues

* Switch to public preview

* Apply suggestions from code review

Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>

---------

Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>
2024-01-05 15:57:13 +01:00
Julien Duchesne
c7f515b9b2
fix(swagger): POST -> GET method for two access control endpoints (#80082)
Missed those here: https://github.com/grafana/grafana/pull/80053
2024-01-05 09:40:08 -05:00
Julien Duchesne
5e74c19628
fix(swagger): Add new access control endpoints (#80053)
There were a few errors that prevented these endpoints (which are the most up-to-date ones) from being present in the openapi spec:
- The `enterprise` tag excluded the endpoints from being generated
- `okRespoonse` typo
- Invalid templating on the parameters
- Missing parameter structs
2024-01-05 08:12:01 -05:00
Matthew Jacobson
3537c5440f
Alerting: Refactor migration to return pairs of legacy and upgraded structs (#79719)
Some refactoring that will simplify next changes for dry-run PRs. This should be no-op as far as the created ngalert resources and database state, though it does change some logs.

The key change here is to modify migrateOrg to return pairs of legacy struct + ngalert struct instead of actually persisting the alerts and alertmanager config. This will allow us to capture error information during dry-run migration.

It also moves most persistence-related operations such as title deduplication and folder creation to the right before we persist. This will simplify eventual partial migrations (individual alerts, dashboards, channels, ...).

Additionally it changes channel code to deal with PostableGrafanaReceiver instead of PostableApiReceiver (integration instead of contact point).
2024-01-05 05:37:13 -05:00
Mihai Doarna
359b118e6a
Auth: fix camelCase in getFallbackStrategyFor() func (#80061)
fix camelCase in getFallbackStrategyFor() func
2024-01-05 12:25:59 +02:00
Santiago
1f6575e65e
Alerting: Test MOA in remote secondary mode (#79828) 2024-01-05 11:05:27 +01:00