Commit Graph

270 Commits

Author SHA1 Message Date
Marcus Efraimsson
0a1650d265
Image rendering: Fix missing icon on plugins list (#23958)
Fixes #23189
2020-04-27 21:15:44 +02:00
Daniel Lee
52154b465b
dsproxy: adds support for url params for plugin routes (#23503)
* dsproxy: adds support for url params for plugin routes

* docs: fixes after review

* pluginproxy: rename Params to URLParams

* Update pkg/plugins/app_plugin.go

Co-Authored-By: Arve Knudsen <arve.knudsen@gmail.com>

* Apply suggestions from code review

Co-Authored-By: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
Co-Authored-By: Arve Knudsen <arve.knudsen@gmail.com>

* pluginproxy: rename struct

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
2020-04-24 10:32:13 +02:00
Andrej Ocenas
376765b3d7
Tracing: Remove feature flag (#23834) 2020-04-23 20:46:42 +02:00
Kyle Brandt
80e1191ca0
Backend Plugins: (breaking change) Add PluginContext (#23788)
* breaking change for newer backend plugins
* use exported protobuf converters and sdk types to reduce duplicate code
* uses grafana-plugin-sdk-go@v0.54.0
2020-04-23 14:08:21 -04:00
Marcus Efraimsson
871ad73414
Backend plugins: Renderer v2 plugin (#23625)
grafana-plugin-model is legacy and is replaced by new backend 
plugins SDK and architecture. Renderer is not part of SDK and 
we want to keep it that way for now since it's highly unlikely there 
will be more than one kind of renderer plugin.
So this PR adds support for renderer plugin v2.
Also adds support sending a Device Scale Factor parameter to the 
plugin v2 remote rendering service and by that replaces #22474.
Adds support sending a Headers parameter to the plugin v2 and
remote rendering service which for now only include 
Accect-Language header (the user locale in browser when using 
Grafana), ref grafana/grafana-image-renderer#45.
Fixes health check json details response.
Adds image renderer plugin configuration settings in defaults.ini 
and sample.ini.

Co-Authored-By: Arve Knudsen <arve.knudsen@gmail.com>
2020-04-21 16:16:41 +02:00
Marcus Efraimsson
ed51ce3ae1
Backend Plugins: Discard logged messages from logger named stdio (#23601)
Discard logged messages coming from backend plugin logger named 
stdio since that service is not in use. 

Fixes #23461
2020-04-16 13:08:07 +02:00
Marcus Efraimsson
34266cd369
Backend Plugins: Plugin configuration using Grafana config (#23451)
Enables adding a section `plugin.<plugin id>` and key/value to
Grafana configuration file which will be converted and sent
as environment variables to the backend plugin.
Also sends some additional environment variables, Grafana
version (GF_VERSION), Grafana edition (GF_EDITION) and 
enterprise license path (GF_ENTERPRISE_LICENSE_PATH).

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

Fixes #21515,
2020-04-14 18:04:27 +02:00
Ryan McKinley
aaab636bf4
Plugins: verify manifest signature (#23519)
* try decode

* vendor crypto deps

* commited missing vendor deps

* Theme: Refactoring theme colors variables  (#23513)

* Theme: Typography updates

* Updated

* Updated snapshot

* Renamed colors to palette

* Introduce colors namespace

* Massive theme color move

* Removing color selection logic with more abstract concepts

* Updates

* Minor sidemenu change

* Fix example jaeger agent port in docs (#23514)

* @grafana/ui: Replace various icons using Icon component (#23442)

* Replace icons in dashboard and settings

* Replace icons in alerting

* Update batch of icons

* Implement icons accross various files

* Style updates

* Search: Fix recent and starred icons

* Update styling and details

* Replace new icon created by unicons

* Fix e2e test, styling

* Minor styling updates

Co-authored-by: Clarity-89 <homes89@ukr.net>

* trying with p512 key

* trying with p512 key

* lint

* update with real signatures

* fixes spacing in test files

* remove convey from test

* use errutil to wrap errors

* removes print statement

* splitt tests into two run statements

* unexport plugin manifest struct

Co-authored-by: bergquist <carl.bergquist@gmail.com>
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
Co-authored-by: Vitaly Zhuravlev <v-zhuravlev@users.noreply.github.com>
Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
Co-authored-by: Clarity-89 <homes89@ukr.net>
2020-04-14 06:02:39 -07:00
Ryan McKinley
a56615749a
Plugins: fix debug formatting when scanning for files (#23484) 2020-04-10 00:45:07 -07:00
Kyle Brandt
5153673884
BackendPlugins: update to sdk v0.42.0
misc cleanup
2020-04-09 15:47:30 -04:00
Carl Bergquist
a08cbbcc81
Instrument backend plugin requests (#23346) 2020-04-09 14:47:46 +02:00
Ryan McKinley
468f5d15ab
Plugins: add a signature status flag (#23420) 2020-04-09 00:00:16 -07:00
Kyle Brandt
f6cbb26167
BackendPlugin: Change QueryData response format (#23234)
* BackendPlugin: (wip) change response format
goes with https://github.com/grafana/grafana-plugin-sdk-go/pull/109

* fix error mapping in wrapper

* latest of my sdk branch

* latest of my sdk branch

* TransformWrapper fixes

* latest of sdk branch (removes extra meta)

* add metadata in wrappers

* also set error string

* sdk: v0.35.0
2020-04-07 10:13:14 -04:00
Ryan McKinley
03e3ddcbdb
Plugins: add a bundle plugins folder (#20850) 2020-04-07 00:04:24 -07:00
Andrej Ocenas
ae09ccbf79
Trace UI demo (#20297)
* Add integration with Jeager
Add Jaeger datasource and modify derived fields in loki to allow for opening a trace in Jager in separate split.
Modifies build so that this branch docker images are pushed to docker hub
Add a traceui dir with docker-compose and provision files for demoing.:wq

* Enable docker logger plugin to send logs to loki

* Add placeholder zipkin datasource

* Fixed rebase issues, added enhanceDataFrame to non-legacy code path

* Trace selector for jaeger query field

* Fix logs default mode for Loki

* Fix loading jaeger query field services on split

* Updated grafana image in traceui/compose file

* Fix prettier error

* Hide behind feature flag, clean up unused code.

* Fix tests

* Fix tests

* Cleanup code and review feedback

* Remove traceui directory

* Remove circle build changes

* Fix feature toggles object

* Fix merge issues

* Fix some null errors

* Fix test after strict null changes

* Review feedback fixes

* Fix toggle name

Co-authored-by: David Kaltschmidt <david.kaltschmidt@gmail.com>
2020-03-25 12:25:39 +01:00
Marcus Efraimsson
b0253219eb
Use v0.33.0 of SDK (#23031) 2020-03-24 15:01:02 +01:00
Marcus Efraimsson
60e3437fc1
Backend plugins: Exclude plugin metrics in Grafana's metrics endpoint (#22857)
Excludes backend plugin metrics in Grafana's metrics endpoint
Adds /api/:pluginId/metrics endpoint for retrieving metrics
from backend plugin as Prometheus text-based exposition format.

Fixes #22814
2020-03-18 12:08:20 +01:00
Carl Bergquist
0a094a7319
Datasource config was not mapped for datasource healthcheck (#22848)
closes #22825
2020-03-17 16:59:47 +01:00
Carl Bergquist
b0407b3578
upgrades plugin sdk to 0.30.0 (#22846)
ref grafana/grafana-plugin-sdk-go#94
ref grafana/grafana-plugin-sdk-go#70
2020-03-17 16:58:52 +01:00
Carl Bergquist
ebc9549cbc
Add support for sending health check to datasource plugins. (#22771)
closes #21519
ref grafana/grafana-plugin-sdk-go#93
2020-03-13 12:31:44 +01:00
Kyle Brandt
73c4bef70f
Dependency: sdk's dataframe package renamed to data (#22700)
* use sdk 0.24.0
2020-03-10 15:42:15 -04:00
Carl Bergquist
5f94d31da9
Send jsondata for Datasources on DatasourceConfig for backend plugins (#22681)
ref https://github.com/grafana/grafana-plugin-sdk-go/pull/84
2020-03-10 15:18:27 +01:00
Marcus Efraimsson
c12245bbb3
Backend plugins: Updates due to changes in SDK (#22649)
Use v0.20.0 of SDK
2020-03-10 12:59:03 +01:00
Carl Bergquist
1dcfaf25fc
Adds signed in user to backend v2 plugins requests (#22584)
closes #12043
2020-03-06 14:37:36 +01:00
Marcus Efraimsson
4ff613a432
Backend Plugins: Support handling of streaming resource response (#22580)
Use v0.19.0 of SDK.
Support handling of streaming resource response.
Disable gzip/compression middleware for resources 
to allow chunked/streaming response to clients the gzip
middleware had to be disabled since it buffers the full
response before sending it to the client.

Closes #22569

Co-Authored-By: Arve Knudsen <arve.knudsen@gmail.com>
2020-03-06 01:44:07 +07:00
Marcus Efraimsson
e6cec8dbdc
Backend plugins: Prepare and clean request headers before resource calls (#22321)
Moves common request proxy utilities to proxyutil package with
support for removing X-Forwarded-Host, X-Forwarded-Port,
X-Forwarded-Proto headers, setting X-Forwarded-For header
and cleaning Cookie header.
Using the proxyutil package to prepare and clean request
headers before resource calls.

Closes #21512
2020-03-03 11:45:16 +01:00
Carl Bergquist
67ec9edcc8
chore: avoid alias for models in plugins (#22483) 2020-02-28 12:51:21 +01:00
Marcus Efraimsson
9d7c74ef91
Backend Plugins: Provide proper plugin config to plugins (#21985)
Properly provides plugin configs to backend plugins.
Uses v0.16.0 of grafana-plugin-sdk-go-

Ref #21512
Ref #19667
2020-02-19 19:17:05 +01:00
Marcus Efraimsson
679acd30ba
Backend Plugins: make transform work again (#22078) 2020-02-10 12:17:54 -05:00
Marcus Efraimsson
0390b5601e
Backend plugins: Implement support for resources (#21805)
Implements initial support for resources using v0.14.0 of SDK.

Ref #21512
2020-01-31 11:15:50 +01:00
Marcus Efraimsson
5c711bfb79
Backend Plugins: Collect and expose metrics and plugin process health check (#21481)
Adds support for collecting metrics from backend plugins and 
exposing them thru Grafana's Prometheus metrics endpoint. 
Enables to check health of backend plugin by using the route
`/api/plugins/<plugin id>/health`.
Uses sdk v0.6.0.

Closes #20984
2020-01-15 13:10:48 +01:00
Marcus Efraimsson
1a810ebfe4
Plugins: Move backend plugin manager to service (#21474)
Moves backend plugin manager to service instead of
global functions in backendplugin package.

Closes #20053
2020-01-13 20:18:45 +01:00
Marcus Efraimsson
bb849d53bf
Backend Plugins: Refactor backend plugin registration and start (#21452)
Moves the details of loading plugins into the backend
plugin manager from the respective plugin (datasource,
transform and renderer).
2020-01-13 17:13:17 +01:00
Marcus Efraimsson
baba1634b8 Plugins: Use grafana-plugin-sdk-go v0.5.0 (#21116)
* fix dispense

* plugin loading refactor

Moves common functionality of registering, starting,
stopping and restarting backend plugins to
backendplugin package.

* simplify plugin descriptors

* target sdk v0.5.0

Co-authored-by: Kyle Brandt <kyle@kbrandt.com>
2020-01-08 11:43:28 -05:00
Marcus Efraimsson
6a4ad136dc
Backend plugins: Log wrapper args formatting fix (#20521)
Formatting fix missed in #20514
2019-11-20 16:57:55 +01:00
Marcus Efraimsson
58b7958952
Backend plugins: Log wrapper args formatting (#20514)
Backend plugins is recommended to use hclog with json 
formatting to get proper log output in grafana server log.
Old hclog-wrapper.go that I deleted while back is still in 
the repo so deletes that.
2019-11-20 14:27:28 +01:00
Kyle Brandt
da1df02813
transform_plugin: stop plugin when grafana stops (#20397)
fixes https://github.com/grafana/gel-app/issues/49
until #20362
2019-11-14 15:49:31 -05:00
Kyle Brandt
b8029dcd4e
transform_plugin: pass encoded dataframes through (#20333) 2019-11-12 16:21:10 -05:00
Kyle Brandt
17f36d0492
sdk: update to latest (#20182)
which removes an unused field from the Transform api
2019-11-05 14:12:54 -05:00
Ryan McKinley
861eb72113 transform: add expressions to query editor (w/ feature flag) (#20072)
for use with gel which is not released yet.
2019-10-30 14:38:28 -04:00
Ryan McKinley
2bb4684741
DataSource: don't filter hidden queries automatically (#20088) 2019-10-30 09:51:13 -07:00
Kyle Brandt
009d58c4a2
Plugins: Transform plugin support (#20036)
currently temporary separate http api
2019-10-29 12:22:31 -04:00
Arve Knudsen
f9774acc4c
Enable errcheck for golangci-lint (#19976)
* Enable `errcheck` for golangci-lint
* Fix linting errors
* pkg/plugins: Fix tests
* pkg/plugins: Add test
2019-10-28 17:25:35 +01:00
Marcus Efraimsson
771f21ed09 api: new v2 metrics query endpoint
Requests to endpoint will currently will error unless expressions feature flag is true.

Co-authored-by: Sofia Papagiannaki <papagian@gmail.com>
2019-10-25 09:28:26 -04:00
Sofia Papagiannaki
fc08c26025 WIP: Spawn backend plugins v2 (#19835)
* WIP: Spawn backend plugins v2

* Add test for plugin version

* Fix support for SDK plugins

Co-authored-by: Kyle Brandt <kyle@kbrandt.com>
Co-authored-by: Marcus Olsson <olsson.e.marcus@gmail.com>
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>

* WIP: Draft PR for fork of V2 sdk / bi-directional support (#19890)

* temporary use export-datasource-plugin branch of grafana-plugin-sdk

* fix failing test

* remove debug (spew) lines

* misc cleanup

* add expressions feature toggle

* use latest grafana-plugin-sdk-go
2019-10-24 17:15:27 +02:00
Arve Knudsen
31735422ef
pkg/plugins: Only warn if plugins fail to load. Fixes #19846 (#19859)
pkg/plugins: Only warn if plugins fail to load. Fixes #19846
2019-10-18 14:39:38 +02:00
Arve Knudsen
0b1913af6f
pkg/plugins: Check errors (#19715)
* pkg/plugins: Check errors
2019-10-11 21:02:15 +02:00
Jon Gyllenswärd
606392b4c6 API: added dashboardId and slug in response after import (#19692) 2019-10-08 17:47:18 +02:00
Hugo Häggmark
75dcaecc99
Plugins: Skips existence of module.js for renderer plugins (#19318)
* Fix: Skips test for module.js for plugins of renderer type
Fixes #19130

* Refactor: Changes after PR comments

* Chore: Fixes go lint issue
2019-09-23 22:54:28 -07:00
Ryan McKinley
f7c55d3968 Plugins: better warning when plugins fail to load (#18671)
* better pluin feedback

* add server side check for module.js
2019-08-22 07:04:02 +02:00