Commit Graph

5292 Commits

Author SHA1 Message Date
Marcus Efraimsson
890e1d8f94
Backend plugins: Send query type to backend plugins (#24120)
Use v0.60.0 of sdk.
2020-05-05 10:32:34 +02:00
Marcus Efraimsson
bcf5c937d5
Plugins: Require backend plugins to be signed when using plugin path (#24244) 2020-05-04 22:12:18 +02:00
Ryan McKinley
3487e518ab
Signing: allow unsigned plugin in dev mode (#24242) 2020-05-04 11:57:11 -07:00
Arve Knudsen
2fc2a7c3f5
Plugins: Only load transform plug-ins if expressions feature on (#24110)
* PluginManager: Only load transform plugins if expressions feature on

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2020-05-04 17:39:20 +02:00
Arve Knudsen
96ffcaa134
Plugins: Require signing of external back-end plugins (#24075)
* PluginManager: Require signing of external plugins

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
2020-05-04 10:57:55 +02:00
Mario Trangoni
5116420e9a
Fix misspell issues (#23905)
* Fix misspell issues

See,
$ golangci-lint run --timeout 10m --disable-all -E misspell ./...

Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com>

* Fix codespell issues

See,
$ codespell -S './.git*' -L 'uint,thru,pres,unknwon,serie,referer,uptodate,durationm'

Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com>

* ci please?

* non-empty commit - ci?

* Trigger build

Co-authored-by: bergquist <carl.bergquist@gmail.com>
Co-authored-by: Kyle Brandt <kyle@grafana.com>
2020-04-29 21:37:21 +02:00
Ryan McKinley
02140fff2d
TestData/Graph: load arrow and zoom to data range (#23764) 2020-04-27 16:41:41 -07:00
Marcus Efraimsson
b22649bf8d
Dashboard: Handle min refresh interval when importing dashboard (#23959)
If refresh interval is lower than minimum refresh interval
when importing dashboard, use the minimum refresh interval
instead of returning error.

Fixes #23099
2020-04-27 21:17:28 +02:00
Marcus Efraimsson
0a1650d265
Image rendering: Fix missing icon on plugins list (#23958)
Fixes #23189
2020-04-27 21:15:44 +02:00
Daniel Lee
c05049f395
azuremonitor: port azure log analytics query function to the backend (#23839)
* azuremonitor: add support for log analytics macros

Also adds tests for the kql macros

* azuremonitor: backend implementation for Log Analytics

* azuremonitor: remove gzip header from plugin route

The Go net/http library adds an accept encoding header
for gzip automatically.

https://golang.org/src/net/http/transport.go\#L2454

So no need to specify it manually

* azuremonitor: parses log analytics time series

* azuremonitor: support for table data for Log Analytics

* azuremonitor: for log analytics switch to calling the API...

...from the backend for time series and table queries.

* azuremonitor: fix missing err check

* azuremonitor: support Azure China, Azure Gov...

for log analytics on the backend.

* azuremonitor: review fixes

* azuremonitor: rename test files folder to testdata

To follow Go conventions for test data in tests

* azuremonitor: review fixes

* azuremonitor: better error message for http requests

* azuremonitor: fix for load workspaces on config page

* azuremonitor: strict null check fixes

Co-authored-by: bergquist <carl.bergquist@gmail.com>
2020-04-27 17:43:02 +02:00
Marcus Efraimsson
76650e60e4
Image Rendering: New setting to control render request concurrency (#23950)
Fixes #23806

Co-Authored-By: Torkel Ödegaard <torkel@grafana.com>
Co-Authored-By: Arve Knudsen <arve.knudsen@gmail.com>
2020-04-27 17:25:08 +02:00
Marcus Efraimsson
854085dbc6
Dashboard: Enforce min dashboard refresh interval to 5 seconds per default (#23929)
Fixes #22493
2020-04-27 16:51:54 +02:00
Alexander Zobnin
fa710a3172
Rendering: Add metrics (#23827)
* Rendering: base metrics

* Rendering: rendering_queue_size metric

* Chore: fix linter error

* Rendering metrics: refactoring

* Apply suggestions from code review

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

* Rendering metrics: handle DeadlineExceeded errors

* Rendering metrics: don't measure canceled request time

* Rendering metrics: revert deleting summary for canceled requests

* Update pkg/services/rendering/rendering.go

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

* Rendering: return ErrTimeout if context deadline exceeded

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2020-04-27 15:29:46 +03:00
Emil Tullstedt
830e8dc5fd
Search: Replace search implementation (#23855) 2020-04-27 14:16:03 +02:00
Daniel Lee
b0488259d0
azuremonitor: fix for app insights azure china url (#23877) 2020-04-27 12:40:11 +02:00
kay delaney
f48ba11d4c
Datasource/Cloudwatch: Adds support for Cloudwatch Logs (#23566)
* Datasource/Cloudwatch: Adds support for Cloudwatch Logs

* Fix rebase leftover

* Use jsurl for AWS url serialization

* WIP: Temporary workaround for CLIQ metrics

* Only allow up to 20 log groups to be selected

* WIP additional changes

* More changes based on feedback

* More changes based on PR feedback

* Fix strict null errors
2020-04-25 22:48:20 +02:00
Johannes Brück
a98c129d05
CloudWatch: Prefer webIdentity over EC2 role also when assuming a role (#23807)
Same as #23452 but for assumed roles.
When using service accounts (webIdentity) on EKS in combination 
with assuming roles in other AWS accounts Grafana needs to retrieve 
the service account credentials first and then needs to assume the 
configured role.
2020-04-24 13:05:51 +02:00
Marcus Efraimsson
58de0dabd4
Alerting: Upload error image when image renderer unavailable (#23713)
When Include image is enabled for an alert notification channel, but there's 
no image renderer available/installed when sending notification an error 
image will be uploaded/attached explaining that you need to install the 
Grafana Image Renderer plugin.

Ref #13802

Co-Authored-By: Arve Knudsen <arve.knudsen@gmail.com>
2020-04-24 11:35:55 +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
Omar Nahhas Sanchez
cf23f15a08
Adding debug line to search ldap. (#23824) 2020-04-24 09:53:42 +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
Leonard Gram
ebdbb0c96d
Rendering: makes sure IsAvailable can be used during init of other services (#23817)
* Rendering: makes sure service knows if it is configured after Init()

* Rendering: refactor
2020-04-23 14:44:52 +02:00
Arve Knudsen
7d88018531
DataSourceProxy: Handle URL parsing error (#23731)
* pluginproxy: Handle URL parsing error
* pkg/api: Validate data source URLs
* pkg/api: Return 400 for URL validation error
2020-04-22 10:30:06 +02:00
Marcus Efraimsson
61de19250d
Image Rendering: Make it work using serve_from_sub_path configured (#23706)
Make rendering work when using serve_from_sub_path and not have rendering.renderer_url configured.

Fixes #21925
2020-04-21 19:57:11 +02: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
Leonard Gram
8620b7c2aa
Search: raise service init prio (#23740) 2020-04-21 15:30:09 +02:00
Emil Tullstedt
b7809918f0
Dashboard: Update tests for testing fallback support (#23730) 2020-04-21 11:31:10 +02:00
Ryan McKinley
9464115fc0
TableCell: show JSON rather than [object Object] (#23683) 2020-04-20 11:10:03 -07:00
Emil Tullstedt
b669bfdf5f
Dashboard: Add failsafe for slug generation (#23709) 2020-04-20 18:17:33 +02:00
Jack Stevenson
c0635947e8
Add ServerlessDatabaseCapacity to AWS/RDS metrics (#23635) 2020-04-20 18:14:17 +02:00
Emil Tullstedt
83193aed3d
Search: Fix title search null pointer (#23705) 2020-04-20 17:29:35 +02:00
Emil Tullstedt
55c306eb6d
Refactor search (#23550)
Co-Authored-By: Arve Knudsen <arve.knudsen@grafana.com>
Co-Authored-By: Leonard Gram <leonard.gram@grafana.com>
2020-04-20 16:20:45 +02:00
Andrej Ocenas
e5dd7efdee
Provisioning: Allows specifying uid for datasource and use that in derived fields (#23585)
* Add uid to datasource

* Fix uid passing when provisioning

* Better error handling and Uid column type change

* Fix test and strict null error counts

* Add backend tests

* Add tests

* Fix strict null checks

* Update test

* Improve tests

* Update pkg/services/sqlstore/datasource.go

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

* Variable rename

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-04-20 15:48:38 +02:00
Carl Bergquist
46fd7c094b
Alertmanager: Basic auth should not be required (#23691) 2020-04-20 11:19:31 +02:00
Alexander Zobnin
f023e7a399
SAML Role and Team sync (open source part) (#23391)
* SAML: add default params for role and team sync

* SAML: add org_mapping option

* SAML: support allowed_organizations option

* Chore: expose RedirectWithError from HTTPServer

* Chore: return RedirectResponse (fix superfluous response.writeheader message)

* HTTPServer: expose ValidateRedirectTo() and CookieOptionsFromCfg()

* Config: move SAML section to the enterprise
2020-04-17 10:48:37 +03:00
Carl Bergquist
9652a1410b
Build: Stricter linting should break the build (#23606) 2020-04-16 16:09:27 +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
Carl Bergquist
5fc255bd89
Linting fixes for provisoning (#23600) 2020-04-16 05:46:20 +02:00
Marcus Efraimsson
6e313e7d37
Image Rendering: Remove PhantomJS support (#23460)
Removes all references and usage of PhantomJS #23375.
Remove direct link rendered image e2e smoke test for now.
Docker: Fix installing chrome in ubuntu custom docker image.
Improve handling of image renderer not available/installed #23593.
Add PhantomJS breaking change and upgrading notes.
Use grabpl v0.2.10.

Closes #13802

Co-authored-by: Kyle Brandt <kyle@grafana.com>
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
2020-04-15 22:17:41 +02:00
Marcus Efraimsson
2c36137457
Fix instantiation of plugin settings (#23583)
Forgot to instantiate plugin settings in #23451
2020-04-15 11:57:44 +02:00
Émile Fugulin
d721dd13cd
Allow API to assign new user to a specific organization (#21775)
* Allow API to assign new user to a specific organization

* Add defer block to test

* Add API tests and return 400 instead of 500 for bad orgId

* Minor test improvements
2020-04-15 12:11:45 +03:00
ilyastoli
b980cedfd5
CloudWatch: Added AWS Chatbot metrics and dimensions (#23516)
Adding AWS Chatbot metics according to https://docs.aws.amazon.com/chatbot/latest/adminguide/monitoring-cloudwatch.html
2020-04-15 10:35:21 +03:00
Carl Bergquist
80f40040b0
Linting fixes for dashboard provsioning (#23576) 2020-04-15 08:12:52 +02:00
Artur Kondas
9f2af718dc
Provisioning: Validate that dashboard providers have unique names (#22898)
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
Co-authored-by: bergquist <carl.bergquist@gmail.com>
2020-04-14 20:54:00 +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
Hugo Häggmark
2661054fe8
Hangouts: fixes notifications for alerts with empty message (#23559)
* Hangouts: fixes notifications for alerts with empty message

* Update pkg/services/alerting/notifiers/googlechat.go

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

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2020-04-14 15:02:58 +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
Carl Bergquist
754dfdfa87
Lower log level for some startup logs statements (#23517) 2020-04-14 12:18:45 +02:00
Ivana Huckova
1c58202b26
@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>
2020-04-12 22:20:02 +02:00
Carl Bergquist
0fd5945542
Fixes linting errors in datasource provisioning. (#23515) 2020-04-11 21:07:07 +02:00
Torkel Ödegaard
5a4f690807
NewPanelEditor: Enable new edit mode (#23405)
* WIP: initial commit to transition to new edit mode

* More old edit cleanup

* Minor update

* Refactoring url edit/fullscreen state to simplify logic, now seperate states

* Fixed tests and part of the explore integration

* Updated snapshot

* Fix alert rule links

* Fixed issue going back from explore

* Updated snapshots

* Fixes and changes

* Fixed bridge srv issue

* Fixed add panel issue

* Removed console log

* Removed render

* Tests: fixes e2e smoketest

* Make description optional

* Fixed typings

* e2e fixes

* removed import

* updated snapshot

Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
2020-04-10 16:37:26 +02: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
ilyastoli
692a73875b
CloudWatch: Added missing Cassandra metrics (#23467)
Adding missing CloudWatch metrics Cassandra
2020-04-09 17:08:28 +03:00
Carl Bergquist
a08cbbcc81
Instrument backend plugin requests (#23346) 2020-04-09 14:47:46 +02:00
Ryan
1f0e1b33bc
Postgres: Add SSL support for datasource (#21341)
* Add SSL certificate/key fields to Postgres data source configuration

Co-authored-by: Edwin Cordeiro <edwin@scordeiro.net>
Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-04-09 12:48:29 +02:00
Ryan McKinley
468f5d15ab
Plugins: add a signature status flag (#23420) 2020-04-09 00:00:16 -07:00
Dário Nascimento
7329671793
Cloudwatch: prefer webIdentity over EC2 role (#23452) 2020-04-08 23:58:32 -07:00
Patrik Karlström
dbda5aece9
cloudwatch: Replicate SDK behaviour for WebIdentityRole (#21594)
* Replicate SDK behaviour for WebIdentityRole

Fix #20473

* Use WebIdentityRole in s3 uploader as well

* Use consistent casing

* use WebIdentityRole to assume another role

Co-authored-by: eV <ev@7pr.xyz>
2020-04-08 15:05:24 +02:00
Ivana Huckova
431f454d57
@grafana/ui: Create Icon component and replace part of the icons (#23402)
* Part1: Unicons implementation (#23197)

* Create a new Icon component

* Update icons in main sidebar

* Update icons in Useful links and in react components on  main site

* Update icons in Useful links and in main top navigation

* Adjust sizing

* Update panel navigation and timepicker

* Update icons in Panel menu

* NewPanelEditor: Fixed so that test alert rule works in new edit mode (#23179)

* Update icons in add panel widget

* Resolve merge conflict

* Fix part of the test errors and type errors

* Fix storybook errors

* Update getAvailableIcons import in storybook knobs

* Fix import path

* Fix SyntaxError: Cannot use import statement outside a module in test environment error

* Remove dynamic imports

* Remove types as using @ts-ignore

* Update snapshot test

* Add @iconscout/react-unicons to the shouldExclude list as it is blundled with es2015 syntax

* Remove color prop from icon, remove color implemetation in mono icons

* Update navbar styling

* Move toPascalCase to utils/string

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>

* Resolve type errors resulted from merge

* Part2: Unicons implementation (#23266)

* Create a new Icon component

* Update icons in main sidebar

* Update icons in Useful links and in react components on  main site

* Update icons in Useful links and in main top navigation

* Adjust sizing

* Update panel navigation and timepicker

* Update icons in Panel menu

* Update icons in add panel widget

* Resolve merge conflict

* Fix part of the test errors and type errors

* Fix storybook errors

* Update getAvailableIcons import in storybook knobs

* Fix import path

* Fix SyntaxError: Cannot use import statement outside a module in test environment error

* Remove dynamic imports

* Remove types as using @ts-ignore

* Update snapshot test

* Add @iconscout/react-unicons to the shouldExclude list as it is blundled with es2015 syntax

* Implment icons in Tabs

* Implement icons in search items and  empty  list

* Update buttons

* Update button-related snapshot tests

* Update icons in modals and page headers

* Create anfular wrapper and update all icons on search screen

* Update sizing, remove colors, update snapshot tests

* Remove color prop from icon, remove color implemetation in mono icons

* Remove color props from monochrome icons

* Complete update of icons for search screen

* Update icons for infor tooltips, playlist, permissions

* Support temporarly font awesome icons used in enterprise grafana

* Part1: Unicons implementation (#23197)

* Create a new Icon component

* Update icons in main sidebar

* Update icons in Useful links and in react components on  main site

* Update icons in Useful links and in main top navigation

* Adjust sizing

* Update panel navigation and timepicker

* Update icons in Panel menu

* NewPanelEditor: Fixed so that test alert rule works in new edit mode (#23179)

* Update icons in add panel widget

* Resolve merge conflict

* Fix part of the test errors and type errors

* Fix storybook errors

* Update getAvailableIcons import in storybook knobs

* Fix import path

* Fix SyntaxError: Cannot use import statement outside a module in test environment error

* Remove dynamic imports

* Remove types as using @ts-ignore

* Update snapshot test

* Add @iconscout/react-unicons to the shouldExclude list as it is blundled with es2015 syntax

* Remove color prop from icon, remove color implemetation in mono icons

* Update navbar styling

* Move toPascalCase to utils/string

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>

* Icons update

* Add optional chaining to for isFontAwesome variable

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>

* Part3:  Unicons implementation (#23356)

* Create a new Icon component

* Update icons in main sidebar

* Update icons in Useful links and in react components on  main site

* Update icons in Useful links and in main top navigation

* Adjust sizing

* Update panel navigation and timepicker

* Update icons in Panel menu

* Update icons in add panel widget

* Resolve merge conflict

* Fix part of the test errors and type errors

* Fix storybook errors

* Update getAvailableIcons import in storybook knobs

* Fix import path

* Fix SyntaxError: Cannot use import statement outside a module in test environment error

* Remove dynamic imports

* Remove types as using @ts-ignore

* Update snapshot test

* Add @iconscout/react-unicons to the shouldExclude list as it is blundled with es2015 syntax

* Implment icons in Tabs

* Implement icons in search items and  empty  list

* Update buttons

* Update button-related snapshot tests

* Update icons in modals and page headers

* Create anfular wrapper and update all icons on search screen

* Update sizing, remove colors, update snapshot tests

* Remove color prop from icon, remove color implemetation in mono icons

* Remove color props from monochrome icons

* Complete update of icons for search screen

* Update icons for infor tooltips, playlist, permissions

* Support temporarly font awesome icons used in enterprise grafana

* Part1: Unicons implementation (#23197)

* Create a new Icon component

* Update icons in main sidebar

* Update icons in Useful links and in react components on  main site

* Update icons in Useful links and in main top navigation

* Adjust sizing

* Update panel navigation and timepicker

* Update icons in Panel menu

* NewPanelEditor: Fixed so that test alert rule works in new edit mode (#23179)

* Update icons in add panel widget

* Resolve merge conflict

* Fix part of the test errors and type errors

* Fix storybook errors

* Update getAvailableIcons import in storybook knobs

* Fix import path

* Fix SyntaxError: Cannot use import statement outside a module in test environment error

* Remove dynamic imports

* Remove types as using @ts-ignore

* Update snapshot test

* Add @iconscout/react-unicons to the shouldExclude list as it is blundled with es2015 syntax

* Remove color prop from icon, remove color implemetation in mono icons

* Update navbar styling

* Move toPascalCase to utils/string

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>

* Update icons in Explore

* Update icons in alerting

* Update + and x buttons

* Update icons in configurations and settings

* Update close icons

* Update icons in rich history

* Update alert messages

* Add optional chaining to for isFontAwesome variable

* Remove icon mock, set up jest.config

* Fix navbar plus icon

* Fir enable-bacground to enableBackgournd

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>

* Merge remote branch origin master to icons-unicons

* Revert "Merge remote branch origin master to icons-unicons"

This reverts commit 3f25d50a39.

* Size-up dashnav icons

* Fix alerting icons, panel headers, update tests

* Fix typecheck error

* Adjustments - add panel icon, spacing

* Set TerserPlugin sourceMap to false to prevent running out of memory when publishing storybook

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
2020-04-08 14:33:31 +02:00
Kyle Brandt
80729e9fb1
Chore: remove unused go package dynmap (#23409) 2020-04-07 14:58:10 -04: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
Dan Cech
2ecc7f22b9
delete old dashboard versions in multiple batches (#23348) 2020-04-06 11:44:14 -04:00
Erik Sundell
d94796a022
Auth: Remove trailing / in cookies' path (#22265) (#22265)
According to the stackoverflow answer below, it is recommended to not
include a trailing / in cookies' path. By removing the trailing / for
our cookies path value, people's browsers visiting grafana will pass the
cookie not only to /grafana/ sub paths but also to /grafana sub paths.

This commit avoids the situation where a user would visit
http://localhost/grafana, get redirected to
http://localhost/grafana/login, and following login get redirected back
to http://localhost/grafana, but since the grafana_session cookie isn't
passed along get redirected back once more to
http://localhost/grafana/login.

ref: https://stackoverflow.com/questions/36131023/setting-a-slash-on-cookie-path/53784228#53784228
ref: https://tools.ietf.org/html/rfc6265#section-5.1.4
2020-04-06 17:56:19 +03:00
Vikky Omkar
97184c1750
Fix: Show organization popup in alphabetical order (#22259)
* Show organization popup in alphabetical order
* GetUserOrgList: Sort organizations by name in API

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-04-06 13:27:11 +02:00
Agnès Toulet
56687a08f9
Core: use go-datemath in timerange utility (#23120)
* Core: use go-datemath in time_range

* Core: update timerange for negative epoch

* Core: update gtime component

* Core: clean up time_range tests

* Update pkg/components/gtime/gtime.go

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

* Core: clean gtime tests

* components/gtime: Fix test

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

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-04-06 09:00:05 +02:00
Arve Knudsen
0fd6edab64
services/sqlstore: Order results in UserSearch by username/email (#23328)
* services/sqlstore: Order results in UserSearch by username/email
* Add index (login,email) on user table
2020-04-03 19:15:10 +02:00
Arve Knudsen
5645d74cbc
Server: Exit with 0 if no error (#23312)
Make grafana-server exit with 0 if no error occurred.
2020-04-03 11:34:18 +02:00
Vikky Omkar
06ba5201bb
CloudWatch: Added Cassandra namespace (#23299) 2020-04-02 19:06:54 +03:00
Alexander Zobnin
7afdfd2ef4
Okta OAuth provider (team sync support) (#22972)
* Okta OAuth support

* Chore: fix linter error

* Chore: move IsEmailAllowed to SocialBase

* Chore: move IsSignupAllowed to SocialBase

* Chore: review fixes

* Okta: support allowed_groups

* Okta: default config

* Chore: move extractEmail() to OktaClaims struct

* Chore: review fixes

* generic_oauth_test: Handle error cases

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

* generic_oauth_test: Handle error cases

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

* Docs: Okta OAuth

* Chore: don't return expected errors from searchJSONForAttr

* Docs: role mapping

* Chore: review fixes (searchJSONForAttr)

* Docs: review fixes

* Update docs/sources/auth/okta.md

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

* Update docs/sources/auth/okta.md

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

* Chore: log error if searchJSONForAttr failed

* Docs: add Okta login link

* Docs: review fixes

* Docs: add reference to the org roles

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-04-02 17:35:48 +03:00
Carl Bergquist
15bff3114f
Usagestats: Add usage stats about what type of datasource is used in alerting. (#23125) 2020-04-02 08:45:04 +02:00
John McBride
b017e437d8
Fix typo in oauth error (#23270)
fixes: #23269
2020-04-02 08:24:59 +02:00
Noval Agung Prayogo
ea35ae4d1f
Chore: Update the xorm dependency (#22376)
* Upgrade xorm

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-04-01 15:57:21 +02:00
melchiormoulin
1814dc5afc
Alertmanager: Adds support for basic auth (#23231)
Add basicauth username and password to the alertmanager notifier UI
2020-04-01 09:29:28 +02:00
Marcus Efraimsson
6bd7411f04
Alerting: Only include image in notifier when enabled (#23194)
Fixes a bug when you had multiple notifiers for a rule, but not all 
had enabled to include image.

Fixes #22883
2020-03-31 00:46:01 +02:00
rtrompier
474dac1501
OAuth : Introduce new setting for configuring max age of OAuth state cookie (#23195)
* Cookie : Increase duration to avoid error

When using oauth2 authentication with multifactor, the 60s delay may be too short

* Introduce new setting for OAuth state cookie max age

Co-authored-by: Sofia Papagiannaki <sofia@grafana.com>
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-03-30 17:44:58 +03:00
Erik Sundell
a111cc0d5c
Stackdriver: Support for SLO queries (#22917)
* wip: add slo support

* Export DataSourcePlugin

* wip: break out metric query editor into its own component

* wip: refactor frontend - keep SLO and Metric query in differnt objects

* wip - load services and slos

* Fix broken test

* Add interactive slo expression builder

* Change order of dropdowns

* Refactoring backend model. slo unit testing in progress

* Unit test migration and SLOs

* Cleanup SLO editor

* Simplify alias by component

* Support alias by for slos

* Support slos in variable queries

* Fix broken last query error

* Update Help section to include SLO aliases

* streamline datasource resource cache

* Break out api specific stuff in datasource to its own file

* Move get projects call to frontend

* Refactor api caching

* Unit test api service

* Fix lint go issue

* Fix typescript strict errors

* Fix test datasource

* Use budget fraction selector instead of budget

* Reset SLO when service is changed

* Handle error in case resource call returned no data

* Show real SLI display name

* Use unsafe prefix on will mount hook

* Store goal in query model since it will be used as soon as graph panel supports adding a threshold

* Add comment to describe why componentWillMount is used

* Interpolate sloid

* Break out SLO aggregation into its own func

* Also test group bys for metricquery test

* Remove not used type fields

* Remove annoying stackdriver prefix from error message

* Default view param to FULL

* Add part about SLO query builder in docs

* Use new images

* Fixes after feedback

* Add one more group by test

* Make stackdriver types internal

* Update docs/sources/features/datasources/stackdriver.md

Co-Authored-By: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>

* Update docs/sources/features/datasources/stackdriver.md

Co-Authored-By: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>

* Update docs/sources/features/datasources/stackdriver.md

Co-Authored-By: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>

* Updates after PR feedback

* add test for when no alias by defined

* fix infinite loop when newVariables feature flag is on

onChange being called in componentDidUpdate produces an
infinite loop when using the new React template variable
implementation.

Also fixes a spelling mistake

* implements feedback for documentation changes

* more doc changes

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
Co-authored-by: Daniel Lee <dan.limerick@gmail.com>
2020-03-27 12:01:16 +01:00
Agnès Toulet
f63877f247
Core: Add go-datemath library (#22978) 2020-03-26 10:26:47 +01:00
huanggze
69c5efcf00
Cleanup: move interface ProvisioningService into provisioning package (#23061) 2020-03-25 14:14:24 +01: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
Andrew Burian
7d9b6a0dee
Alerting: Enable Alert rule tags to override PagerDuty Severity setting (#22736) 2020-03-23 19:32:55 +01:00
Carl Bergquist
3798ac903d
Upgrade golangci-lint and fixes some linting errors. (#22909)
Example: https://play.golang.org/p/cfPIPG3BwjJ
2020-03-23 13:37:53 +01:00
Jon McKenzie
6c9d833602
AuthProxy: Fixes bug where long username could not be cached (#22926) 2020-03-20 21:50:27 +01:00
huanggze
aea3929154
Fix typo (#22923)
Signed-off-by: huanggze <loganhuang@yunify.com>
2020-03-20 12:46:07 +01:00
huanggze
87ffa258e7
cleanup: use unexported variable (#22908)
Signed-off-by: huanggze <loganhuang@yunify.com>
2020-03-20 09:40:14 +01:00
Denis
26626d9073
Prometheus: Render missing labels in legend formats as an empty string (#22355)
* Empty value for unknown Prometheus label (grafana#16041)

* Empty value for unknown Prometheus label (grafana#16041)

* fix linter
2020-03-18 19:57:11 +01:00
Arve Knudsen
bb05989e43
SQLStore: Add migration for adding index on annotation.alert_id (#22876) 2020-03-18 17:59:42 +01:00
Kyle Brandt
0e09a3fe15
Alerting: support alerting on data.Frame (that can be time series) (#22812)
data.Frame (that can be series) are converted to as tsdb.TimeSeriesSlice - so new backend plugins can be shimmed into existing alerting

use sdk v0.31.0
2020-03-18 10:30:07 -04:00
Dima Ryskin
44b7f3ea1c
AlertNotifications: Translate notifications IDs to UIDs in Rule builder (#19882)
* AlertNotifications: Translate notifications IDs to UIDs in alert Rule builder

* Avoid shadowing errors, raise validation error on non-existing notification id

* create a cache for notification Uids to minimize db overhead

* add cache usage test

* avoid caching empty notification Uids

* isolate db in alert notificationUid caching tests
2020-03-18 15:00:56 +02:00
Carl Bergquist
579abad9cc
Plugins: Return jsondetails as an json object instead of raw json on datasource healthchecks. (#22859) 2020-03-18 12:08:52 +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
Dominik Prokop
f345d7f6a3
Plugins: Hide plugins page from viewers, and limit /api/plugins to only core plugins when called by viewer role (#21901)
* Hide plugins list from viewers

* Made /api/plugins only return core plugins for users with viewer role

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
2020-03-16 15:40:46 +01:00
Ryan McKinley
c65db9bf25
Chore: remove expressions flag and allow (#22764) 2020-03-13 07:43:25 -07:00
Carl Bergquist
b1e112923b
aligns the severity dropdown with other fields (#22779) 2020-03-13 14:19:35 +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