Commit Graph

12236 Commits

Author SHA1 Message Date
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
Charandas
87c3d3b029
K8s: add the CRD server to the grafana-aggregator component (pkg/cmd) (#80759) 2024-01-17 12:21:24 -08: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
Gabriel MABILLE
6b954165c5
RBAC: Cover plugin routes (#80578)
* RBAC: Cover plugin routes

* Action instead of ReqAction

* Fix test initializations

* Fix NewPluginProxy call

* Duplicate test to add RBAC checks

* Cover legacy access control as well

* Fix typo

* action -> reqAction

* Add example

Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com>

---------

Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com>
2024-01-17 16:32:23 +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
Gábor Farkas
2cb2845ec4
sql: use plugin-sdk code for value-to-float64 conversion (#80621)
sql: use plugin-sdk code
2024-01-17 13:42:32 +01: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
Gábor Farkas
58b13fed5a
postgres: tests: adjusted the timestamps to be in UTC (#80704) 2024-01-17 11:27:43 +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
Gábor Farkas
4291bf4d69
postgres: tests: improve float64-conversion tests (#80627)
postgres: more tests
2024-01-17 10:31:15 +01: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
Andres Martinez Gotor
0d1462cbbb
Add real instances to testdata standalone API server (#80473)
Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
2024-01-17 09:22:51 +01:00
Gábor Farkas
2bf56b12cf
postgres: simplify proxy code (#80121) 2024-01-17 09:20:27 +01:00
Gabriel MABILLE
e062fa1d7e
RBAC: Change search permissions buckets to cover long searches (#80624)
* RBAC: Change search permissions histogram start and factor

* Add one bucket and lower start
2024-01-17 09:13:56 +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
Horst Gutmann
01e430e821
chore: Bump Alpine base image to 3.18.5 (#80540) 2024-01-16 15:24:40 +01:00
Joey
6796e66fb8
Pyroscope: Add standalone build (#80222)
* Pyroscope standalone build

* Fix for tests

* Add missing packages

* Remove import

* Update trace to profiles

* Update test
2024-01-16 12:46:15 +00:00
Tania
c0918d41dd
Chore: Remove extra loop over folders in GetFolders handler (#79933)
Chore: Remove extra loop in GetFolders handler
2024-01-16 12:35:10 +01: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
Tolya Korniltsev
b5a1a3e106
Profiling: Import godeltaprof/http/pprof (#80509)
chore: import godeltaprof/http/pprof

This adds /debug/pprof/delta_{heap,mutex,block} endpoints to DefaultServeMux
and the profiling port.
2024-01-16 17:58:35 +07:00
Fabrizio
522519f671
Tempo: Decouple Tempo from Grafana core (#79888) 2024-01-16 11:36:40 +01: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
Ida Štambuk
d3a89a28fa
Cloudwatch Metrics: Adjust error handling (#79911) 2024-01-15 17:19:26 +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
Gábor Farkas
6a36525d61
postgres: better error handling (#80375) 2024-01-15 12:50:01 +01: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
Kyle Cunningham
1596339796
Chore: Update CODEOWNERS for end of BI (#80522)
Update CODEOWNERS
2024-01-15 11:53:22 +02:00
Gábor Farkas
cfddc67a25
sql: support the no-tls option in the socks proxy (#80376)
postgres: support the no-tls option in the socks proxy
2024-01-15 09:57:43 +01:00
Gábor Farkas
6b5805dd1b
postgres: vendor in the file-exists helper (#80446) 2024-01-15 08:53:43 +01: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