Commit Graph

12359 Commits

Author SHA1 Message Date
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
Kyle Brandt
1b155a02fd
Prometheus: (Dataplane) Set FrameTypeVersion on Scalar type responses (#81491)
So expressions (SSE) and recorded queries (RQ) detect the response correctly
2024-01-29 11:39:23 -05:00
Gábor Farkas
ba544e5b33
postgres: tests: improved number->timestamp tests (#81495)
* postgres: tests: nicer values

* postgres: tests: add float-to-timestamp tests
2024-01-29 18:27:15 +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
Matias Chomicki
5486a111e6
parseSupportingQueryType: add missing case for infinite scroll (#81492) 2024-01-29 18:12:03 +02: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
ismail simsek
a3fda08d4e
Datasources: Add concurrency number to the settings (#81212)
add concurrency to the settings
2024-01-29 11:47:28 +01:00
Matias Chomicki
df05c79d91
Infinite scrolling: Add X-Query-Tag header (#81089) 2024-01-29 11:24:05 +01:00
Giedrius Statkevičius
6f245121d0
Plugins: Fix colon in CallResource URL returning an error when creating plugin resource request (#79746)
* Plugin: handle colon character in path

url.Parse() does not handle the given input correctly when the input
contains a colon character. The user will see the following error
message when trying to use remote cluster in Elasticsearch:

```
level=warn msg="Failed for create plugin resource request" error="parse \"foo-*,*:foo-*/_mapping\": first path segment in URL cannot contain colon" traceID=
```

As far as I can tell, we only want to set the path here + rawquery so
avoid url.Parse() altogether.

* Add more tests

---------

Co-authored-by: Giuseppe Guerra <giuseppe@guerra.in>
2024-01-29 10:31:49 +01:00
Ryan McKinley
1fab107e79
FeatureFlags: Avoid using cfg.IsFeatureToggleEnabled (#81407) 2024-01-28 15:22:45 -08:00
Andrew Hackmann
b411aa7266
Azure Monitor: use NewLoggerWith func instead of backend.Logger (#81124)
using NewLoggerWith
2024-01-26 22:53:55 +00:00
Summer
ad1c4b726b
Grafana Build: fix release process not publishing latest storybook (#81412)
Bugfix: release process not publishing latest storybook
2024-01-26 15:22:05 -07: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
Domas
e9a99a46b0
Tempo: Support multiple filter expressions for service graph queries (#81037)
* support "OR" for service graph queries

* make betterer happy

* continue appeasing betterer

* betterer results
2024-01-26 16:37:49 +02: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
Gábor Farkas
7230ec88a1
postgres: test: remove unused code (#81330) 2024-01-26 10:45:17 +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
Gábor Farkas
b1d1aa667a
postgres: refactor code that is called by tests (#81279)
* postgres: refactor code that is called by tests too

* removed debug log
2024-01-26 09:11:25 +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
Charandas
9167d67c05
K8s: update hack codegen script (#81216) 2024-01-25 12:01:09 -08:00
William Wernert
2af8158f99
Remove Loki annotation toggle (#81296) 2024-01-25 12:56:09 -05:00
idafurjes
fb2b9f33d2
Fix method to service in metric label for FolderID (#81283) 2024-01-25 18:26:24 +02: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
ismail simsek
7d0017f3f2
InfluxDB: Use grafana timeout value for flux queries (#81252)
* use grafana timeout for flux queries

* get timeout from settings

* fix test
2024-01-25 17:05:08 +01:00
Isabella Siu
5772662cee
CloudWatch: decouple from ngalert/models and query packages (#81210) 2024-01-25 09:40:55 -05: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
Ida Štambuk
9b4c78dbc9
Cloudwatch: Import httpClient from grafana-plugin-sdk-go instead of grafana/infra (#81187) 2024-01-25 13:33: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
ismail simsek
14e55fefbb
InfluxDB: Check the value type before casting it to the string (#80986)
* Check the value type before casting it to the string

* set visualization as table by default

* append all values for show diagnostics

* golangci-lint

* append metadata only to first frame
2024-01-25 11:28:25 +01:00