Will Browne
a221e1d226
Plugins: Standardize Golang enum naming convention ( #69449 )
...
* standardize enum pattern
* fix up
2023-06-08 12:21:19 +02:00
Will Browne
1fd4953833
Plugins: Optimize creation of Golang errors and slices ( #69448 )
...
* tidy up
* fix tests
2023-06-07 17:22:43 +02:00
Giuseppe Guerra
f148b5fb28
Plugins: Forbid loading Angular plugins when Angular is disabled ( #69679 )
...
* Plugins: Forbid loading Angular plugins when Angular is disabled
* Plugins: Made angulardetector a service, add tests for angular loader cases
* Fix missing import
* Add nolint:gocyclo to loadPlugins
2023-06-07 11:08:01 +02:00
Ryan McKinley
e17ef5e504
Pyroscope: Rename phlare to grafana-pyroscope-datasource ( #68859 )
2023-06-07 06:09:29 +03:00
Giuseppe Guerra
7a132680ef
Revert "Plugins: Forbid loading Angular plugins when Angular is disabled ( #69225 )" ( #69657 )
...
This reverts commit ff34279ff4 .
2023-06-06 18:09:41 +02:00
Giuseppe Guerra
ff34279ff4
Plugins: Forbid loading Angular plugins when Angular is disabled ( #69225 )
...
* Plugins: Forbid loading Angular plugins when Angular is disabled
* Plugins: Made angulardetector a service, add tests for angular loader cases
* Fix missing import
2023-06-06 17:14:31 +02:00
Marcus Efraimsson
dcc1169ab2
Chore: Remove unused code/dependencies in testdata datasource ( #69386 )
2023-06-05 11:34:02 +02:00
Ryan McKinley
422684d8b0
Plugins: Support changing plugin IDs (hardcoded) ( #67867 )
2023-06-02 10:46:12 -07:00
Will Browne
12dc56ad0c
Plugins: Refactor plugin repository API ( #69063 )
...
* support grafana wildcard version
* undo go.mod changes
* tidy
* flesh out tests
* refactor
* add tests
* tidy naming
* undo some changes
* split interfaces
* separation
* update new signature
* simplify
* update var namings
* unexport types
* introduce opts pattern
* reorder test
* fix compat checks
* middle ground
* unexport client
* move back
* fix tests
* inline logger
* make client usable
* use fake logger
* tidy errors
* remove unused types
* fix test
* review fixes
* rework compatibility
* adjust installer
* fix tests
* opts => cfg
* remove unused var
* fix var name
2023-05-30 11:48:52 +02:00
Will Browne
ae373c662c
Plugins: Refactor env vars to dedicated service ( #68960 )
...
* add env vars service
* fix tests
* fix more tests
2023-05-24 14:02:14 +02:00
sam boyer
323cbe1997
kindsys: Adapt to new flattened lineage syntax in Thema ( #68034 )
...
* Update all core kinds to flattened lineages
* Regen Go types, without any
* Regen Go types, s/interface{}/any/
* Update generated core typescript
* Update generate docs
* Fix defaults gen in veneer index jenny
* Flatten plugindef lineage
* Convert all plugin kinds to flattened form
* Switch back to interface{} for now
* Switch to fs.Sub in plugin DeclParser
* Mostly undesirable codegen changes, to be fixed
* Update mod and sum
* Update pfs tests to flattened lineages
* Update thema to latest, regen docs
2023-05-24 10:47:25 +02:00
Andreas Christou
108acee08e
CloudMonitoring: Initial GCM Schema ( #67739 )
...
* Initial GCM schema work
- Split types for convenience
- Update conditionals where needed
- Update type references
* Add additional supporting types
* Add some more accessory and legacy types
* Add missing type
* Rename backend folder
* Add missing generated file
* Review
2023-05-22 17:19:54 +01:00
Andres Martinez Gotor
b7ca2d89b1
Chore: Update ProtonMail/go-crypto ( #68641 )
2023-05-18 09:52:31 +02:00
Nathan Marrs
8390fcc80f
Chore: Remove alpha icon panel ( #68573 )
2023-05-16 10:32:25 -07:00
sam boyer
33fd83f7e3
kindsys: Adapt to new PanelCfg schema interface ( #65297 )
...
* kindsys: Adapt to new PanelCfg schema interface
* building locally
* Remove Panel prefix in cue files
* Regenerate
* Update imports
* fixup! Merge branch 'remove-panel-prefix' into sdboyer/redundant-panelcfg-prefixes
* Fix formatting
---------
Co-authored-by: Ryan McKinley <ryantxu@gmail.com >
Co-authored-by: Tania B <yalyna.ts@gmail.com >
2023-05-15 23:07:54 -04:00
Giuseppe Guerra
16359c82a2
Plugins: Angular deprecation: Detect Angular plugins and expose in API ( #66824 )
...
* Plugins: Angular deprecation: Detect Angular plugins and expose in API
* Plugins: Angular detector: Close module.js
* Plugins: Angular detector: consistent error messages
* Plugins: Angular detector: Add test for missing module.js
* Plugins: Angular detector: Fix integration tests
* Plugins: Angular detector: Changed Angular detection patterns
* Moved inMemoryFS to test_utils.go
* Add different angular detectors
* Plugins: Update plugins/data/expectedListResp.json
* Plugins: Rename angular property to angularDetected
* Plugins: Rename angular to angularDetected in Plugin and PluginDTO
* Plugins: Add angularDetected to datasources, apps and plugins frontendsettings
* Plugins: Add test for AngularDetected frontend settings
2023-05-12 12:51:11 +02:00
Andrej Ocenas
8da90f624d
Pyroscope: Add authentication when calling backendType resource API ( #67667 )
2023-05-11 16:07:49 +02:00
Will Browne
e0e2535c96
Plugins: Tidy up CLI code ( #67813 )
...
* more tidying
* move some things around
* more tidying
* fix linter
2023-05-08 10:58:47 +02:00
Andres Martinez Gotor
ea7e5e2d82
Chore: Improve error message in case of a revoked key ( #67413 )
2023-04-28 14:28:00 +02:00
Andres Martinez Gotor
aa9838bd25
Chore: Refactor manifest verifier ( #67218 )
2023-04-27 17:54:28 +02:00
Giuseppe Guerra
bfe1b68800
Plugins: Fs: Add option to access unallowed files in dev mode ( #66492 )
...
* Plugins: Fs: Add option to access unallowed files in dev mode
* Plugins: Fs: allow accessing unallowed files only when in dev mode
* Plugins: Fs: Add ProvideLocalFinder
* Plugins: FS: Pass whole config in NewLocalFinder()
* Plugins: FS: Add AllowListLocalFS
* Plugins: FS: Fix some tests
* Plugins: FS: Update tests
* Plugins: FS: Removed dead code
* Plugins: FS: Add tests for AllowListFS
* Plugins: FS: Update comments
* Plugins: FS: Use variadic arguments for allow list rather than map
* Plugins: FS: Remove unnecessary log
* Plugins: FS: Do not escape plugin root dir
* Fix merge conflict
* Plugins: FS: Update comments
* Plugins: FS: PR review changes
* Fix merge conflict
* Fix tests
* Cleanup
* Fix flaky test
* Changes from PR review
* Lint
* Add comment to LocalFS.Remove
* Fix Windows
* Renamed devMode to production
2023-04-27 10:26:15 +02:00
Marcus Efraimsson
73920b1e34
Plugins: Refactor cleaning of call resource response headers ( #67145 )
...
First part of #66889 moving cleaning of call resource response headers
within plugin management client.
2023-04-25 19:44:32 +02:00
Andres Martinez Gotor
9d7c3a101d
Chore: Use KVStore for the manifest public key ( #66839 )
2023-04-25 13:01:49 +02:00
Victor Marin
efd0e9cbea
Datagrid Panel: Edit data within your dashboards ( #66353 )
...
* wip
* Datagrid WIP: snapshotting when data edited, better UI for adding column/rows, refactors
* wip
* WIP
* wip
* Add series selector
* Delete selection on key press
* wip
* Multiple row select and delete
* wip
* draggable rows/columns, better column width calculator
* bug fixes
* scrollbars
* add feature flag
* bugfixes
* bugfixes
* bugfixes
* bugfixes
* Add possibility to rename column
* Input fixes
* bugfixes
* bugfixes
* performance optimisations
* WIP component refactoring and optimisations
* comment bit of code to remove error for testing
* fix column move and payload types
* WIP refactors and tests
* e2e tests
* queryGroup subscription refactor
* queryGroup - add component on update, fix failing tests
* refactor querygroup
* querygroup refactor
* tests
* fix codeowners validation
* lint fixes
* revert convertFieldType modification in favor of already merged mod + re-add mistakenly deleted line
* remove //ts-ignores
* Minor style tweaks
* fix
* align colors with theme
* fixes
* refactor
* add test for convertFieldType transformer and write todo
---------
Co-authored-by: Torkel Ödegaard <torkel@grafana.com >
2023-04-24 17:46:31 +03:00
Michael Mandrus
a29cfe5d46
Caching: Consolidate resource cache checking and updating in plugin middleware ( #67002 )
...
* Update the HandleResourceRequest function to mimic the HandleQueryRequest function
* Remove CacheResourceResponse function from interface
* revert additional thing I missed
2023-04-21 13:03:49 -04:00
Will Browne
739c7f1c68
Plugins: Simplify plugin file removal ( #66115 )
...
* make explicit class check when attempting to remove plugin
* simplify plugin file tracking
* fix test
* apply feedback
* fix linter
2023-04-20 11:52:59 +02:00
Andres Martinez Gotor
98c695c68f
Chore: Use Grafana API to retrieve the public key to validate plugins ( #66439 )
2023-04-18 16:12:05 +02:00
Giuseppe Guerra
1c3ad81826
Plugins: Fix module.js file not being closed when loading plugins ( #66288 )
...
* Plugins: Loader: Fix module.js file not being closed
* Plugins: LocalFS: Add comments, ensure same Read() behaviour as os.File's
* Changed comment for Close()
* Add tests for LocalFS
* "Fix" linter error
* "Fix" linter error again
2023-04-13 10:48:15 +02:00
Michael Mandrus
5626461b3c
Caching: Refactor enterprise query caching middleware to a wire service ( #65616 )
...
* define initial service and add to wire
* update caching service interface
* add skipQueryCache header handler and update metrics query function to use it
* add caching service as a dependency to query service
* working caching impl
* propagate cache status to frontend in response
* beginning of improvements suggested by Lean - separate caching logic from query logic.
* more changes to simplify query function
* Decided to revert renaming of function
* Remove error status from cache request
* add extra documentation
* Move query caching duration metric to query package
* add a little bit of documentation
* wip: convert resource caching
* Change return type of query service QueryData to a QueryDataResponse with Headers
* update codeowners
* change X-Cache value to const
* use resource caching in endpoint handlers
* write resource headers to response even if it's not a cache hit
* fix panic caused by lack of nil check
* update unit test
* remove NONE header - shouldn't show up in OSS
* Convert everything to use the plugin middleware
* revert a few more things
* clean up unused vars
* start reverting resource caching, start to implement in plugin middleware
* revert more, fix typo
* Update caching interfaces - resource caching now has a separate cache method
* continue wiring up new resource caching conventions - still in progress
* add more safety to implementation
* remove some unused objects
* remove some code that I left in by accident
* add some comments, fix codeowners, fix duplicate registration
* fix source of panic in resource middleware
* Update client decorator test to provide an empty response object
* create tests for caching middleware
* fix unit test
* Update pkg/services/caching/service.go
Co-authored-by: Arati R. <33031346+suntala@users.noreply.github.com >
* improve error message in error log
* quick docs update
* Remove use of mockery. Update return signature to return an explicit hit/miss bool
* create unit test for empty request context
* rename caching metrics to make it clear they pertain to caching
* Update pkg/services/pluginsintegration/clientmiddleware/caching_middleware.go
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com >
* Add clarifying comments to cache skip middleware func
* Add comment pointing to the resource cache update call
* fix unit tests (missing dependency)
* try to fix mystery syntax error
* fix a panic
* Caching: Introduce feature toggle to caching service refactor (#66323 )
* introduce new feature toggle
* hide calls to new service behind a feature flag
* remove licensing flag from toggle (misunderstood what it was for)
* fix unit tests
* rerun toggle gen
---------
Co-authored-by: Arati R. <33031346+suntala@users.noreply.github.com >
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com >
2023-04-12 12:30:33 -04:00
Andres Martinez Gotor
52f39e6fa0
Chore: Soft failure in plugin initialization ( #66210 )
2023-04-12 12:34:16 +03:00
Andres Martinez Gotor
48de17945f
Chore: Use maintained crypto library ( #66304 )
2023-04-12 11:18:38 +02:00
ismail simsek
a1bc227228
Instrumentation: Report the size of plugin request ( #66149 )
...
* Report the size of the plugin request
* Remove middleware, report directly
* PR review updates
2023-04-11 22:04:32 +02:00
Giuseppe Guerra
facd4eca7e
Plugins: Fix plugin signature calculation not working on Windows ( #66273 )
...
* Plugins: Fix plugin signature calculation not working on Windows
* Plugins: Added test for NTFS path separators in signature verification
* Use filepath.ToSlash and replace its implementation in tests
* Fix typo
2023-04-11 17:15:34 +02:00
Giuseppe Guerra
652c6dbd22
Plugins: Refactoring: Move plugins tracing env vars to separate func ( #66170 )
2023-04-07 17:11:47 +02:00
Stephanie Hingtgen
536fad5b61
Plugins: add env variables needed for the secure socks proxy in the plugins sdk ( #65878 )
2023-04-07 08:20:25 -06:00
Will Browne
7808e74260
Plugins: Skip instrumenting plugin build info for core and bundled plugins ( #66105 )
...
* only instrument plugin build for non core/bundled plugins
* fix import
2023-04-06 12:50:50 +02:00
Will Browne
bff9f4c890
Plugins: Move config factory to pluginsintegration package ( #65716 )
...
* move config to pluginsintegration package
* change to all plugin toggle
* fixes
* fixes
* fix lerna
* fix test
2023-04-05 14:40:08 +02:00
Ryan McKinley
d974e5f25a
TrendPanel: Add new trend panel (Alpha) ( #65740 )
2023-04-04 20:52:20 -07:00
Giuseppe Guerra
f1eddbad06
Plugins: Tracing: Add test for composite propagation ( #65917 )
2023-04-04 23:16:57 +02:00
Will Browne
819c2f4ad8
Plugins: Remove unnecessary CDN code ( #65929 )
...
remove unnecessary code
2023-04-04 17:01:49 +02:00
Giuseppe Guerra
2647b2e0f9
Plugins: Tracing: Disable distributed tracing for plugins by default ( #65796 )
...
* Plugins: Tracing: Disable tracing by default, pass GF_VERSION only if tracing is enabled
* Plugins: Tracing: Fix GF_PLUGIN_VERSION instead of GF_VERSION
2023-04-03 12:48:24 +02:00
Giuseppe Guerra
09078b14e1
Plugins: Support for distributed tracing in backend plugins SDK ( #63714 )
...
* Tracing: Pass OTLP address and propagation format to plugins
* Fix unit tests
* Fix indentation
* Fix plugin manager integration tests
* Goimports
* Pass plugin version to plugins
* Do not add GF_PLUGIN_VERSION if plugin version is not set, add tests
* Allow disabling plugins distributed tracing on a per-plugin basis
* Moved disabled plugins to tracing.opentelemetry config section
* Pre-allocate DisabledPlugins map to the correct size
* Moved disable tracing setting flags in plugin settings
* Renamed plugin env vars for tracing endpoint and propagation
* Fix plugin initializer tests
* Refactoring: Moved OpentelemetryCfg from pkg/infra to pkg/plugins
* Changed GetSection to Section in parseSettingsOpentelemetry
* Add tests for NewOpentelemetryCfg
* Fix test case names in TestNewOpentelemetryCfg
* OpenTelemetry: Remove redundant error checks
2023-03-30 23:31:14 +02:00
Will Browne
7bbe255150
Plugins: Add file store abstraction for handling plugin files ( #65432 )
...
* add file store
* fix markdown fetch bug
* add markdown tests
* fix var name
2023-03-29 12:55:55 +02:00
Giuseppe Guerra
a89202eab2
Plugins: Improve instrumentation by adding metrics and tracing ( #61035 )
...
* WIP: Plugins tracing
* Trace ID middleware
* Add prometheus metrics and tracing to plugins updater
* Add TODOs
* Add instrumented http client
* Add tracing to grafana update checker
* Goimports
* Moved plugins tracing to middleware
* goimports, fix tests
* Removed X-Trace-Id header
* Fix comment in NewTracingHeaderMiddleware
* Add metrics to instrumented http client
* Add instrumented http client options
* Removed unused function
* Switch to contextual logger
* Refactoring, fix tests
* Moved InstrumentedHTTPClient and PrometheusMetrics to their own package
* Tracing middleware: handle errors
* Report span status codes when recording errors
* Add tests for tracing middleware
* Moved fakeSpan and fakeTracer to pkg/infra/tracing
* Add TestHTTPClientTracing
* Lint
* Changes after PR review
* Tests: Made "ended" in FakeSpan private, allow calling End only once
* Testing: panic in FakeSpan if span already ended
* Refactoring: Simplify Grafana updater checks
* Refactoring: Simplify plugins updater error checks and logs
* Fix wrong call to checkForUpdates -> instrumentedCheckForUpdates
* Tests: Fix wrong call to checkForUpdates -> instrumentedCheckForUpdates
* Log update checks duration, use Info log level for check succeeded logs
* Add plugin context span attributes in tracing_middleware
* Refactor prometheus metrics as httpclient middleware
* Fix call to ProvidePluginsService in plugins_test.go
* Propagate context to update checker outgoing http requests
* Plugin client tracing middleware: Removed operation name in status
* Fix tests
* Goimports tracing_middleware.go
* Goimports
* Fix imports
* Changed span name to plugins client middleware
* Add span name assertion in TestTracingMiddleware
* Removed Prometheus metrics middleware from grafana and plugins updatechecker
* Add span attributes for ds name, type, uid, panel and dashboard ids
* Fix http header reading in tracing middlewares
* Use contexthandler.FromContext, add X-Query-Group-Id
* Add test for RunStream
* Fix imports
* Changes from PR review
* TestTracingMiddleware: Changed assert to require for didPanic assertion
* Lint
* Fix imports
2023-03-28 11:01:06 +02:00
Will Browne
1387fec51d
Plugins: Markdown fetch retry with lowercase ( #65384 )
...
* retry with lowercase
* undo incorrect err check
* re-add defer to close file
* fix test
2023-03-27 19:44:06 +03:00
Will Browne
31d6416157
Plugins: Migrate licensing and access control to pkg/services/pluginsintegration package ( #65258 )
...
* migrate licensing + access control
* update package name
2023-03-27 11:15:37 +02:00
Artur Wierzbicki
4274b9414f
Chore: remove querylibrary feature toggle ( #65021 )
...
* chore: remove querylibrary
* chore: remove querylibrary
* chore: remove querylibrary
2023-03-20 20:00:14 +04:00
Will Browne
ee2dd62a1f
Plugins: Refactor loader + finder to support multiple sourcing methods ( #64735 )
...
* it's cdn time
* tidy body closing
* auto signed
* fix close
* update log name
* remove comments
2023-03-20 14:35:49 +01:00
lean.dev
0b0140b761
Licensing: Send the app url to plugin ( #64258 )
2023-03-08 14:44:04 -03:00
Will Browne
68df83c86d
Plugins: Add Plugin FS abstraction ( #63734 )
...
* unexport pluginDir from dto
* first pass
* tidy
* naming + add mutex
* add dupe checking
* fix func typo
* interface + move logic from renderer
* remote finder
* remote signing
* fix tests
* tidy up
* tidy markdown logic
* split changes
* fix tests
* slim interface down
* fix status code
* tidy exec path func
* fixup
* undo changes
* remove unused func
* remove unused func
* fix goimports
* fetch remotely
* simultaneous support
* fix linter
* use var
* add exception for gosec warning
* fixup
* fix tests
* tidy
* rework cfg pattern
* simplify
* PR feedback
* fix dupe field
* remove g304 nolint
* apply PR feedback
* remove unnecessary gosec nolint
* fix finder loop and update comment
* fix map alloc
* fix test
* remove commented code
2023-03-07 16:47:02 +01:00