Commit Graph

812 Commits

Author SHA1 Message Date
Andres Martinez Gotor
abb8ba3885
Update comment in service.go (#84674) 2024-03-19 09:09:07 +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
Selene
5c7849417b
Schemas: Replace registry generation and github workflow (#83490)
* Create small registries for core and composable kinds

* Update workflow with new registries

* Fix imports in plugin schemas and deleted old registry generation files

* Remove verification and maturity

* Modify registries and add missing composable information to make schemas in kind-registry work

* Add missing aliases

* Remove unused templates

* Remove kinds verification

* Format generated code

* Add gen header

* Delete unused code and clean path in composable template

* Delete kind-registry loader

* Delete unused code

* Update License link

* Update codeowners path

* Sort imports

* More cleanup

* Remove verify-kinds.yml from codeowners

* Fix lint

* Update composable_kidns

* Fix cue extension

* Restore verify-kinds to avoid to push outdated kind's registry

* Fix composable format

* Restore code owners for verify-kinds

* Remove verify check
2024-03-13 18:05:21 +02:00
Jack Westbrook
6599fa805d
Plugins: Always load decoupled frontend assets from builds (#81873)
* Wip

* Wip

* Adapt to load external module

* build: remove cloudmonitoring from built_in_plugins, clean up webpack output

* chore(plugins): remove decoupled plugins from package.json deps

* chore(codeowners): update file for nx.json

* revert(webpack): put back path in config

* build(frontend): use nx to run prod builds of decoupled plugins with yarn build

* style(prometheus): run prettier-write to fix tsconfig.json

* style(backend): remove unused subFile.isDistDir

* revert(locales): remove formatting changes adding new line at end of files

* chore(webpack): clean up dev output

* build(nx): make grafana an nx project, bump lerna and nx

* build(plugin-configs): move cache directory to node_modules

* style(datasource-plugins): add eslint ignore for .gen.ts files

* chore(codeowners): add frontend-ops as owner of project.json

* build(webpack): add getDecoupledPlugins to automatically ignore when watching

* ci(drone): skip nx cache when building frontend packages

* style(ci): fix missing trailing comma

* Revert "style(ci): fix missing trailing comma"

This reverts commit 7520d41576.

* Revert "ci(drone): skip nx cache when building frontend packages"

This reverts commit 46938883ac.

* feat(zipkin): remove from grafana core bundle

* chore(npm): bump nx package to latest 18.0.8

* docs(dev-guide): add a note about what yarn start now builds

---------

Co-authored-by: Andres Martinez <andres.martinez@grafana.com>
2024-03-13 12:40:09 +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
275ccf994b
Schemas: Reduce duplicated jenny code (#84061)
* Remove jenny_ts_resources and use jenny_ts_types for all cases

* Unify TS generated files into one jenny

* Add missing imports to versioned files

* Update Parca plugin

* Fix loki

* Use LokiQuery

* Fix pyroscope tests

* Fix prettier

* 😒 fix default pyroscope value name

* Set the LokiQuery

* Update Elasticsearch and TestData

* Missed files from testdata

* Order imports
2024-03-11 12:51:44 +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
Dan Cech
7b4925ea37
Storage: Watch support (#82282)
* initial naive implementation

* Update pkg/services/store/entity/sqlstash/sql_storage_server.go

Co-authored-by: Igor Suleymanov <radiohead@users.noreply.github.com>

* tidy up

* add action column, batch watch events

* initial implementation of broadcast-based watcher

* fix up watch init

* remove batching, it just adds needless complexity

* use StreamWatcher

* make broadcaster generic

* add circular buffer to replay recent events to new watchers

* loop within poll until all events are read

* add index on entity_history.resource_version to support poller

* increment r.Since when we send events to consumer

* switch broadcaster and cache to use channels instead of mutexes

* cleanup

---------

Co-authored-by: Igor Suleymanov <radiohead@users.noreply.github.com>
2024-03-05 10:14:38 -05: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
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
Gábor Farkas
57499845c2
envvars: improve tests (#83071)
* envvars: improve tests

* removed commented-out code

Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>

---------

Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
2024-02-20 09:41:11 +02: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
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
Alyssa Bull
77111a0714
Cloud Monitoring: Fix naming and warnings (#82271) 2024-02-09 11:22:44 -07:00
Agnès Toulet
28e66b4ad8
Rendering: Adds PDF support behind feature toggle (#81811)
* start pdf refactor

* Update AppChrome.tsx

* Update AppChrome.tsx

* add encoding param to rendering grpc service

* fix plugin mode

* clean up

* fix backend tests

* fix lint errors

* Support pdf encoding in render http api

---------

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
2024-02-08 13:09:34 +01: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
Diego Augusto Molina
a6e27d1622
Chore: Fix plugins manager process data race in tests (#81914)
* Chore: synchronize writes to pkg.plugins.log.Logs to prevent data races in test code

* Chore: fix data race in tests in plugins process manager

* Chore: improve Logs method naming

* Chore: fix type change
2024-02-06 10:17:37 -03: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
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
Ryan McKinley
e013cd427c
K8s: Add basic query service (#80325) 2024-01-31 20:36:51 +02:00
Alyssa Bull
be6efd9518
Cloud Monitoring: Add standalone files and modify plugin.json (#81596) 2024-01-30 15:52:44 -07:00
Will Browne
3885497553
Plugins: Update renderer plugin source (#80643)
* rework renderer plugin source

* add tests
2024-01-18 11:06:33 +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
Giuseppe Guerra
b40d3e7487
Plugins: Add enablePluginsTracingByDefault feature flag (#80195)
* Add enablePluginsTracingByDefault feature flag

* Enable tracing for all plugins if enablePluginsTracingByDefault is set

* fix docstrings for IsEnabled and IsEnabledGlobally

* fix tests

* do not use separate feature manager

* add test case

* Revert "fix tests"

This reverts commit 46a2420ed1.

* cleanup

* fix plugin tracing disabled if wrong plugin setting is present

* add test case for enabled on plugin with wrong plugin setting but with enablePluginsTracingByDefault feature flag

* Add RequiresRestart = true to enablePluginsTracingByDefault

* re-generate feature flags

* pr review feedback
2024-01-10 13:25:54 +02:00
Ryan McKinley
1caaa56de0
FeatureFlags: Use interface rather than manager (#80000) 2024-01-09 10:38:06 -08:00
Giuseppe Guerra
c045a9f395
Plugins: Fix symlinks inside plugins path not being followed (#80205)
* Plugins: Loader: Fix symlinks not followed when loading external plugins

* Add test case
2024-01-09 14:23:03 +01: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
Giuseppe Guerra
b1c7aa269b
Dependencies: Bump github.com/grafana/grafana-plugin-sdk-go from v0.197.0 to v0.198.0 (#79928)
* chore: Bump google.golang.org/grpc from 1.59.0 to 1.60.1

* Bump google.golang.org/protobuf to v1.32.0

* Fix make protobuf failing with latest protoc and protoc-gen-go

* Re-generate protobuf files

* Re-generate protobuf files

* Bump grafana-plugin-sdk-go

* go mod tidy
2024-01-03 13:36:44 +02:00
Will Browne
6ceab61bf8
Plugins: Support nested plugin signature validation on Windows (#79467)
* rework

* fix

* fix backend start

* fix tests

* fix

* print env

* enable CGO

* undo changes

* undo whitespace change
2023-12-19 11:56:40 +01:00
Will Browne
ef60c90dfa
Plugins: Make file system path handling in tests OS agnostic (#79651)
* make path handling OS agnostic

* PR feedback

* fix input for test case
2023-12-19 11:01:48 +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
Bruno
58678f5879
Plugins: Add option to disable TLS in the socks proxy (#79246)
* Plugins: add option to disable TLS in the socks proxy

* fix allow_insecure docs

* upgrade github.com/grafana/grafana-plugin-sdk-go from v0.196.0 to v0.197.0

* fix conflicts
2023-12-14 12:16:32 -03:00
Andreas Christou
f3cdb44898
Plugins: Include Azure settings as a part of Grafana config sent in plugin requests (#79342)
* Add Azure settings and update tests

* Filter by plugin ID

* Add forward settings config variable

* Update line

* Add tests

* Update so that data sources are fully defined in config

* Update SDK and test

* Fix lint

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

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

* Remove unnecessary if

---------

Co-authored-by: Andrew Hackmann <5140848+bossinc@users.noreply.github.com>
2023-12-14 11:48:22 +00: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
Gabriel MABILLE
5b70130e6c
Plugins: Rename externalServiceAuthentication to iam (#78686)
Plugins: Rename externalServiceAuthentication to iam
2023-12-04 13:14:21 +01:00
Gabriel MABILLE
ef2c79d22a
Chore: use errutil for pluginRepo errors (#78647)
* Chore: use errutil for pluginRepo errors

* Update pkg/util/errutil/status.go

* Use errutil helper functions

Co-Authored-By: Marcus Efraimsson <marcus.efraimsson@gmail.com>

* Forgot the log level

* Use entity

---------

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2023-11-30 15:49:27 +01:00
Andres Martinez Gotor
f8a6380510
Chore: Change endpoint to check versions in cli (#78008) 2023-11-21 12:46:26 +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
Will Browne
ddb7406caa
Plugins: Add running method to interface (#78326)
* add running to interface

* add context
2023-11-17 13:52:31 +01: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
Will Browne
b3ad61e180
Plugins: Add plugin version field to proto interface (#78213)
add plugin version
2023-11-15 16:53:30 +01:00
Ryan McKinley
f69fd3726b
FeatureToggles: Add context and and an explicit global check (#78081) 2023-11-14 12:50:27 -08: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
Andres Martinez Gotor
fcc2f01c7e
Chore: Update otel deps (#78069)
Co-authored-by: Giuseppe Guerra <giuseppe@guerra.in>
Co-authored-by: Giuseppe Guerra <giuseppe.guerra@grafana.com>
2023-11-14 14:14:15 +01:00