819c2f4ad8
Plugins: Remove unnecessary CDN code ( #65929 )
...
remove unnecessary code
2023-04-04 17:01:49 +02:00
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
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
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
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
94f39e69a3
Plugins: Migrate plugincontext
, adapters
and pluginsettings
to pkg/services/pluginsintegration package ( #64154 )
...
* migrate plugincontext, adapter and pluginsettings
* add to CODEOWNERS
* fix imports
* fix CODEOWNERS
* take pluginsettings
* migrate wire stuff
2023-03-07 11:22:30 -05:00
ab8de1a0e3
Plugins: Add simple plugin sources service ( #63814 )
...
add simple plugin sources svc
2023-02-28 15:27:11 +01:00
324310abbc
Chore: Fix goimports grouping in pkg/api ( #62419 )
...
* fix goimports
* fix goimports order
2023-01-30 08:18:26 +00:00
af1e2d68da
Plugins: Allow loading panel plugins from a CDN ( #59096 )
...
* POC: Plugins CDN reverse proxy
* CDN proxy POC: changed env var names
* Add authorization: false for /public path in frontend plugin loader
* Moved CDN settings to Cfg, add some comments
* Fix error 500 in asset fetch if plugin is not using CDN
* Fix EnterpriseLicensePath declared twice
* Fix linter complaining about whitespaces
* Plugins CDN: Skip signature verification for CDN plugins
* Plugins CDN: Skip manifest and signature check for cdn plugins
* Plugins: use IsValid() and IsInternal() rather than equality checks
* Plugins CDN: remove comment
* Plugins CDN: Fix seeker can't seek when serving plugins from local fs
* Plugins CDN: add back error codes in getLocalPluginAssets
* Plugins CDN: call asset.Close() rather than asset.readSeekCloser.Close()
* Plugins CDN: Fix panic in JsonApiErr when errorMessageCoder wraps a nil error
* Plugins CDN: Add error handling to proxyCDNPluginAsset
* Plugins CDN: replace errorMessageCoder with errutil
* Plugins CDN POC: expose cdn plugin paths to frontend for system.js
* Plugins CDN: Fix cdn plugins showing as unsigned in frontend
* WIP: Add support for formatted URL
* Fix missing cdnPluginsBaseURLs in GrafanaConfig
* Plugins CDN: Remove reverse proxy mode and reverse proxy references
* Plugins CDN: Simplify asset serving logic
* Plugins CDN: sanitize redirect path
* Plugins CDN: Removed unused pluginAsset type
* Plugins CDN: Removed system.js changes
* Plugins CDN: Return different system.js baseURL and module for cdn plugins
* Plugins CDN: Ensure CDN is disabled for non-external plugins
* lint
* Plugins CDN: serve images and screenshots from CDN, refactoring
* Lint
* Plugins CDN: Fix URLs for system.js (baseUrl and module)
* Plugins CDN: Add more tests for RelativeURLForSystemJS
* Plugins CDN: Iterate only on apps when preloading
* Plugins CDN: Refactoring
* Plugins CDN: Add comments to url_constructor.go
* Plugins CDN: Update defaultHGPluginsCDNBaseURL
* Plugins CDN: undo extract meta from system js config
* refactor(plugins): migrate systemjs css plugin to typescript
* feat(plugins): introduce systemjs cdn loader plugin
* feat(plugins): add systemjs load type
* Plugins CDN: Removed RelativeURLForSystemJS
* Plugins CDN: Log backend redirect hits along with plugin info
* Plugins CDN: Add pluginsCDNBasePath to getFrontendSettingsMap
* feat(plugins): introduce cdn loading for angular plugins
* refactor(plugins): move systemjs cache buster into systemjsplugins directory
* Plugins CDN: Rename pluginsCDNBasePath to pluginsCDNBaseURL
* refactor(plugins): introduce pluginsCDNBaseURL to the frontend
* Plugins CDN: Renamed "cdn base path" to "cdn url template" in backend
* Plugins CDN: lint
* merge with main
* Instrumentation: Add prometheus counter for backend hits, log from Info to Warn
* Config: Changed key from plugins_cdn.url to plugins.plugins_cdn_base_url
* CDN: Add backend tests
* Lint: goimports
* Default CDN URL to empty string,
* Do not use CDN in setImages and module if the url template is empty
* CDN: Backend: Add test for frontend settings
* CDN: Do not log missing module.js warn if plugin is being loaded from CDN
* CDN: Add backend test for CDN plugin loader
* Removed 'cdn' signature level, switch to 'valid'
* Fix pfs.TestParseTreeTestdata for cdn plugin testdata dir
* Fix TestLoader_Load
* Fix gocyclo complexity of loadPlugins
* Plugins CDN: Moved prometheus metric to api package, removed asset_path label
* Fix missing in config
* Changes after review
* Add pluginscdn.Service
* Fix tests
* Refactoring
* Moved all remaining CDN checks inside pluginscdn.Service
* CDN url constructor: Renamed stringURLFor to stringPath
* CDN: Moved asset URL functionality to assetpath service
* CDN: Renamed HasCDN() to IsEnabled()
* CDN: Replace assert with require
* CDN: Changes after review
* Assetpath: Handle url.Parse error
* Fix plugin_resource_test
* CDN: Change fallback redirect from 302 to 307
* goimports
* Fix tests
* Switch to contextmodel.ReqContext in plugins.go
Co-authored-by: Will Browne <will.browne@grafana.com>
Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
2023-01-27 15:08:17 +01:00
eb1fed7929
Plugins: Add plugin resource tests ( #62014 )
...
* remove plugin context from response
* remove integration test indicator
2023-01-25 10:45:52 +00:00