Commit Graph

73 Commits

Author SHA1 Message Date
beejeebus 9a4e13800d Guard config CRUD metrics so it's safe for grafana-enterprise
Previous attempt to land this required this PR and a grafana-enterprise
PR to land at the ~same time.

This PR guards the use of `dsConfigHandlerRequestsDuration` with a nil
check, and doesn't change any existing APIs, so we can land it without
any timing issues with grafana-enterprise.

Once this has landed, we'll make a follow-up PR for grafana-enterprise.
2025-12-12 07:21:29 -05:00
beejeebus 2a65e0cdcb Revert "Wire up data source config metrics correctly"
This reverts commit e433cfa02d.
2025-12-10 17:38:00 -05:00
beejeebus e433cfa02d Wire up data source config metrics correctly
Fix metrics for data source configuration CRUD.

Make sure to only create one histogram and only register it with prometheus once.
2025-12-10 16:16:22 -05:00
beejeebus 26c52796f6 Pass the feature flag instead of false to RegisterAPIService
Doh. The feature flag was not actually being used to enable the new DS
config CRUD APIs. This PR fixes that, hashtag facepalm.
2025-12-04 14:17:45 -05:00
beejeebus ca8cad68c8 Add a metric to track usage of datasource configuration CRUD
This PR adds `ds_config_handler_requests_duration_seconds` metric to help us
track the release of the new datasource configuration CRUD api.

Fixes https://github.com/grafana/grafana-enterprise/issues/10309
2025-11-26 10:49:11 -05:00
beejeebus 6d64c373ce Allow FlagQueryServiceWithConnections to enable datasource config CRUD
The FlagGrafanaAPIServerWithExperimentalAPIs is only available when
`app_mode=development`. We have a more specific flag that is usable in
production, so use that.

Also, there was some old code constraining these APIs to a static list
of datasources. We don't need that anymore, so this PR removes it.

The FlagQueryServiceWithConnections is left as is, because there are
multiple existing tests that rely on this development-only, experimental
flag. I don't want to understand why that is.
2025-11-12 08:48:46 -05:00
Gábor Farkas 34e85113d2 datasources: apiserver: removed unnecessary code (#113384)
* datasources: apiserver: removed unnecessary code

* workspace fixes
2025-11-11 09:25:22 +01:00
beejeebus 0e9fe9dc40 Register external datasource plugins on startup
Current code only registers core datasource k8s api groups.

Add external plugins.

Companion grafana-enterprise PR:

https://github.com/grafana/grafana-enterprise/pull/10125
2025-11-07 14:42:41 -05:00
Gábor Farkas acb0320796 datasources: apiserver: do not enable extra methods by default (#113395) 2025-11-06 15:34:32 +01:00
Denis Vodopianov 81683d554d chore : Deprecating FeatureToggles.IsEnabledGlobally (#112885)
* add deprecation on featuremgmt.IsEnabledGlobally

* add nolint reason

* add reasonable deprecation message

* remove junk edits

* add more nolints

* addressing review comments

* Update pkg/services/featuremgmt/models.go

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

---------

Co-authored-by: Dave Henderson <dave.henderson@grafana.com>
2025-10-24 12:02:53 -04:00
Ryan McKinley 13a3c46079 DataSource: Fix openapi spec (#112150) 2025-10-08 14:36:24 +03:00
beejeebus b7c73a9bfc Make it safe to run new config CRUD APIs in DS API server
Using `configCrudUseNewApis` passed through for DS API servers from the
`grafana-enterprise` codebase.
2025-10-07 14:31:07 -04:00
beejeebus c3f34efb41 Revert "Revert: DataSource: Support config CRUD from apiservers (#106996) (#110342)"
This reverts commit 72eeefabd7.
2025-10-07 14:31:07 -04:00
Todd Treece 2d232aa10d Plugins: Move store init to dskit service (#111823) 2025-10-02 19:53:31 -04:00
Sarah Zinger 74a2232de1 DS-Apiservers: fix error handling in ds apiservers (#111956) 2025-10-02 15:40:30 -04:00
Will Browne cc72599321 Revert "Plugins: Move store init to dskit service" (#111806)
Revert "Plugins: Move store init to dskit service (#111206)"

This reverts commit 4cff7237d0.
2025-09-30 12:48:27 +01:00
Todd Treece 4cff7237d0 Plugins: Move store init to dskit service (#111206) 2025-09-29 15:32:15 -04:00
Nathan Vērzemnieks 72eeefabd7 Revert: DataSource: Support config CRUD from apiservers (#106996) (#110342)
Revert "DataSource: Support config CRUD from apiservers (#106996)"

This reverts commit eda94a6434.
2025-08-29 14:49:57 +02:00
Ryan McKinley eda94a6434 DataSource: Support config CRUD from apiservers (#106996) 2025-08-28 22:28:26 +03:00
Nathan Vērzemnieks 66d9a33cc9 Datasources: Update grafana-aws-sdk for new sigv4 middleware and aws-sdk-go v1 removal (#107522)
Datasources: Update grafana-aws-sdk
2025-07-03 17:48:57 +02:00
Stephanie Hingtgen ef6e28b955 K8s: Make v0alpha1 opt-in (#107056) 2025-06-20 16:37:17 -05:00
Mariell Hoversholm 757be6365a CI: Bump golangci-lint to 2.0.2 (#103572) 2025-04-10 14:42:23 +02:00
Ryan McKinley 04fb9f534e Dashboards: Only expose LibraryPanels and search on v0 (not v1+v2) (#103335) 2025-04-03 20:24:12 +03:00
Sarah Zinger 0152f414f0 DS Apiservers: return 404 when receiving a datasource not found error (#100025)
* DS Apiservers should return a k8s 404 error

* Do not swallow status codes

* Updates from initial CR.

* Add test for ds apiserver to retunr 404 when a datasource is not found

* Didn't intend for a change here
2025-02-10 12:07:51 -05:00
Ryan McKinley 9d5af95565 K8s/OpenAPI: Remove /watch/ from the openapi spec (#99793) 2025-01-30 12:51:55 +03:00
Ryan McKinley 5f39d2eeb0 K8s: Make GetAPIRoutes an optional interface (#97531) 2024-12-07 03:08:18 +03:00
Gábor Farkas a45deafc96 query: add missing x-rule headers (#95948) 2024-11-07 16:03:54 +01:00
Ryan McKinley 36c38b5310 APIServer: add prometheus.Registerer to every init request (#94684) 2024-10-15 07:46:08 +03:00
Andres Martinez Gotor 225600a08b Expose queryconvert endpoint (#93656) 2024-09-25 15:10:19 +02:00
Todd Treece 3221f493f9 K8s: Prevent registration of frontend datasources (#93635) 2024-09-24 06:39:11 -04:00
Charandas db97da3465 K8s: handle multiple versions of the same group in standalone mode (#93199) 2024-09-23 19:07:52 -07:00
Ryan McKinley f21a5987a2 Plugins: Expose datasources as apiservers feature toggle (#93250) 2024-09-19 11:28:27 +03:00
Andres Martinez Gotor 01a4e6b9af Remove the need for plugins to implement AdmissionHandler for v0alpha1 (#93272) 2024-09-13 09:08:26 +02:00
Ryan McKinley cb484f9883 K8s: Move ResourceInfo from common to utils (#92924) 2024-09-04 14:53:14 +03:00
Jean-Philippe Quéméner 5dce149221 feat(querier): propagate all known alerting headers (#92873) 2024-09-03 18:01:27 +02:00
Sarah Zinger c0b2fafd5e Ensure that datasource apiservers receive and forwards headers (#92304)
* Ensure that datasource apiservers receive and forwards headers for datasources:
- adds log line for prometheus to see when from alert header is received
- add logging to the datasource apiserver
- Updates the Connect func in sub query to forward expected headers to datasources and log unexpected ones.
2024-08-29 11:06:25 -04: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
Ryan McKinley a223c46506 APIServer: Make TableConverter part of ResourceInfo (#91520) 2024-08-05 15:38:12 +03:00
Ryan McKinley d2bc4f3255 DualWrite: Cleanup and centralize the dual write creation (#90013) 2024-07-11 23:23:31 +03:00
Andres Martinez Gotor f41ee615ba Chore: Add basic admission handlers for registered API services (#89824) 2024-07-03 09:19:54 +02:00
Todd Treece 9c6d3590a2 Chore: Fix apiserver circular dependencies (#89918) 2024-07-01 11:42:34 -04:00
Isabella Siu 3ac109e759 AWS: Update deprecated aws-sdk functions from env variable versions (#89643) 2024-06-26 11:56:39 -04:00
Ryan McKinley 27e800768e K8s: Improve identity mapping setup (#89450) 2024-06-20 17:53:07 +03:00
Leonor Oliveira fd44f2ee4f Init dualwriter metrics (#89003)
* Pass prometheus registerer to the dual writer

* Fix tests

* Remove unused var

* Fix tests

* Uncomment test

* Remove leading line

* Fix tests. Reuse registerer if there's already one

* Lint

* Improve double registering logic

* Rebase main
2024-06-14 11:01:49 +02:00
Ryan McKinley 3ae95a6eb1 K8s: Update grafana resource metadata accessor (#89074) 2024-06-12 14:39:37 +03:00
Marcus Efraimsson 2403665998 Chore: Remove legacydata package (#88790)
* Chore: Remove legacydata package

* remove unused dependency

* sdk v0.234.0
2024-06-05 22:31:06 +02:00
Arati R 36f42853dd Storage: Read desired mode from config instead of feature flags (#88353)
* Read desired mode from config
* Update playlist integration tests
* Add mode 1 playlist integration tests
* Add mode 0 dual writing to playlist integration tests
* Add documentation for the different dual writing modes
2024-05-31 19:29:59 +02:00
Ryan McKinley 42b0f802de QueryTypes: Add feature toggle to show query types in datasource apiservers (#88213)
* initial attempt

* show query types

* show query types

* with formatting

* with formatting

* more cleanup

* add feature toggle

* fix build
2024-05-23 18:46:28 +02:00
Marcus Efraimsson c9ab4e3a9e DS apiserver: Fix resource path (#85494) 2024-04-02 20:09:18 +02:00
Ryan McKinley e6fa367d02 k8s/query+ds: catch query errors, fix datasourceProvider and expose prometheus (#85071) 2024-03-25 17:22:34 +03:00