Commit Graph

151 Commits

Author SHA1 Message Date
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
Alyssa Bull
2d432d6ff3
Plugins: Externalize Cloud Monitoring data source (#80181) 2024-01-29 09:24:23 -07:00
Ryan McKinley
1fab107e79
FeatureFlags: Avoid using cfg.IsFeatureToggleEnabled (#81407) 2024-01-28 15:22:45 -08: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
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
Will Browne
3885497553
Plugins: Update renderer plugin source (#80643)
* rework renderer plugin source

* add tests
2024-01-18 11:06:33 +01:00
Michael Mandrus
db83eb30a2
Caching: Remove useCachingService feature toggle (#80695)
remove useCachingService feature toggle
2024-01-17 16:53:25 -05:00
Ryan McKinley
1caaa56de0
FeatureFlags: Use interface rather than manager (#80000) 2024-01-09 10:38:06 -08: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
Andreas Christou
dd77ff6bcd
Plugins: Externalise Azure Monitor data source (#79545)
* Set up frontend linting for Azure

- Fix final frontend import
- Fix other lint issues

* Add Azure Monitor to backend linting

* Remove featuremgmt dependency

* Add intervalv2 to list of disallowed imports

* Remove config dependency

- Replace with function from azure-sdk

* Remove util dependency

* Duplicate interval functionality from core

* Add required backend wrappers

* Update frontend

* Add testing helper

* Add missing package

* Bump minimum grafana dependency

* Fix dependency

* Regen cue

* Fix lint

* Update expected response file

* Update import and dependency
2024-01-03 19:20:22 +00:00
Joey
00bc13e37c
Pyroscope: Remove unnecessary import and logic (#79568)
* Remove unecessary import and logic

* Update test
2024-01-03 11:25:38 +00:00
Will Browne
0b511aaace
Plugins: Add backend check for app page role access (#78269)
* add backend check for roles

* tidy

* fix tests

* incorporate rbac

* fix linter

* apply PR feedback

* add tests

* fix logic

* add comment

* apply PR feedback
2023-12-18 16:12:46 +01:00
Will Browne
ce8fd14f1f
Plugins: Make renderer service load renderer plugin (#77854)
* rendering service loads renderer plugin

* update naming

* tidy

* apply PR feedback

* fix missing feature manager

* fix step

* set plugin
2023-12-14 17:33:29 +01:00
Ben Sully
315100e2e3
Plugins: Add Grafana config to app plugin context (#79439) 2023-12-13 10:28:24 +01:00
Giuseppe Guerra
0d1d437c86
Plugins: Add forward_host_env_vars setting (#79333)
* Plugins: Add forward_host_env_vars_plugins setting

* Renamed forward_host_env_vars_plugins to forward_host_env_vars

* Add readPluginIDsList

* refactoring

* lint

* Use util.SplitString
2023-12-13 11:25:17 +02:00
Giuseppe Guerra
f76b9f266e
Plugins: Add hide_angular_deprecation setting (#79296)
* Add plugins.hide_angular_deprecation config ini

* Add more tests

* Remove the ability to use [plugins.*] hide_angular_deprecation
2023-12-12 11:20:21 +02:00
ismail simsek
c088d003f2
InfluxDB: Implement InfluxQL json streaming parser (#76934)
* Have the first iteration

* Prepare bench testing

* rename the test files

* Remove unnecessary test file

* Introduce influxqlStreamingParser feature flag

* Apply streaming parser feature flag

* Add new tests

* More tests

* return executedQueryString only in first frame

* add frame meta and config

* Update golden json files

* Support tags/labels

* more tests

* more tests

* Don't change original response_parser.go

* provide context

* create util package

* don't pass the row

* update converter with formatted frameName

* add executedQueryString info only to first frame

* update golden files

* rename

* update test file

* use pointer values

* update testdata

* update parsing

* update converter for null values

* prepare converter for table response

* clean up

* return timeField in fields

* handle no time column responses

* better nil field handling

* refactor the code

* add table tests

* fix config for table

* table response format

* fix value

* if there is no time column set name

* linting

* refactoring

* handle the status code

* add tracing

* Update pkg/tsdb/influxdb/influxql/converter/converter_test.go

Co-authored-by: İnanç Gümüş <m@inanc.io>

* fix import

* update test data

* sanity

* sanity

* linting

* simplicity

* return empty rsp

* rename to prevent confusion

* nullableJson field type for null values

* better handling null values

* remove duplicate test file

* fix healthcheck

* use util for pointer

* move bench test to root

* provide fake feature manager

* add more tests

* partial fix for null values in table response format

* handle partial null fields

* comments for easy testing

* move frameName allocation in readSeries

* one less append operation

* performance improvement by making string conversion once

pkg: github.com/grafana/grafana/pkg/tsdb/influxdb/influxql
             │ stream2.txt │            stream3.txt             │
             │   sec/op    │   sec/op     vs base               │
ParseJson-10   314.4m ± 1%   303.9m ± 1%  -3.34% (p=0.000 n=10)

             │ stream2.txt  │             stream3.txt              │
             │     B/op     │     B/op      vs base                │
ParseJson-10   425.2Mi ± 0%   382.7Mi ± 0%  -10.00% (p=0.000 n=10)

             │ stream2.txt │            stream3.txt             │
             │  allocs/op  │  allocs/op   vs base               │
ParseJson-10   7.224M ± 0%   6.689M ± 0%  -7.41% (p=0.000 n=10)

* add comment lines

---------

Co-authored-by: İnanç Gümüş <m@inanc.io>
2023-12-06 12:39:05 +01:00
Gabriel MABILLE
5b70130e6c
Plugins: Rename externalServiceAuthentication to iam (#78686)
Plugins: Rename externalServiceAuthentication to iam
2023-12-04 13:14:21 +01:00
Andreas Christou
f26ad881ed
Plugins: Only set non-existing headers for core plugin requests (#78633)
* Only set non-existing headers

- Add test scenario

* Fix test
2023-11-30 11:51:40 +00:00
Gabriel MABILLE
b6b86bb0b3
RBAC: Check plugins:install globally (#78438)
* RBAC: Check plugins:install globally

* Add disclamer to the RBACSingleOrganization config option
2023-11-21 15:09:43 +01:00
Andres Martinez Gotor
20f3a87bf5
Bug: Fix loading behavior with FlagExternalCorePlugins (#78388) 2023-11-21 11:51:13 +01:00
Giuseppe Guerra
027a157898
Plugins: Allow disabling "skip host environment variables" per-plugin (#78266)
* Plugins: Allow disabling skipping host environment variables per-plugin

* Renamed SkipEnvVarsDecorateFunc to SkipHostEnvVarsDecorateFunc

* PR review feedback

* fix tests
2023-11-17 16:12:05 +02:00
Giuseppe Guerra
cb0a88a027
Plugins: Backend: Skip host environment variables (#77858)
* Add pluginsSkipHostEnvVars feature flag

* Set go-plugin's SkipHostEnvVar depending on feature flags

* add missing file

* Re-generate feature flags

* Add allowedHostEnvVarNames

* Fix feature toggles not being passed to plugin context service's plugin env vars

* Fix tests

* PR review feedback: Use cfg.Features

* Fix tests

* PR review feedback: removed DefaultProviderWithFeatures

* merge with master

* fix tests

* use features.IsEnabledGlobally
2023-11-15 18:09:14 +01:00
Ryan McKinley
f69fd3726b
FeatureToggles: Add context and and an explicit global check (#78081) 2023-11-14 12:50:27 -08:00
Jo
580477bf8e
NGAlerting: Use identity.Requester interface instead of SignedInUser (#76360)
* unfurl SignedInUserAttrs services

* replace signedInUser with Requester

replace signedInUser with requester

* fix tests

* linting

---------

Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
2023-11-14 14:47:34 +00:00
Giuseppe Guerra
ab4fc07cc7
Plugins: Add statusSource to partial data response error log (#78057)
* Plugins: Add statusSource to partial data response error log

* Introduce DefaultStatusSource

* Add StatusSourceFromPluginErrorSource

* Moved StatusSourceFromPluginErrorSource

* Update pkg/services/pluginsintegration/clientmiddleware/logger_middleware.go
2023-11-14 16:27:48 +02:00
Ryan McKinley
dec9a07738
Settings: Actually deprecate access to feature flags (#78073) 2023-11-13 11:39:01 -08:00
Ryan McKinley
3509a5abb9
FeatureFlags: Cleanup usage of cfg.IsFeatureToggleEnabled (#78014) 2023-11-13 07:55:15 -08:00
Gabriel MABILLE
fe8d0e6381
ExtSvcAuth: Refactor external service registry to use ExternalServiceRegistry variables (#78056)
ExtSvcAuth: Refactor external service registry to use ExternalServiceRegistry
2023-11-13 16:23:11 +01:00
Gabriel MABILLE
20a2840046
Plugin: Remove external service on plugin removal (#77712)
* Plugin: Remove external service on plugin removal

* Add feature flag check in the service registration service

* Initialize map

* Add HasExternalService as suggested

* Commit suggestion

Co-authored-by: linoman <2051016+linoman@users.noreply.github.com>

* Nit on test.

Co-authored-by: linoman <2051016+linoman@users.noreply.github.com>


---------

Co-authored-by: linoman <2051016+linoman@users.noreply.github.com>
2023-11-13 13:18:13 +01:00
Gábor Farkas
2d391c1bf5
postgresql: change plugin id (#77444)
* postgres: change plugin id

* fixed cue file

* codeowners update

* fixed backend test
2023-11-13 08:49:26 +01:00
Marcus Efraimsson
c7442c0fd2
Instrumentation: Check embedded errors in query data response for plugin metrics/logs status label (#77613)
Check embedded errors in query data response for plugin metrics/logs status label.
Plugin Request Completed log messages are now logged with info level if status=ok, 
otherwise error level.

Fixes #76769
2023-11-10 16:55:01 +01:00
Giuseppe Guerra
7b4bcc86f1
Plugins: Pass OTEL sampling config to plugins (#76834)
* Pass OTEL sampling config to plugins

* fix capital letters

* Do not pass sampler env vars if sampling is not configured

* Add tests

* PR review feedback

* Simplify tracing env vars logic

* Update test to reflect pkg/infra/tracing behaviour
2023-11-10 14:56:08 +01:00
Hugo Kiyodi Oshiro
e754c5a6c6
Plugins: Change managed plugins installation call (#77120) 2023-11-10 12:28:36 +01:00
Giuseppe Guerra
da117aea1c
Plugins: Allow disabling angular deprecation UI for specific plugins (#77026)
* Plugins:Allow disabling angular deprecation UI for specific plugins

* add backend test

* changed test names

* lint

* Removed angular properties from DataSourceDTO

* Update tests

* Move angularDetected and hideAngularDeprecation in angularMeta property

* Fix angular property name in AppPluginConfig

* Fix reference to angularMeta.detected

* Fix hide_angular_deprecation not working for core plugins

* lint
2023-11-10 11:44:54 +01:00
Giuseppe Guerra
46261de32d
Plugins: Fix status_source always being "plugin" in plugin request logs (#77433)
* Plugins: Fix status_source always being "plugin" in plugin logs

* add tests

* Fix TestInstrumentationMiddlewareStatusSource
2023-10-31 13:42:39 +01:00
Gabriel MABILLE
83e9088314
AuthN: Set oauth client grant_types based on plugin state (#77248)
* Disable plugin service account

* Fix bug seen by linoman 💯

Co-authored-by: linoman <2051016+linoman@users.noreply.github.com>

* Account for PR feedback

Co-authored-by: linoman <2051016+linoman@users.noreply.github.com>

* Fix test data

* Enable datasource plugins by default

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

* Update pkg/services/extsvcauth/oauthserver/oasimpl/service.go

* Handle error differently

* Fix service reg

---------

Co-authored-by: linoman <2051016+linoman@users.noreply.github.com>
Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com>
2023-10-27 14:45:04 +02:00
Gabriel MABILLE
25b30aeb6d
Plugin: Enable service account based on plugin settings on init (#77193)
* Disable plugin service account

* Revert extsvc injection

* handle plugin state changes

* Use isProxyEnabled

* Remove plugininteg changes

* Change update function to also work for mysql 😩

* Plugin: enable service account based on plugin settings on
initialization

* Remove misleading comment

* Fix tests

* test message

* Clean up tests

* Simplify tests

* Re-order imports

* Remove unecessary comment

* Enable datasource plugins by default

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

---------

Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com>
2023-10-27 14:27:06 +02:00
Karl Persson
bc9fab6f30
IDForwarding: Update settings name (#77257)
Update settings name
2023-10-27 10:20:49 +02:00