Commit Graph

371 Commits

Author SHA1 Message Date
Carl Bergquist
ba7aca69f6
plugin: add signature status plugin build info (#35128)
Signed-off-by: bergquist <carl.bergquist@gmail.com>
2021-06-02 20:53:56 +02:00
Ryan McKinley
4972e0f6a1
Rename: Status grid to history (#34864) 2021-05-29 20:24:14 +02:00
Alexander Emelin
063e1b5ff5
Live: use latest changes in Go SDK to deal with streaming frames (#34668) 2021-05-25 10:29:02 -07:00
Erik Sundell
92ac2c40d3
expose azure settings as env variables (#34484) 2021-05-25 13:40:05 +02:00
Hugo Häggmark
7b17801047
LibraryPanels: Fixes error when importing plugin dashboard (#34557) 2021-05-24 09:31:34 +02:00
Will Browne
c4dcfdef56
Plugins: Improve plugin installer error messages (#34437)
* fix and improve error messages

* enrich error message

* ignore previous changes

* revert manual version bump

* remove condition

* fix version param
2021-05-20 15:11:07 +02:00
Ryan McKinley
a91edd7267
Plugin Admin App: make the catalog look like internal component (#34341)
* Allow Route component usage in app plugins

* i tried

* fix catalog app

* fix catalog app

* fix catalog app

* cleanup imports

* plugin catalog enabled to plugin admin

* rename plugin catalog to plugin admin

* expose catalog url

* update text

* import from react-router-dom

* fix imports -- add logging

* merge changes

* avoid onNavUpdate

* Fixed onNavChange issues

* fix library imports

* more links

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
2021-05-20 10:42:26 +02:00
Will Browne
c1ec13035d
Plugins: Enforce signing for all plugins (#34364)
* enforce non-backend plugin signing

* fix tests

* add tests

* add signatures

* apply PR feedback

* update upgrading docs
2021-05-19 15:42:50 +02:00
Will Browne
4e31169a43
Plugins: Catalog force enable via config and remove enterprise plugin options (#34358)
* force enable catalog based on backend config

* update comments

* chore(plugin-catalog): remove config page in favour of backend flag

* docs(plugin-catalog): update readme

Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
2021-05-19 10:22:31 +02:00
idafurjes
1e8e7e34f1
Plugins: Remove support for deprecated backend plugin protocol version (#34127)
* 33959: Remove support for deprecated backend plugin protocol (v1)

* 33959: Remove unused methods

* 33959: Remove some additional unused code

* 33959: Remove some additional unused code

* 33959: Remove datasource plugin wrapper with test

* 33959:Remove DefaultProtocolVersion
2021-05-19 08:57:48 +02:00
Alexander Emelin
e799257637
Live: stream resubmit on ds change, fix old ds settings in RunStream (#34130) 2021-05-18 21:39:56 +03:00
Ryan McKinley
de5cd4a7d3
Timeline: split "periodic" mode into its own panel (#34171) 2021-05-17 13:00:04 -07:00
Ryan McKinley
edcefe1c8e
Chore: Rename "marketplace" app to "catalog" (#34149) 2021-05-17 08:27:56 -07:00
Jack Westbrook
abdceb18da
Plugins: introduce marketplace app (#33869)
* add uninstall flow

* add install flow

* small cleanup

* smaller-footprint solution

* cleanup + make bp start auto

* fix interface contract

* improve naming

* accept version arg

* ensure use of shared logger

* make installer a field

* add plugin decommissioning

* add basic error checking

* fix api docs

* making initialization idempotent

* add mutex

* fix comment

* fix test

* add test for decommission

* improve existing test

* add more test coverage

* more tests

* change test func to use read lock

* refactoring + adding test asserts

* improve purging old install flow

* improve dupe checking

* change log name

* skip over dupe scanned

* make test assertion more flexible

* remove trailing line

* fix pointer receiver name

* update comment

* add context to API

* add config flag

* add base http api test + fix update functionality

* simplify existing check

* clean up test

* refactor tests based on feedback

* add single quotes to errs

* use gcmp in tests + fix logo issue

* make plugin list testing more flexible

* address feedback

* fix API test

* fix linter

* undo preallocate

* Update docs/sources/administration/configuration.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Update docs/sources/administration/configuration.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Update docs/sources/administration/configuration.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* fix linting issue in test

* add docs placeholder

* update install notes

* Update docs/sources/plugins/marketplace.md

Co-authored-by: Marcus Olsson <marcus.olsson@hey.com>

* update access wording

* add more placeholder docs

* add link to more info

* PR feedback - improved errors, refactor, lock fix

* improve err details

* propagate plugin version errors

* don't autostart renderer

* add H1

* fix imports

* feat(bundled-plugins): introduce marketplace-app to the repo

* chore(marketplace-app): remove backend

* feat(marketplace): nav is only visible to admins

* feat(marketplace): use gnet api

* refactor(marketplace): move styles to theme2 move card concerns to card component

* feat(marketplace): introduce loaders, clean up styles

* refactor(marketplace): wip - debugging for api endpoints

* feat(grafana-ui): introduce height prop to Layout components

* refactor(marketplace): clean up org details component

* fix(marketplace): display search results without active filters

* refactor(marketplace): use grafana api for install/uninstall

* refactor(marketplace): remove pluginDir

* feat(marketplace): clean up Library page

* fix(plugins): get panel plugins from meta for newly installed plugins

* fix(marketplace): fix multiple renders of InstallControls when installing/uninstalling plugins

* refactor(marketplace): componentise the loader

* chore(marketplace): remove unsigned plugins option

* refactor(marketplace): remove includeUnsigned from codebase

* refactor(marketplace): prefer useStyles over useTheme

* docs(marketplace): remove changelog and update readme

* Apply suggestions from code review

Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>

* refactor(marketplace): prefer module over class for api

* refactor(marketplace): move updatePlugin to api

* refactor(marketplace): add PluginMeta to api to please TS

* feat(marketplace): always include pre-release in semver check

* chore(marketplace): remove redundant arch install code. backend handles it now

* feat(marketplace): add a link to browse page if library is empty

* refactor(marketplace): replace status with isLoading boolean for hooks

* refactor(marketplace): clean up async functions in InstallControls

* fix(marketplace): setInstalled false on successful uninstall

* include marketplace in bundled plugin test

Co-authored-by: Will Browne <will.browne@grafana.com>
Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
Co-authored-by: Marcus Olsson <marcus.olsson@hey.com>
Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2021-05-12 21:07:37 +02:00
Will Browne
c39d6ad97d
Plugins: Enable plugin runtime install/uninstall capabilities (#33836)
* add uninstall flow

* add install flow

* small cleanup

* smaller-footprint solution

* cleanup + make bp start auto

* fix interface contract

* improve naming

* accept version arg

* ensure use of shared logger

* make installer a field

* add plugin decommissioning

* add basic error checking

* fix api docs

* making initialization idempotent

* add mutex

* fix comment

* fix test

* add test for decommission

* improve existing test

* add more test coverage

* more tests

* change test func to use read lock

* refactoring + adding test asserts

* improve purging old install flow

* improve dupe checking

* change log name

* skip over dupe scanned

* make test assertion more flexible

* remove trailing line

* fix pointer receiver name

* update comment

* add context to API

* add config flag

* add base http api test + fix update functionality

* simplify existing check

* clean up test

* refactor tests based on feedback

* add single quotes to errs

* use gcmp in tests + fix logo issue

* make plugin list testing more flexible

* address feedback

* fix API test

* fix linter

* undo preallocate

* Update docs/sources/administration/configuration.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Update docs/sources/administration/configuration.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Update docs/sources/administration/configuration.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* fix linting issue in test

* add docs placeholder

* update install notes

* Update docs/sources/plugins/marketplace.md

Co-authored-by: Marcus Olsson <marcus.olsson@hey.com>

* update access wording

* add more placeholder docs

* add link to more info

* PR feedback - improved errors, refactor, lock fix

* improve err details

* propagate plugin version errors

* don't autostart renderer

* add H1

* fix imports

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
Co-authored-by: Marcus Olsson <marcus.olsson@hey.com>
2021-05-12 20:05:16 +02:00
Agnès Toulet
ec71919e7b
Rendering: add CSV support (#33729)
* Rendering: add CSV rendering support

* Rendering: save csv files into a separate folder

* add missing field

* Renderer: get filename from renderer plugin

* apply PR suggestions

* Rendering: remove old PhantomJS error

* Rendering: separate RenderCSV and Render functions

* fix alerting test

* Rendering: fix handling error in HTTP mode

* apply PR feedback

* Update pkg/services/rendering/http_mode.go

Co-authored-by: Joan López de la Franca Beltran <joanjan14@gmail.com>

* apply PR feedback

* Update rendering metrics with type label

* Rendering: return error if not able to parse header

* Rendering: update grpc generated file

* Rendering: use context.WithTimeout to render CSV too

Co-authored-by: Joan López de la Franca Beltran <joanjan14@gmail.com>
2021-05-12 17:16:57 +02:00
Will Browne
5c13820bba
Ensure http client has no timeout (#33856) 2021-05-10 16:59:33 +02:00
Sergey Kostrukov
1790737cf1
Plugins: AuthType in route configuration and params interpolation (#33674)
* AuthType in route configuration

* Pass interpolated auth parameters to token provider

* Unit tests

* Update after review

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>

Fixes #33669
Closed #33732
2021-05-06 22:05:23 +02:00
Arve Knudsen
c2c1ec7d0f
Chore: Move from master to main branch (#33693)
* Chore: Move from master branch to main

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* CI: Upgrade build pipeline tool to v2

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-05-06 16:29:29 +02:00
Torkel Ödegaard
578283078b
PanelEdit: Improves viz picker ux, auto close on click (#33633)
* PanelEdit: Improves viz picker ux, auto close on click

* Fixing strict ts error

* Updated e2e
2021-05-03 16:49:09 +02:00
Will Browne
8e6205c107
Plugins: Move plugin installing + uninstalling logic from CLI to plugins package (#33274)
* move guts from cli to server

* renaming + refactoring

* add pluginsDir arg

* arg fixes

* add support for repo URL override

* add funcs to interface

* use pluginID consistently

* swap args

* pass mandatory grafanaVersion field

* introduce logger interface

* create central logger for CLI

* add infra log wrapper

* re-add log initer step

* remove unused logger

* add checks for uninstalling

* improve debug blue

* make sure to close file

* fix linter issues

* remove space

* improve newline usage

* refactor packaging

* improve logger API

* fix interface func names

* close file and reformat zipslip catch

* handle G305 linter warning

* add helpful debug log
2021-04-26 16:13:40 +02:00
Ryan McKinley
7627b55ef4
TSDB: add deprecation comments to many tsdb structs (#33281) 2021-04-23 03:03:11 +02:00
Alexander Emelin
93292f6eef
Live: update Streaming plugin definitions, put frame schema in subscribe result data (#32561)
Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-04-02 19:41:45 +03:00
Dimitris Sotirakis
d42bfedd9e
Add ability to override config variables with env variables (#32554)
* Add ability to override config variables with env variables

* Inline checkForOverrides

* Update pkg/plugins/backendplugin/manager/plugin_settings.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-03-31 18:51:16 +02:00
Ryan McKinley
1446d094b8
API: return query results as JSON rather than base64 encoded Arrow (#32303) 2021-03-31 08:35:03 -07:00
Marcus Efraimsson
aad43869c3
Plugins: Support set body content in plugin routes (#32551)
Adds support for overriding the body and length in plugin routes.
2021-03-31 16:38:35 +02:00
Will Browne
1d7f155c92
remove unnecessary state (#32278) 2021-03-29 14:22:56 +02:00
Alexander Emelin
336bc559a3
Basic streaming plugin support (#31940)
This pull request migrates testdata to coreplugin streaming capabilities,
this is mostly a working concept of streaming plugins at the moment, 
the work will continue in the following pull requests.
2021-03-23 20:24:08 +03:00
Arve Knudsen
ed9b623b37
Chore: Recompile protobuf (#32232)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-03-23 09:47:52 +01:00
Arve Knudsen
d3544d6df1
PluginManager: Increase DI priority (#32111)
* PluginManager: Increase DI priority

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* BackendPluginManager: Don't rely on Init

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* BackendPluginManager: Fix tests

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Simplify code

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Remove stale field

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Simplify code

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2021-03-19 12:20:46 +01:00
Arve Knudsen
a2eda798e7
PluginManager: Make remaining plugin state non-global (#32094)
* PluginDashboards: Use plugin manager interface

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* PluginManager: Make panels non-global

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* PluginManager: Make apps non-global

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* PluginManager: Make static routes non-global

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* PluginManager: Make pluginTypes non-global

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-03-18 13:53:01 +01:00
Arve Knudsen
87c3a2b790
PluginManager: Make Plugins, Renderer and DataSources non-global (#31866)
* PluginManager: Make Plugins and DataSources non-global

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix integration tests

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Replace outdated command

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* DashboardService: Ensure it gets constructed with necessary parameters

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix build

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* DashboardService: Ensure it gets constructed with necessary parameters

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Remove dead code

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix test

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix test

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Remove FocusConvey

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix test

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Remove dead code

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Undo interface changes

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Backend: Move tsdbifaces.RequestHandler to plugins.DataRequestHandler

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Rename to DataSourceCount

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Consolidate dashboard interfaces into one

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix tests

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix tests

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix test

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix tests

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix tests

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix tests

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix tests

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix dashboard integration tests

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-03-17 16:06:10 +01:00
Arve Knudsen
65c1cb62a7
Chore: Move tsdbifaces.RequestHandler to plugins.DataRequestHandler (#31897)
* Backend: Move tsdbifaces.RequestHandler to plugins.DataRequestHandler

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-03-12 18:26:07 +01:00
Ryan McKinley
9dd1d5f553
Cloudwatch: use shared library for aws auth (#29550)
* use sdk for handling auth

* fix broken test

* lint fixes

Co-authored-by: Erik Sundell <erik.sundell87@gmail.com>
2021-03-12 14:30:21 +01:00
Arve Knudsen
1716de88b5
DashboardService: Consolidate constructors (#31886)
* DashboardService: Consolidate constructors

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-03-12 11:51:02 +01:00
Arve Knudsen
47f13abf7a
Backend: Migrate to using non-global configuration (#31856)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-03-10 12:41:29 +01:00
Arve Knudsen
b79e61656a
Introduce TSDB service (#31520)
* Introduce TSDB service

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

Co-authored-by: Erik Sundell <erik.sundell87@gmail.com>
Co-authored-by: Will Browne <will.browne@grafana.com>
Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
2021-03-08 07:02:49 +01:00
Joan López de la Franca Beltran
01b4048026
Usage Stats: Report usage for all signed plugins (#31545)
* Report usage for all the signed plugins

* Remove no longer used code

* Fix tests by manipulating the global state

* Minor test fix
2021-03-04 15:43:43 +01:00
Will Browne
a606a49cb2
propagate plugin unavailable message to UI (#31560) 2021-03-01 18:54:10 +01:00
Torkel Ödegaard
584886fa46
AppPlugins: Options to disable showing config page in nav (#31354)
* AppPlugins: Options to disable showing config page in nav

* rename

* Added autoEnabled

* updated

* Things are working sort of

* Simplify
2021-02-25 10:00:21 +01:00
Arve Knudsen
b99127be82
PluginManager: Remove some global state (#31081)
* PluginManager: Remove global state

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-02-10 13:31:47 +01:00
Will Browne
da3f963987
convert path to posix by default (#31045) 2021-02-09 16:21:45 +01:00
Joan López de la Franca Beltran
6415d2802e
Plugins: Requests validator (#30445)
* Introduce PluginRequestValidator abstraction with a NoOp implementation

* Update PluginRequestValidator abstraction to use the dsURL instead

* Inject PluginRequestValidator into the HTTPServer and validate requests going through data source proxy

* Inject PluginRequestValidator into the BackendPluginManager and validate requests going through it

* Validate requests going through QueryMetrics & QueryMetricsV2

* Validate BackendPluginManager health requests

* Fix backend plugins manager tests

* Validate requests going through alerting service

* Fix tests

* fix tests

* goimports

Co-authored-by: Leonard Gram <leo@xlson.com>
2021-02-03 20:47:45 +01:00
Marcus Efraimsson
13ce811fab
Chore: Remove warning when calling resource (#30752)
Fixes so that the warning WARN Failed to close 
stream logger=plugins.backend err="cannot 
close a closed stream" is not logged every 
time calling a resource.
2021-02-01 16:11:13 +01:00
Torkel Ödegaard
c04bc805b5
CDN: Adds support for serving assets over a CDN (#30691)
* CDN: Initial poc support for serving assets over a CDN

* Minor fix

* added build path and test

* fix lint error

* Added edition to cdn path

* Move master builds to a separate path

* Added error handling for the url parsing, changed setting name, and added docs

* Updated sample.ini

* Some property renames

* updated

* Minor update to html

* index template improvements

* Update docs/sources/administration/configuration.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Update docs/sources/administration/configuration.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Added ContentDeliveryPrefix to Licence service

* updated docs

* Updated test mock

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2021-02-01 10:13:09 +01:00
Marcus Efraimsson
043d6cd584
Backend Plugins: Convert test data source to use SDK contracts (#29916)
Converts the core testdata data source to use the SDK contracts and by that 
implementing a backend plugin in core Grafana in similar manner as an external one.

Co-authored-by: Will Browne <will.browne@grafana.com>
Co-authored-by: Marcus Efraimsson <marefr@users.noreply.github.com>
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-01-29 18:33:23 +01:00
Emil Tullstedt
af27dd7e7d
Licensing: Send map of environment variables to plugins (#30347)
Replace hard-coded `GF_ENTERPRISE_LICENSE_TEXT` with a
`map[string]string` to allow the licensing service to allow sending any
environment variable through to the plugins for licensing purposes.
2021-01-18 14:42:39 +01:00
Erik Sundell
bfcb8a477d
Set signed in users email correctly (#30249) 2021-01-13 13:36:24 +01:00
Arve Knudsen
5da3419459
Better logging of plugin scanning errors (#30231)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-01-12 19:17:25 +01:00
Arve Knudsen
c2cad26ca9
Chore: Disable default golangci-lint filter (#29751)
* Disable default golangci-lint filter

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Chore: Fix linter warnings

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-12-15 09:32:06 +01:00