Commit Graph

191 Commits

Author SHA1 Message Date
Andres Martinez Gotor
eac02a61e1
Return plugin error when requesting settings (#86052) 2024-04-18 14:29:02 +02:00
Andres Martinez Gotor
0f4a47b180
Plugin load errors: Add more well-known errors (#85960) 2024-04-18 13:04:22 +02:00
Giuseppe Guerra
eec9d3dbc4
Plugins: Removed feature toggle pluginsDynamicAngularDetectionPatterns (#85956)
* Plugins: Removed feature toggle pluginsDynamicAngularDetectionPatterns

* re-generate feature toggles
2024-04-15 10:37:28 +02:00
Giuseppe Guerra
e42d8f0bd0
Plugins: Removed feature toggle enablePluginsTracingByDefault (#85953) 2024-04-11 18:40:47 +02:00
Andres Martinez Gotor
ab5a065256
Revamp plugin loading error management (#85939) 2024-04-11 16:18:04 +02:00
Dave Henderson
5687243d0b
Feature Flags: use FeatureToggles interface where possible (#85131)
* Feature Flags: use FeatureToggles interface where possible

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

* Replace TestFeatureToggles with existing WithFeatures

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

---------

Signed-off-by: Dave Henderson <dave.henderson@grafana.com>
2024-04-04 12:22:31 -04:00
Serge Zaitsev
faa1244518
Chore: Replace sqlstore with db interface (#85366)
* replace sqlstore with db interface in a few packages

* remove from stats

* remove sqlstore in admin test

* remove sqlstore from api plugin tests

* fix another createUser

* remove sqlstore in publicdashboards

* remove sqlstore from orgs

* clean up orguser test

* more clean up in sso

* clean up service accounts

* further cleanup

* more cleanup in accesscontrol

* last cleanup in accesscontrol

* clean up teams

* more removals

* split cfg from db in testenv

* few remaining fixes

* fix test with bus

* pass cfg for testing inside db as an option

* set query retries when no opts provided

* revert golden test data

* rebase and rollback
2024-04-04 15:04:47 +02:00
Andres Martinez Gotor
9c7237891c
Plugins: Expose ExternalService in request config (#85187) 2024-04-03 09:22:34 +02:00
Will Browne
1a0ac381eb
Plugins: Send PDC file paths and contents for backwards compatibility (#85287)
* send paths and contents

* go work sync
2024-03-27 18:19:11 +01:00
Will Browne
cd912367b3
Plugins: Pass PDC info as file paths (#85239)
* pass filepaths

* fix test
2024-03-27 15:21:05 +01:00
Serge Zaitsev
4d4c06b480
Chore: Vendor wire into pkg/build (#84637)
* vendor latest wire into pkg/build

* use vendored wire in builds

* fix wire import path

* remove wire from bingo

* also support google/wire import

* make prettier happy

* change package in tess

* add debug walk for drone

* add wire_gen in tests

* remove debug walk

* restore imports
2024-03-25 11:23:27 +01:00
Will Browne
b765c21d4c
Plugins: Pass PDC file contents in requests (#84783)
* Plugins: Pass PDC file contents in requests

* go mod tidy

* undo go.mod changes

* fix linter

* fix tests

* undo unnecessary changes

* update dep

* join with comma

* update naming

* bump SDK
2024-03-22 13:52:24 +01:00
Marcus Efraimsson
488bbaacab
Chore: Remove unused dependenices in plugin client middlewares (#84624)
* Chore: Remove unused dependenices in plugin client middlewares

* refactor logger middleware to remove cfg dependency

* hack to make tracing work in api group builders
2024-03-22 12:54:35 +01:00
Giuseppe Guerra
eb31f71f60
Plugins: Enable feature toggle pluginsDynamicAngularDetectionPatterns by default (#84723)
* Enable feature toggle pluginsDynamicAngularDetectionPatterns by default

* Change backgroundJobInterval to 24h

* re-generate feature toggles

* Use different intervals for cloud vs on-prem

* temporarily switch interval log to info level

* debug level again

* Simplify provideDynamic for tests

* re-generated feature toggles files

* PR review feedback

* PR review feedback: removed dependency from plugin management config
2024-03-21 18:22:06 +02:00
Marcus Efraimsson
6c1de260a2
API Server: Standalone observability (#84789)
Adds support for logs (specify level), metrics (enable metrics and Prometheus /metrics endpoint 
and traces (jaeger or otlp) for standalone API server. This will allow any grafana core service 
part of standalone apiserver to use logging, metrics and traces as normal.
2024-03-21 17:06:32 +01:00
Xavi Lacasa
a813046f3d
Better tracing during extSvcAcc registration (#84719) 2024-03-21 16:41:10 +01:00
Andreas Christou
6bb7ab261a
AzureMonitor: User authentication support (#81918)
* Stub out frontend user auth

* Stub out backend user auth

* Add context

* Reorganise files

* Refactor app registration form

* Alert for user auth service principal credentials

* AzureMonitor: Add flag for enabling/disabling fallback credentials for current user authentication (#82332)

* Rename field

* Add fallback setting

* Update tests and mock

* Remove duplicate setting line

* Update name of property

* Update frontend settings

* Update docs and default config files

* Update azure-sdk

* Fix lint

* Update test

* Bump dependency

* Update configuration

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

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

* Docs review

* AzureMonitor: User authentication frontend updates (#83107)

* Rename field

* Add fallback setting

* Update tests and mock

* Remove duplicate setting line

* Update name of property

* Update frontend settings

* Update docs and default config files

* Add alerts to query editor

- Add authenticatedBy property to grafana/data
- Update mocks
- Update query editor to disable it under certain circumstances
- Update tests

* Add separate FallbackCredentials component

- Reset AppRegistrationCredentials component to only handle clientsecret credentials
- Update AzureCredentialsForm
- Update selectors
- Update tests
- Update credentials utility functions logic

* Alert when fallback credentials disabled

* Update condition

* Update azure-sdk

* Fix lint

* Update test

* Remove unneeded conditions

* Set auth type correctly

* Legacy cloud options

* Fix client secret

* Remove accidental import

* Bump dependency

* Add tests

* Don't use VerticalGroup component

* Remove unused import

* Fix lint

* Appropriately set oAuthPassThru and disableGrafanaCache properties

* Clear azureCredentials on authType change

* Correctly retrieve secret

* Fix bug in authTypeOptions

* Update public/app/plugins/datasource/azuremonitor/components/ConfigEditor/CurrentUserFallbackCredentials.tsx

Co-authored-by: Andrew Hackmann <5140848+bossinc@users.noreply.github.com>

* Update public/app/plugins/datasource/azuremonitor/components/QueryEditor/QueryEditor.tsx

Co-authored-by: Andrew Hackmann <5140848+bossinc@users.noreply.github.com>

* Update public/app/plugins/datasource/azuremonitor/components/ConfigEditor/CurrentUserFallbackCredentials.tsx

Co-authored-by: Andrew Hackmann <5140848+bossinc@users.noreply.github.com>

* Add documentation links

* Fix broken link

---------

Co-authored-by: Andrew Hackmann <5140848+bossinc@users.noreply.github.com>

* AzureMonitor: Update docs for current user authentication (#83440)

* Rename field

* Add fallback setting

* Update tests and mock

* Remove duplicate setting line

* Update name of property

* Update frontend settings

* Update docs and default config files

* Add alerts to query editor

- Add authenticatedBy property to grafana/data
- Update mocks
- Update query editor to disable it under certain circumstances
- Update tests

* Add separate FallbackCredentials component

- Reset AppRegistrationCredentials component to only handle clientsecret credentials
- Update AzureCredentialsForm
- Update selectors
- Update tests
- Update credentials utility functions logic

* Alert when fallback credentials disabled

* Update condition

* Update azure-sdk

* Fix lint

* Update test

* Remove unneeded conditions

* Set auth type correctly

* Legacy cloud options

* Fix client secret

* Remove accidental import

* Bump dependency

* Add tests

* Don't use VerticalGroup component

* Remove unused import

* Update docs

* Fix lint

* Appropriately set oAuthPassThru and disableGrafanaCache properties

* Clear azureCredentials on authType change

* Correctly retrieve secret

* Feedback

* Spelling

* Update docs/sources/datasources/azure-monitor/_index.md

Co-authored-by: Larissa Wandzura <126723338+lwandz13@users.noreply.github.com>

* Update docs/sources/datasources/azure-monitor/_index.md

Co-authored-by: Larissa Wandzura <126723338+lwandz13@users.noreply.github.com>

* Update docs/sources/datasources/azure-monitor/_index.md

Co-authored-by: Larissa Wandzura <126723338+lwandz13@users.noreply.github.com>

* Update docs/sources/datasources/azure-monitor/_index.md

Co-authored-by: Larissa Wandzura <126723338+lwandz13@users.noreply.github.com>

---------

Co-authored-by: Larissa Wandzura <126723338+lwandz13@users.noreply.github.com>

* Docs review

* Update docs with additional configuration information

* Fix to appropriately hide the query editor

* Typo

* Update isCredentialsComplete

* Update test

---------

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
Co-authored-by: Andrew Hackmann <5140848+bossinc@users.noreply.github.com>
Co-authored-by: Larissa Wandzura <126723338+lwandz13@users.noreply.github.com>
2024-03-19 16:32:24 +00:00
Andreas Christou
7c3f621688
Chore: Update grafana-azure-sdk-go (#84741)
* Update grafana-azure-sdk-go

* Update test
2024-03-19 14:56:40 +00:00
Jack Westbrook
4ca68925a1
Backend: Delete bundled plugin tests (#84646) 2024-03-18 13:28:24 +01:00
Andres Martinez Gotor
6204f1e847
Chore: Use SigV4 middleware from aws-sdk (#84462) 2024-03-18 09:33:22 +01:00
Will Browne
9d453d0dcc
Plugins: Remove direct featuremgmt.FeatureToggles dependency from plugins config (#84482) 2024-03-15 10:58:51 +01:00
Gilles De Mey
8765c48389
Alerting: Remove legacy alerting (#83671)
Removes legacy alerting, so long and thanks for all the fish! 🐟

---------

Co-authored-by: Matthew Jacobson <matthew.jacobson@grafana.com>
Co-authored-by: Sonia Aguilar <soniaAguilarPeiron@users.noreply.github.com>
Co-authored-by: Armand Grillet <armandgrillet@users.noreply.github.com>
Co-authored-by: William Wernert <rwwiv@users.noreply.github.com>
Co-authored-by: Yuri Tseretyan <yuriy.tseretyan@grafana.com>
2024-03-14 15:36:35 +01:00
Andres Martinez Gotor
c061cc33cc
Chore: Use response limit middleware from SDK (#83915) 2024-03-13 10:14:16 +01:00
Will Browne
225ac8003c
Plugins: Tidy config struct (#84168)
* tidy plugins config usage

* fix tests
2024-03-11 16:28:46 +01:00
Selene
1181141b40
Schemas: Refactor plugin's metadata (#83696)
* Remove kinds verification for kind-registry

* Read plugin's json information with json library instead of use thema binding

* Remove grafanaplugin unification

* Don't use kindsys for extract the slot name

* Fix IsGroup

* Remove all plugindef generation

* Refactor schema interfaces

* Pushed this change from a different branch by mistake...

* Create small plugin definition structure adding additional information for plugins registration

* Add some validation checks

* Delete unused code

* Fix imports lint
2024-03-07 11:09:19 +01:00
Ieva
2c5b72e844
AuthZ: add headers for IP range AC checks for data source proxy requests (#81662)
* add a middleware that appens headers for IP range AC to data source proxy requests

* update code

* add tests

* fix a mistake

* add logging

* refactor to reuse code

* small cleanup

* skip the plugins middleware if the header is already set

* skip the plugins middleware if the header is already set
2024-03-06 12:40:48 +00:00
Will Browne
5edd96ae77
Plugins: Refactor plugin config into separate env var and request scoped services (#83261)
* seperate services for env + req

* merge with main

* fix tests

* undo changes to golden file

* fix linter

* remove unused fields

* split out new config struct

* provide config

* undo go mod changes

* more renaming

* fix tests

* undo bra.toml changes

* update go.work.sum

* undo changes

* trigger

* apply PR feedback
2024-02-27 12:38:02 +01:00
Gabriel MABILLE
80d6bf6da0
AuthN: Remove embedded oauth server (#83146)
* AuthN: Remove embedded oauth server

* Restore main

* go mod tidy

* Fix problem

* Remove permission intersection

* Fix test and lint

* Fix TestData test

* Revert to origin/main

* Update go.mod

* Update go.mod

* Update go.sum
2024-02-26 11:29:09 +01:00
Ieva
19b1e71fee
IP range AC for data sources: compare the base of the URL only (#83305)
* compare the base of the URL and ignore the path

* change the logic to compare scheme and host explicitly

* fix the test
2024-02-23 18:13:21 +02:00
Gábor Farkas
3ba33fe278
mysql: do not use unexported grafana-core config (#83062)
* mysql: do not use unexported grafana-core config

* updated test
2024-02-22 14:22:14 +01:00
Giuseppe Guerra
68fe045ec7
Plugins: Remove pluginsInstrumentationStatusSource feature toggle (#83067)
* Plugins: Remove pluginsInstrumentationStatusSource feature toggle

* update tests

* Inline pluginRequestDurationWithLabels, pluginRequestCounterWithLabels, pluginRequestDurationSecondsWithLabels
2024-02-21 12:57:40 +01:00
Gábor Farkas
a62dccb0c0
plugins: add more configuration parameters to the plugin-config (#83060)
* envvars: add more configs

* made row-limit optional

* more consistent naming
2024-02-21 12:32:10 +02:00
Torkel Ödegaard
64e0a4282e
DataQuery: Track panel plugin id not type (#83091) 2024-02-21 09:38:42 +01:00
Yulia Shanyrova
9dcb7800de
Plugins: Add fuzzy search to plugins catalogue (#81001)
* WIP add fuzzysearch to plugins catalog

* Add keywords to the plugins listing output

* add fuzzy search to plugin catalog, add keywords to plugins at frontend side

* refactor fuzzysearch function after review

* review changes

* change the version of uFuzzy library

* change reduce result object in getPluginDetailsForFuzzySearch

* fix yarn lock error

* fix helpers tests

* fix frontend searching test

* fix frontend linting issues

* fix tests

---------

Co-authored-by: Esteban Beltran <esteban@academo.me>
Co-authored-by: Giuseppe Guerra <giuseppe@guerra.in>
2024-02-14 14:30:24 +01:00
Ieva
7c44dd713a
IP range AC: Add X-Real-IP header (#82390)
add X-Real-IP header
2024-02-14 11:45:55 +00:00
Will Browne
788b9afda3
Plugins: Make it possible to support multiple plugin versions (#82116)
* first pass

* use version in more places

* add comment

* update installer

* fix wire

* fix tests

* tidy

* simplify changes

* fix in mem

* remove unused step

* fix step dupe logic for child plugins + add tests
2024-02-12 12:47:49 +01:00
Dan Cech
790e1feb93
Chore: Update test database initialization (#81673)
* streamline initialization of test databases, support on-disk sqlite test db

* clean up test databases

* introduce testsuite helper

* use testsuite everywhere we use a test db

* update documentation

* improve error handling

* disable entity integration test until we can figure out locking error
2024-02-09 09:35:39 -05:00
Will Browne
99feb928cf
Plugins: Don't auto prepend app sub url to plugin asset paths (#81658)
* don't prepend app sub url to paths

* simplify logo path

* fix(plugins): dynamically prepend appSubUrl for System module resolving to work

* fix(sandbox): support dynamic appSuburl prepend when loading plugin module.js

* fix tests

* update test name

* fix tests

* update fe + add some tests

* refactor(plugins): move wrangleurl to utils, rename to resolveModulePath, update usage

* chore: fix a typo

* test(plugins): add missing name to utils test

* reset test flag

---------

Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
2024-02-08 12:19:28 +01:00
Andres Martinez Gotor
26bc87b60e
Chore: Replace core plugins as external warning (#81877) 2024-02-07 16:17:13 +02:00
ismail simsek
2679599968
Prometheus: Remove grafana/pkg/setting imports (#81813)
* upgrade grafana-azure-sdk-go v1.12.0

* add AzureAuthEnabled to config

* remove grafana/pkg/setting imports

* remove grafana/pkg/setting imports

* remove comment

* add better error message

* Fix the unit test

* fix lint
2024-02-07 11:01:09 +01:00
Gabriel MABILLE
4af5aef417
id forwarding: transfer Grafana id token to app plugins (#81967)
* id forwarding: allow for app plugins as well

* Add test
2024-02-06 16:26:17 +01:00
Isabella Siu
81da3ff753
CloudWatch: Remove dependencies on grafana/pkg/setting (#81208) 2024-02-05 13:59:32 -05:00
ismail simsek
2002a6c4fb
Chore: Bump grafana-azure-sdk-go to v1.12.0 and expose AzureAuthEnabled value in config (#81807)
* upgrade grafana-azure-sdk-go v1.12.0

* add AzureAuthEnabled to config
2024-02-05 13:36:33 +01: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
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
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
Alyssa Bull
be6efd9518
Cloud Monitoring: Add standalone files and modify plugin.json (#81596) 2024-01-30 15:52:44 -07: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
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