Commit Graph

5992 Commits

Author SHA1 Message Date
Owen Diehl
36614b03f7
Data Source Proxy: Migrate proxy to its own service and make more extensible (#31927)
* datasource proxy extensions

* revert normalresponse extensions

* data proxy service impl

* lint

* api datasource proxy method

* moves datasource proxy tests into correct new pkg
2021-03-17 13:10:40 -04:00
Ganesh Vernekar
974ccf8091
AlertingNG: Fix the alerting stage for legacy alerts (#32025)
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
2021-03-17 16:38:33 +00: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
Marcus Efraimsson
c0edf88f9f
Data proxy: Fix encoded characters in URL path should be proxied encoded (#30597)
Fix encoded characters in URL path should be proxied as encoded in the data proxy.

Fixes #26870 
Fixes #31438

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-03-17 12:17:41 +01:00
Sofia Papagiannaki
68b05b8aaa
AlertingNG: Unified alerting API mock (#32040)
* AlertingNG: Alertmanager mock API

* AlertingNG: Remove permissions API routes

* Add example POST payloads

* Prometheus and testing mock API
2021-03-17 12:47:03 +02:00
Giordano Ricci
0c2045109e
Chore: Collect elasticsearch version usage stats (#31787)
* Chore: Collect elasticsearch version usage stats

* Fix lint error

* use GetDataSources from sqlstore

* Apply review suggestions

* Return error if datasource type is not specified

* Update pkg/services/sqlstore/datasource.go

* fix undefined var
2021-03-17 09:14:53 +00:00
Will Browne
8e1c2d6472
move backend docs to their relevant folder (#32041) 2021-03-17 09:41:16 +01:00
Joan López de la Franca Beltran
610999cfa2
Auth: Allow soft token revocation (#31601)
* Add revoked_at field to user auth token to allow soft revokes

* Allow soft token revocations

* Update token revocations and tests

* Return error info on revokedTokenErr

* Override session cookie only when no revokedErr nor API request

* Display modal on revoked token error

* Feedback: Refactor TokenRevokedModal to FC

* Add GetUserRevokedTokens into UserTokenService

* Backendsrv: adds tests and refactors soft token path

* Apply feedback

* Write redirect cookie on token revoked error

* Update TokenRevokedModal style

* Return meaningful error info

* Some UI changes

* Update backend_srv tests

* Minor style fix on backend_srv tests

* Replace deprecated method usage to publish events

* Fix backend_srv tests

* Apply suggestions from code review

Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
Co-authored-by: Hugo Häggmark <hugo.haggmark@gmail.com>

* Apply suggestions from code review

* Apply suggestions from code review

Co-authored-by: Hugo Häggmark <hugo.haggmark@gmail.com>

* Minor style fix after PR suggestion commit

* Apply suggestions from code review

Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>

* Prettier fixes

Co-authored-by: Hugo Häggmark <hugo.haggmark@gmail.com>
Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>
2021-03-16 17:44:02 +01:00
Marcus Efraimsson
a97637a133
Snapshots: Fix usage of sign in link from the snapshot page (#31986)
Fix redirect to login page from snapshot page when not authenticated.

Fixes #28547
2021-03-16 16:46:34 +01:00
Ganesh Vernekar
ecbc98ba5d
AlertingNG: Add alert provider and basic structure with dispatcher, silences and delivery stages (#31833)
* AlertingNG: Add alert provider

Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>

* Add unit tests

Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>

* Alertmanager WIP

* Merge alertmanager into notifier

Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>

* Fixes for PR 31833 (#31990)

Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>

* Use alertmanager from upgrad-uuid temporarily to unblock

Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>

* Fix lint

Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>

Co-authored-by: Josue Abreu <josue@grafana.com>
2021-03-16 10:44:52 +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
Will Browne
9454a4e125
add more context to unknown delta log (#31943) 2021-03-12 15:38:23 +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
Sofia Papagiannaki
fe628c6282
AlertingNG: base API implementation (#31824)
* AlertingNG: base API implementation

* Pass the interface instead of the base impl

* Ruler mock draft (WIP)

* Update alerting-api dependency

* Improve mock implementation
2021-03-11 21:28:00 +02:00
Sofia Papagiannaki
53bccf1b77
Replace eval.Condition with models.Condition (#31909) 2021-03-11 18:56:58 +02:00
Zoltán Bedi
3b6168eb4a
Tempo: Add test for backend data source (#31835) 2021-03-11 08:18:24 +01:00
Will Browne
c40d96d0ab
Plugins: Remove pre-existing plugin installs when installing with grafana-cli (#31515)
* remove old install before install if exists

* fix log format
2021-03-10 19:13:08 +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
Lê Đặng Hoài Nam
7764739a8e
Alerting: Generate random id when testing notification channel (#31844) 2021-03-10 11:24:31 +01:00
Arve Knudsen
04e9f6c24f
UsageStatsService: Don't use global state (#31849)
* UsageStatsService: Don't use global state

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-03-10 10:14:00 +01:00
Erik Sundell
d512c5a1b4
Cloudwatch: ListMetrics API page limit (#31788)
* add list metrics api page limit

* Update docs/sources/datasources/cloudwatch.md

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

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2021-03-10 07:41:22 +01:00
Erik Sundell
2d660ee502
CloudWatch: Restrict auth provider and assume role usage according to Grafana configuration (#31805)
* restrict usage of providers and assume role according to grafana config

* update docs

* Update docs/sources/datasources/cloudwatch.md

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

* Update pkg/tsdb/cloudwatch/cloudwatch.go

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

* Update pkg/tsdb/cloudwatch/session_test.go

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

* pr feedback

* fix failing test

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-03-09 21:20:59 +01:00
Erik Sundell
13dd9dff50
CloudWatch: Add support for EC2 IAM role (#31804)
* add support for iam role auth

* add stubbable func

* fix broken test

* goimports

* pr feedback
2021-03-09 20:50:16 +01:00
Sofia Papagiannaki
4ce0a49eac
AlertingNG: Split into several packages (#31719)
* AlertingNG: Split into several packages

* Move AlertQuery to models
2021-03-08 22:19:21 +02:00
Carl Bergquist
3b36636318
Annotations: Make the annotation clean up batch size configurable (#31487)
Signed-off-by: bergquist <carl.bergquist@gmail.com>

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
2021-03-08 14:16:07 +01:00
Arve Knudsen
fc9381744a
UsageStatsService: Make initialization more robust (#31761)
* UsageStatsService: Make initialization more robust

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-03-08 10:33:20 +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
Carl Bergquist
c899bf3592
log skipped, performed and duration for migrations (#31722)
Signed-off-by: bergquist <carl.bergquist@gmail.com>
2021-03-07 21:26:29 +01:00
Zoltán Bedi
29c998f9eb
Tempo: Convert tempo to backend data source2
This reverts commit c15d1f498a.
2021-03-05 14:28:17 +01:00
Zoltán Bedi
c15d1f498a
Revert "Tempo: convert to backend data source (#31618)" (#31702)
This reverts commit 862f09376f.
2021-03-04 21:20:26 +01:00
Zoltán Bedi
53d4acdad2
Tempo: set authentication header properly (#31699) 2021-03-04 20:39:01 +01:00
Zoltán Bedi
862f09376f
Tempo: convert to backend data source (#31618)
* Tempo: Support opentelemetry response

* Tempo: convert Tempo to backend data source

* Update data source test

* Fix lint issues

* Apply suggestions from code review

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

* Return error when trace not found

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-03-04 18:23:02 +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
Alexander Emelin
8016b3c5ca
Live: Use pure WebSocket transport (#31630) 2021-03-04 09:06:42 +03:00
Sofia Papagiannaki
bd2390c49f
AlertingNG: code refactoring (#30787)
* AlertingNG: refactoring

* Fix tests
2021-03-03 17:52:19 +02:00
Ilya Stoliar
f5d1fa48ca
CloudWatch: Added AWS Timestream Metrics and Dimensions (#31624) 2021-03-03 11:25:45 +02:00
Erik Sundell
580332255d
add new metrics and dimensions (#31595) 2021-03-03 10:18:34 +01:00
Kyle Brandt
a488ab8393
SSE: Add "Classic Condition" on backend (#31511)
This is a translation of services/alerting/conditions. Main Changes:

- Work with types in SSE (series/number) which are data frames (no more null.Float).
- The query part from alerting/conditions is handled by SSE logic
- Convey / simplejson removed.
- Time range no longer part of "query" in the condition
2021-03-02 13:51:33 -05:00
Gábor Farkas
8d39e6640c
InfluxDB: Improve maxDataPoints error-message in Flux-mode, raise limits (#31259)
* influxdb: flux: improve error-message

* influxdb: flux: raise max-points tolerance limit

* influxdb: flux: better error-message

* influxdb: flux: different approach to nice-error-message-generation

* influxdb: flux: removed unnecessary whitespace

* influxdb: flux: better error message, new approach

* influxdb: flux: test max-data-points-exceeded situtation
2021-03-02 18:33:51 +01:00
Labesse Kévin
bd0d051438
Alerting: PagerDuty: adding current state to the payload (#29270)
* adding state to the payload

* fix test

* fix linter

* documentation payload current state

* Apply suggestions from code review

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

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
2021-03-02 17:50:51 +01:00
Ivana Huckova
d5fee5a3f5
Loki: Add support for alerting (#31424)
* Create Loki backend template

* Update endpoint

* Adjust step

* Add test

* Change to use Loki client

* Address feedback, improve errors and comments

* Linting

* Update pkg/tsdb/loki/loki.go

* Update pkg/tsdb/loki/loki.go

* Update pkg/tsdb/loki/loki.go
2021-03-02 14:55:16 +01:00
Hugo Häggmark
d84cfdbb0f
LibraryPanels: Adds version column (#31590)
* Refactor: adds version column and fixes tests

* Chore: adds version check when patching the library panel

* Refactor: adds support for version in FrontEnd
2021-03-02 13:33:26 +01:00
Levi Harrison
d3a590ca19
Alerting: Fix bug in Discord for when name for metric value is absent (#31257)
* Make sure Metric field in Discord notification is never empty

Discord uniquely does not send the alert if the metric field is empty, which can happen in some cases, such as when the legend is {{hostname}}.

Signed-off-by: Levi Harrison <levisamuelharrison@gmail.com>

* Changed name of empty metric in Discord alert

Signed-off-by: Levi Harrison <levisamuelharrison@gmail.com>
2021-03-02 11:37:35 +02:00
Hugo Häggmark
4bc6a7c407
LibraryPanels: Deletes library panels during folder deletion (#31572)
* Refactor: adds permissions for library panel creation

* Refactor: checks folder permissions for patch requests

* Chore: changes after PR comments

* Refactor: adds permissions to delete

* Refactor: moves get all permission tests out of get all tests

* Chore: move out get all tests to a separate file

* Refactor: adds permissions to get handler

* Refactor: fixes a bug with getting library panels in General folder

* Refactor: adds permissions for connect/disconnect

* Refactor: adds permissions and tests for get connected dashboards

* Tests: adds tests for connected dashboards in General Folder

* LibraryPanels: Deletes library panels during folder deletion

* LibraryPanels: Deletes library panels during folder deletion

* Update pkg/api/folder.go

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

* Update pkg/services/librarypanels/librarypanels_permissions_test.go

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

* Chore: updates after PR comments

* Chore: forgot to change some function signatures

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-03-02 10:34:01 +01:00
Ilya Stoliar
ad37077610
CloudWatch: Added AWS Network Firewall metrics and dimensions (#31498) 2021-03-02 06:12:59 +01:00
Will Browne
a606a49cb2
propagate plugin unavailable message to UI (#31560) 2021-03-01 18:54:10 +01:00
Hugo Häggmark
583b94557b
LibraryPanels: Adds folder checks and permissions (#31473)
* Refactor: adds permissions for library panel creation

* Refactor: checks folder permissions for patch requests

* Chore: changes after PR comments

* Refactor: adds permissions to delete

* Refactor: moves get all permission tests out of get all tests

* Chore: move out get all tests to a separate file

* Refactor: adds permissions to get handler

* Refactor: fixes a bug with getting library panels in General folder

* Refactor: adds permissions for connect/disconnect

* Refactor: adds permissions and tests for get connected dashboards

* Tests: adds tests for connected dashboards in General Folder
2021-03-01 15:33:17 +01:00
Torkel Ödegaard
7428668835
Profile: Fixes profile preferences being accessible when anonymous access was enabled (#31516)
* Profile: Fixes profile preferences page being available when anonymous access was enabled

* Minor change

* Renamed property
2021-02-27 18:04:28 +01:00
Dimitris Sotirakis
554055e39d
Convert annotations to dataframes (#31400)
* Stop using transformation to tables

* Update datasource.ts to parse from dataframes

* Add test on transformToDataframe func

* Remove parseResponse and do the work inside parseToAnnotations method

* Name the dataframe after the RefID

* Small fix when mapping to annotation

* Add tests in annotation_query_test.go class

* Small fix in loop iteration

* Change for loop signature
2021-02-25 18:29:17 +02:00
Agnès Toulet
663d44fe82
Login: handle custom token creation error messages (#31283)
* Login: handle custom token creation errors

* Login: handle external error for OAuth responses
2021-02-25 15:30:51 +01:00
M4t3o
0bb4cbdb68
Alerting notifier SensuGo: improvements in default message (#31428)
* add related metrics as default message

* fix CI linter error
2021-02-25 10:52:34 +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
Hugo Häggmark
1725bf773f
Chore: Fixes small typos (#31461) 2021-02-25 08:59:26 +01:00
Kyle Brandt
c9dbf5a0d0
Graphite/SSE: update graphite to work with server side expressions (#31455)
Changes the time value of the response to be milliseconds, which I think is like the other data sources I have seen.

Also if it sees the timerange values as numbers, assumes they are unixMS (and come from expressions, or our new backend.TimeRange type). When this timerange is used, the request is sent to graphite with from and until as epoch timestamps
2021-02-24 13:16:26 -05:00
Erik Sundell
1b149523ed
AWS: Add aws plugin configuration (#31312)
* add new conf and make sure its passed to frontend

* change auth provider name

* goimports

* fixed after feedback

* more updates after feedback

* Update docs/sources/administration/configuration.md

Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>

* Update docs/sources/administration/configuration.md

Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>

* Update docs/sources/administration/configuration.md

Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>

* Update docs/sources/administration/configuration.md

Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>

* Update docs/sources/administration/configuration.md

Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>

* Update conf/sample.ini

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

* Update docs/sources/administration/configuration.md

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

* Update pkg/setting/setting.go

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

* updates after pr feedback

* Update conf/defaults.ini

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

* Update conf/defaults.ini

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

* Update conf/sample.ini

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

Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-02-24 18:08:13 +01:00
Erik Sundell
055590890c
CloudWatch: Make it possible to specify custom api endpoint (#31402)
* wip: add endpoint field

* add endpoint to config and make sure it's part of the cache key

* update docs

* improve endpoint paragraph

* Update docs/sources/datasources/cloudwatch.md

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

* Update public/app/plugins/datasource/cloudwatch/components/ConfigEditor.tsx

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

* goimports

* Update docs/sources/datasources/cloudwatch.md

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

* update snapshot

* Update docs/sources/datasources/cloudwatch.md

Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>
2021-02-24 16:05:14 +01:00
Hugo Häggmark
466462de37
LibraryPanels: Adds permissions to getAllHandler (#31416)
* LibraryPanels: Adds permissions to getAllHandler

* Chore: adds a test to verify the permissions

* Chore: tests refactor
2021-02-24 14:06:22 +01:00
Carl Bergquist
5114fa39ce
we should never log unhashed tokens (#31432)
Signed-off-by: bergquist <carl.bergquist@gmail.com>
2021-02-24 10:04:25 +01:00
ying-jeanne
c57047a420
Postgres: allow providing TLS/SSL certificates as text in addition to file paths (#30353)
* postgres SSL certification

* add back the UI to configure SSL Authentication files by file path

* add backend logic

* correct unittest

* mini changes

* Update public/app/plugins/datasource/postgres/config_ctrl.ts

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

* Update public/app/plugins/datasource/postgres/partials/config.html

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

* mutex

* check file exist before remove

* change permission

* change default configuremethod to file-path

* Update public/app/plugins/datasource/postgres/partials/config.html

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

* Update public/app/plugins/datasource/postgres/partials/config.html

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

* Update public/app/plugins/datasource/postgres/partials/config.html

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

* Update public/app/plugins/datasource/postgres/partials/config.html

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

* rename sslconfiguremethod to sslconfigurationmethod

* frontend update

* solve comments

* Postgres: Convert tests to stdlib

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

* Postgres: Be consistent about TLS/SSL terminology

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

* fix init inconsistancy

* Fix tests

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

* naming convention

* Fix tests

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

* Fix tests

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

* Undo change

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

* Fix TLS issue

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>

* change permissions

* Fix data source field names

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

* Clean up HTML

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

* Improve popover text

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

* Fix SSL input bug

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

* Undo unnecessary change

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

* Clean up backend code

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

* Fix build

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

* More consistent naming

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

* Clean up code

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

* Enforce certificate file permissions

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

* add settings

* Undo changes

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

* fix windows file path

* PostgresDataSource: Fix mutex usage

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

* Fix tests

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

* Update pkg/tsdb/postgres/postgres.go

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

* Apply suggestions from code review

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

* fix compilation

* fix unittest

* Apply suggestions from code review

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

* Apply suggestions from code review

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

* mock function

* change kmutex package

* add kmutex into middleware

* lock connection file per datasource

* add unittest regarding concurrency

* version should be equal

* adding unittest

* fix the loop

* fix unitest

* fix postgres unittst

* remove comments

* move dataPath from arg to tlsManager struct field

* Use DecryptedValues method

Use cached decrypted values instead of
using secure json data decrypt which will
decrypt unchanged values over and over again.

* remove unneeded mutex in tests and cleanup tests

* fix the lint

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2021-02-23 22:10:55 +01:00
Ilya Stoliar
19c12b5451
CloudWatch: Added AWS Ground Station metrics and dimensions (#31362) 2021-02-23 20:36:18 +01:00
Gábor Farkas
1e7f2e93e6
InfluxDB: handle columns named "table" (#30985)
* influxdb: flux: manually calculate table-group-key

* influxdb: flux: added explanation about the group-key
2021-02-23 16:44:33 +01:00
Ivana Huckova
dce67db6ba
Prometheus: Use configured HTTP method for /series and /labels endpoints (#31401)
* Run post-friendly request with set method first

* Improve messaging, retry only when post and specific status code

* Add comments

* Fix backend

* Update public/app/plugins/datasource/prometheus/datasource.ts
2021-02-23 16:31:03 +01:00
Rafael de Elvira
c05cf9fdbb
Add new Cloudwatch AWS/DDoSProtection metrics and dimensions (#31297) 2021-02-23 13:50:40 +01:00
Rubycut
833446645a
Add eu-south-1 cloudwatch region, closes #31197 (#31198) 2021-02-23 10:42:54 +01:00
Alex Khomenko
6db4b40d5b
Data source list: Use Card component (#31326)
* Replace DataSourcesListItem with Card

* Add tests

* Remove unused styles

* Make card heading semi bold

* Make heading semi-bold

* Show type name instead of type id

* Fix key warning

* Update Card

* Fix tests

* Make typeName optional

* remove styling that was just a test

* Make typeName non-optional and fix tests

* Update list key

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
2021-02-22 14:02:10 +02:00
Arve Knudsen
6e549bc95d
Chore: Remove gotest.tools dependency (#31391)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-02-22 11:53:15 +01:00
Torkel Ödegaard
3e55c967ee
Theming: Support for runtime theme switching and hooks for custom themes (#31301)
* WIP Custom themes

* Load custom themes from URL and via event

* Dynamic page background

* Header color change

* Fixing tests and emotion warnings

* Fixed test

* moving cx to getStyles

* Review fixes

* minor change
2021-02-20 09:02:06 +01:00
Leonard Gram
fe74c51d68
SAML: single logout only enabled in enterprise (#31325) 2021-02-19 10:00:30 +01:00
Hugo Häggmark
0a4c3b8779
LibraryPanels: Syncs panel title with name (#31311) 2021-02-19 06:05:21 +01:00
Carl Bergquist
95c8766f86
Usagestats: Exclude folders from total dashboard count (#31320)
Signed-off-by: bergquist <carl.bergquist@gmail.com>
2021-02-18 15:32:47 +01:00
Levi Harrison
e0a6854c36
Correct name of Discord notifier tests (#31277) 2021-02-17 17:24:07 +01:00
Alex Khomenko
c21e45e428
Search: display sort metadata (#31167)
* Search: display metadata

* Search: update SortPicker icon

* Search: display folder meta data

* Search: reset sort picker on layout change

* Search: align tags in Card component

* Search: replace hyphen with dash

* Search: preserve sort state on layout change

* Search: update tests

* Search: fix tests

* Update pkg/services/search/hits.go

Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com>

* Update public/app/features/search/components/SearchItem.tsx

Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com>

* Update public/app/features/search/components/SearchItem.tsx

Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com>

* Update public/app/features/search/types.ts

Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com>

* Search: fix type error

* Search: add General folder name and adjust icon margin

Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com>
2021-02-17 14:06:19 +02:00
Emil Tullstedt
a87dd17501
UsageStats: Purpose named variables (#31264) 2021-02-17 10:19:27 +01:00
Marcus Efraimsson
8f20b13f1c
Snapshots: Disallow anonymous user to create snapshots (#31263) 2021-02-17 09:51:50 +01:00
Carl Bergquist
b5cbbc3db1
only update usagestats every 30min (#31131)
Signed-off-by: bergquist <carl.bergquist@gmail.com>
2021-02-17 09:10:36 +01:00
Hugo Häggmark
06e6bcf091
LibraryPanels: Disconnect before connect during dashboard save (#31235)
* LibraryPanels: Disconnect before connect during dashboard save

* Tests: fixed test

* Chore: updates after PR comments

* Chore: changes from context.Background() to c.Context.Req.Context()

* Chore: fixes lint issue
2021-02-16 13:00:56 +01:00
Arve Knudsen
d27a72f859
IPv6: Support host address configured with enclosing square brackets (#31226)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-02-15 17:55:41 +01:00
Ricky Putra
d56c5285e2
Postgres: Fix timeGroup macro converts long intervals to invalid numbers when TimescaleDB is enabled (#31179)
Fixes #27253
2021-02-15 17:15:57 +01:00
Dafydd
e17198af83
WIP: Skip this call when we skip migrations (#31216) 2021-02-15 12:57:20 +01:00
dependabot[bot]
4f918e37f4
Chore(deps): Bump xorm.io/xorm from 0.8.1 to 0.8.2 (#30773)
* Chore(deps): Bump xorm.io/xorm from 0.8.1 to 0.8.2

Bumps xorm.io/xorm from 0.8.1 to 0.8.2.

Signed-off-by: dependabot[bot] <support@github.com>

* Fix limit for snapshots

* Fix limit for org and users

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2021-02-15 09:59:39 +01:00
Agnès Toulet
7f1f559929
Permissions: Fix team and role permissions on folders/dashboards not displayed for non Grafana Admin users (#31132)
* Cfg: fix hidden users initialization

* add tests

* do not call isHiddenUser function for non-user permission

* do not call isHiddenUser function for non-user permission
2021-02-12 16:08:18 +01:00
Ricky Putra
e21f6a29b7
Alerting: Fix so that sending an alert with the Alertmanager notifier doesn't fail when one of multiple configured URL's are down (#31079)
Fixes behaviour of Notify that returns error when one of the dispatch 
event return error, to maintain high availability, we should return error 
when all dispatched events return error instead.

Fixes #30509
2021-02-11 15:13:53 +01:00
Torkel Ödegaard
cb5928fdb7
PieChart: Progress on new core pie chart (#28020)
Use visx for the Pie chart plugin.

Co-authored-by: Oscar Kilhed <oscar.kilhed@grafana.com>
2021-02-11 14:32:33 +01:00
Arve Knudsen
7394c98d38
MuxWriter: Handle error for already closed file (#31119)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-02-11 10:34:51 +01:00
Domas
5c9a10d423
Logging: sourcemap transform asset urls from CDN in logged stacktraces (#31115) 2021-02-11 11:00:55 +02:00
Agnès Toulet
3303e28b38
Search: add sort information in dashboard results (#30609)
* Search: add SortMeta in dashboard results

* fix integration tests

* trim SortMeta

* fix searchstore tests

* Update pkg/services/sqlstore/dashboard.go

Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>

Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
2021-02-11 08:49:16 +01:00
Andrej Ocenas
e0448513eb
Influx: Make max series limit configurable and show the limiting message if applied (#31025)
* Add configuration in ConfigEditor and default to 1000

* Show data in explore if any even if there is an error

* Update pkg/tsdb/influxdb/flux/executor.go

* Better handling of defaults

* Add test for runQuery to show data even with error

* Update public/app/store/configureStore.ts

Co-authored-by: Giordano Ricci <gio.ricci@grafana.com>

* Update public/app/plugins/datasource/influxdb/components/ConfigEditor.tsx

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>

* Update tooltip

* Update input

* Lint fixes

* Update snapshots

* Update decorator tests

Co-authored-by: Giordano Ricci <gio.ricci@grafana.com>
Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
2021-02-10 15:23:19 +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
Carl Bergquist
d1b9fddb4f
Usage stats: Adds source/distributor setting (#31039)
Signed-off-by: bergquist <carl.bergquist@gmail.com>
2021-02-10 10:07:32 +01:00
Will Browne
da3f963987
convert path to posix by default (#31045) 2021-02-09 16:21:45 +01:00
Nutmos
45b9ea7b4e
Prometheus: Min step defaults to seconds when no unit is set to prevent errors when running alerts. (#30966)
* update interval to fix no unit

* fix bug

* update with new method

* format go

* add test

* change test method to add test error nil

* add simplejson and model package

* change json format

* add parentheses

* add simplejson to function

* change mode to model

* move assert import package

* add one enter to avoid goimport error

* change to test case
2021-02-09 10:23:38 +01:00
Carl Bergquist
49e394e167
instrumentation: make the first database histogram bucket smaller (#30995)
Signed-off-by: bergquist <carl.bergquist@gmail.com>
2021-02-08 19:51:48 +01:00
Peter Holmberg
aaf5710748
AlertingNG: Edit Alert Definition (#30676)
* break out new and edit

* changed model to match new model in backend

* AlertingNG: API modifications (#30683)

* Fix API consistency

* Change eval alert definition to POST request

* Fix eval endpoint to accept custom now parameter

* Change JSON input property for create/update endpoints

* model adjustments

* set mixed datasource, fix put url

* update snapshots

* remove edit and add landing page

* remove snapshot tests ans snapshots

* wrap linkbutton in array

Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>
Co-authored-by: Sofia Papagiannaki <sofia@grafana.com>
2021-02-04 09:13:02 +01:00
Domas
21817055bd
Logging: sourcemap support for frontend stacktraces (#30590) 2021-02-04 08:37:28 +02: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
Ash Caire
4ed283e7bf
Alerting: Customise OK notification priorities for Pushover notifier (#30169)
* pushover: Customise OK notification priorities

* Apply suggestions from code review

* Fix build failure

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

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

Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>

* Update docs

* 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>
Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>
Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
2021-02-03 10:57:18 +02:00
Torkel Ödegaard
64254eaa82
CDN: Fixes cdn path when Grafana is under sub path (#30822) 2021-02-02 12:34:59 +01:00
Sofia Papagiannaki
5d029abc42
AlertingNG: change API permissions (#30781) 2021-02-02 10:37:01 +02:00
Hugo Häggmark
179f35a537
PanelLibrary: Adds library panel meta information to dashboard json (#30770) 2021-02-02 06:25:35 +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
Will Browne
3b7b49a4aa
Auth: Use SigV4 lib from grafana-aws-sdk (#30713)
* replace with lib

* remove test + apply feedback
2021-02-01 16:07:27 +01:00
Sofia Papagiannaki
2f394a219b
Expressions: Measure total transformation requests and elapsed time (#30514)
* Measure transformation number and elapsed time

* Change histogram to summary

* Apply suggestions from code review

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2021-02-01 15:48:02 +02:00
Torkel Ödegaard
561a0a2995
CDN: Fix passing correct prefix to GetContentDeliveryURL (#30777) 2021-02-01 11:00:53 +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
大可
e0356f7b13
Chore: remove __debug_bin (#30725) 2021-01-29 13:49:20 -08: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
Marcus Efraimsson
f62eb28f3e
Datasource: Use json-iterator configuration compatible with standard library (#30732)
This will make sure that any map keys in JSON is ordered in /api/ds/query response.
2021-01-29 15:31:19 +01:00
Hugo Häggmark
0b1f5c5e32
PanelLibrary: better handling of deleted panels (#30709) 2021-01-29 06:11:13 +01:00
Hugo Häggmark
0a8eae2c12
PanelLibrary: changes casing of responses and adds meta property (#30668)
* PanelLibrary: changes casing of responses and adds meta property

* Chore: updates comments

* Chore: updates after PR comments

* Chore: changes casing of orgId
2021-01-28 12:36:28 +01:00
David
1bdd3eb3dd
Influx: Show all datapoints for dynamically windowed flux query (#30688) 2021-01-28 11:36:17 +01:00
Ryan McKinley
bc857986b6
Chore: remove CSP debug logging line (#30689) 2021-01-27 13:31:41 -08:00
Sofia Papagiannaki
1c158744e8
AlertingNG: pause/unpause definitions via the API (#30627)
* AlertingNG: pause/unpause definitions via the API

* Apply suggestions from code review

Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>

* Enable pausing/unpausing multiple definitions

Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
2021-01-27 15:51:00 +02:00
Vardan Torosyan
1d399b89ea
Usage Stats: Remove unused method for getting user stats (#30074)
* Usage Stats: Remove unused method for getting user stats

This was used in enterprise codebase, but is not longer in use, thus can be safely removed.

* Force refresh user stats in tests
2021-01-26 14:13:25 +01:00
Sofia Papagiannaki
9ada4b6052
Expressions: Add option to disable feature (#30541)
* Expressions: Add option to disable feature

* Apply suggestions from code review

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2021-01-22 19:27:33 +02:00
Arve Knudsen
be8ba8ef46
Postgres: Convert tests to stdlib (#30536)
* Postgres: Convert tests to stdlib

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-01-22 10:34:53 -05:00
Arve Knudsen
7126a91901
Postgres: Be consistent about TLS/SSL terminology (#30532)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-01-22 14:53:37 +01:00
Will Browne
7562c6749d
Cloud Monitoring: Fix legend naming with display name override (#30440)
* Cloud Monitoring: Fix legend naming with display name override

* include MQL queries

* cover all bases

* refactor
2021-01-21 15:08:57 +01:00
Silje Enge Kristensen
c91db6ae17
Chore: fix spelling mistake (#30473) 2021-01-21 09:17:46 +01:00
Erik Sundell
d9d27340b5
prevent field config from being overwritten (#30437) 2021-01-20 16:40:37 +01:00
Hugo Häggmark
b7b6632a4d
PanelLibrary: adding library panels to Dashboard Api (#30278)
* Wip: First naive impl

* Chore: fix after merge

* Chore: changes after PR comments

* Chore: removes unused types

* Chore: adds feature toggle

* Refactor: adds library panels cleanup and connect when storing dashboards

* Refactor: adds feature toggle

* Update pkg/services/librarypanels/librarypanels.go

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

* Update pkg/services/librarypanels/librarypanels.go

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

* Refactor: adds disconnect library panels when deleting a dashboard

* Chore: changes after PR comments

* Tests: adds tests for LoadLibraryPanelsForDashboard

* Tests: adds tests for CleanLibraryPanelsForDashboard

* Tests: adds tests for ConnectLibraryPanelsForDashboard

* Tests: adds tests for DisconnectLibraryPanelsForDashboard and small refactor

* Update pkg/services/librarypanels/librarypanels_test.go

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

* Update pkg/services/librarypanels/librarypanels_test.go

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

* Update pkg/services/librarypanels/librarypanels_test.go

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

* Update pkg/services/librarypanels/librarypanels_test.go

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

* Refactor: deletes all connections in one call and connects all in the same transaction

* Chore: adds better comments

* Chore: changes after PR comments

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-01-20 09:28:10 +01:00
Erik Sundell
de7d163d24
Cloud Monitoring: Add curated dashboards for the most popular GCP services (#29930)
* Add dashboards that are converted from GCP format

* Changes according to pr feedback

* Remove dashboards that could not be tested using real data
2021-01-20 08:42:00 +01:00
Daniel Lee
b39df22574
Mssql integrated security (#30369)
* update go-mssqldb package

* mssql: support for Windows integrated security

Adds a dropdown to the config page to choose between
SQL Server auth and Windows auth. If the login/username
is empty then the go-mssqldb driver will use single sign on
(Windows integrated security) if on Windows.

* mssql: update ds - don't ignore the user column
2021-01-20 08:23:09 +01:00
Will Browne
c9da053e5d
Alerting: Evaluate data templating in alert rule name and message (#29908)
* evaluate Go style template

* inlince func

* add test case

* PR feedback and add tests for templte data map func

* Add test case

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

* do regex check

* ensure ecape

* small cleanup

* dont exit on template execution errors

* add info tooltip

* add docs

* switch from go tmpl to regex

* update docs/comments

* update tooltip wording

* update docs wording

* add simple test

* avoid .MustCompile

* point to labels in docs

* update docs

* fix docs links

* remove line

* fix lint

* add note about multiple labels

* propagate labels for CM

* update docs

* remove whitespace

* update task title

* update docs

* pr feedback

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-01-19 22:02:44 +01:00
Kyle Brandt
d4edcd1838
Expressions: Remove feature toggle (#30316)
* Expressions: remove feature toggle, add experimental badge
* Make button only show for backend and mixed data sources

Co-authored-by: Peter Holmberg <peter.hlmbrg@gmail.com>
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
2021-01-19 14:18:06 -05:00
Arve Knudsen
116809ed7f
services/provisioning: Various cleanup (#30396)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-01-19 18:57:09 +01:00
Sofia Papagiannaki
b1debc9c46
AlertingNG: Enforce unique alert definition title (non empty)/UID per organisation (#30380)
* Enforce unique alert definition title/uid per org

* Remove print statement from test

* Do not allow empty alert definition titles

* update error message on dup title

* also add title error to update

* CamelCase json properties

* Add test for title unique enforcement in updates

Co-authored-by: kyle <kyle@grafana.com>
2021-01-19 19:11:11 +02:00
Agnès Toulet
2a70c73025
Auth: add expired token error and update CreateToken function (#30203)
* Auth: add error for expired token

* Auth: save token error into context data

* Auth: send full user and req context to CreateToken

* Auth: add token ID in context

* add TokenExpiredError struct

* update auth tests

* remove most of the changes to CreateToken func

* clean up

* Login: add requestURI in CreateToken ctx

* update RequestURIKey comment
2021-01-19 17:55:53 +01:00
Andrej Ocenas
218a8de220
NodeGraph: Add node graph visualization (#29706)
* Add GraphView component

* Add service map panel

* Add more metadata visuals

* Add context menu on click

* Add context menu for services

* Fix service map in dashboard

* Add field proxy in explore linkSupplier

* Refactor the link creation

* Remove test file

* Fix scale change when view is panned

* Fix node centering

* Don't show context menu if no links

* Fix service map containers

* Add collapsible around the service map

* Fix stats computation

* Remove debug log

* Fix time stats

* Allow string timestamp

* Make panning bounded

* Add zooming by mouse wheel

* Clean up the colors

* Fix stats for single trace graph

* Don't show debug config

* Add more complex layout

* Update layout with better fixing of the root nodes

* Code cleanup

* Change how we pass in link creation function and some more cleanup

* Refactor the panel section into separate render methods

* Make the edge hover more readable

* Move stats computation to data source

* Put edge labels to front

* Simplify layout for better multi graph layout

* Update for dark theme

* Move function to utils

* Visual improvements

* Improve context menu detail

* Allow custom details

* Rename to NodeGraph

* Remove unused dependencies

* Use named color palette and add some fallbacks for missing data

* Add test data scenario

* Rename plugin

* Switch scroll zoom direction to align with google maps

* Do some perf optimisations and rise the node limit

* Update alert styling

* Rename function

* Add tests

* Add more tests

* Change data frame column mapping to use column names

* Fix test

* Fix type errors

* Don't show context menu without links

* Add beta status to panel

* Fix tests

* Changed function to standard methods

* Fix typing

* Clean up yarn.lock

* Add some UI improvements

- better styling of the zoom buttons
- disable buttons when max reached

* Fix panel references after rename

* Add panel icon
2021-01-19 16:34:43 +01:00
Sofia Papagiannaki
8c31e25926
AlertingNG: Save alert instances (#30223)
* AlertingNG: Save alert instances

Co-authored-by: Kyle Brandt <kyle@grafana.com>

* Rename alert instance fields/columns

* Include definition title in listing alert instances

* Delete instances when deleting defintion

Co-authored-by: Kyle Brandt <kyle@grafana.com>
2021-01-18 20:57:17 +02: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
Mitsuhiro Tanda
717827725f
Cloud Monitoring: MQL support (#26551)
* cloud monitoring mql support

* reduce nesting

* remove resource type from deep link since. its removed for two reasons. first of all it is not needed for the link to work. secondly, by adding the resource type, the the link will differ from the query in grafana which I think is misleading

* use frame.meta.executedQueryString instead of legacy meta

Co-authored-by: Erik Sundell <erik.sundell87@gmail.com>
2021-01-18 13:48:43 +01:00
Arve Knudsen
62485898e4
grafana-cli: Fix security issue (#28888)
* grafana-cli: Fix security issue

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

* grafana-cli: Add and improve tests

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-01-15 17:50:50 +01:00
Sofia Papagiannaki
2b15581339
AlertingNG: Modify queries and transform endpoint to get datasource UIDs (#30297)
* Pass skipCache from context

* Use macaron Params instead of ParamsEscape for UIDs

* Modify queries and transform to get datasource UIDs

* Update github.com/grafana/grafana-plugin-sdk-go to v0.83.0
2021-01-15 18:33:50 +02:00
Alexander Zobnin
d6b468187e
Plugins: Add Open Distro to the list of data sources supported by sigv4 (#30308) 2021-01-15 17:01:29 +03:00
Hugo Häggmark
3d41267fc4
Chore: Moves common and response into separate packages (#30298)
* Chore: moves common and response into separate packages

* Chore: moves common and response into separate packages

* Update pkg/api/utils/common.go

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

* Chore: changes after PR comments

* Chore: move wrap to routing package

* Chore: move functions in common to response package

* Chore: move functions in common to response package

* Chore: formats imports

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-01-15 14:43:20 +01:00
Chris Cowan
5088e2044a
Elasticsearch: Support extended stats and percentiles in terms order by (#28910)
Adds support to the terms aggregation for ordering by percentiles and extended stats. 

Closes #5148

Co-authored-by: Giordano Ricci <grdnricci@gmail.com>
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2021-01-15 12:10:16 +01:00
ying-jeanne
65b0365aeb
Cloud Monitoring: Convert datasource to use Dataframes (#29830)
* Convert Cloud Monitoring (Stackdriver) Datasource to use Dataframes #29830

* add deeplink into config

* omggggggggggggggg this deeplink works!

* move unit to the backend part

* remove unit from frontend

* only set the config fields[1] for deeplink and unit

* refactory + fix some test

* remove frontend test for unit

* adding backend test for unit mapping

* resolve review

* rewrtie unit logic to do exactly the same as frontend filter

* refactory
2021-01-14 14:16:20 +01:00
Chris Cowan
3d7748d9f8
Elasticsearch: Use minimum interval for alerts (#30049)
The current backend code doesn't honor the minimum interval set in the UI for alerts using 
the Elasticsearch data source. This means that the data the alerts are triggering against 
will never match the data in the visualization if auto is used in the date histogram as interval. 
This fixes the problem to make sure that date histogram auto interval is set according to 
min interval set in UI for the query or fallback to data source min interval setting.

Fixes #22082

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2021-01-14 10:48:59 +01:00
Will Browne
a0a1422b2d
Auth: Add missing request headers to SigV4 middleware allowlist (#30115)
* Auth: Add Content-Type to SigV4 header allowlist

* add MT headers to permitted headers

* add Kibana API header to allowlist

* add Content-Length header to allow list
2021-01-14 09:06:09 +01:00
Kyle Brandt
1c1a800bc0
API: Add by UID routes for data sources (#29884)
- also add Get by UID+OrgID to datasource cache
- Refactor backend commands for Delete and Get to be unified
2021-01-13 13:16:27 -05:00
Erik Sundell
64d600f971
Cloudwatch: Move deep link creation to the backend (#30206)
* get meta data from dataframe meta

* gmdMeta is not used anymore

* wip: move deep link creation to backend

* Refactor backend. Remove not used front end code

* Unit test deep links. Remove not used frontend tests

* remove reference to gmdmeta

* fix goimports error

* fixed after pr feedback

* more changes according to pr feedback

* fix lint issue

* fix bad math expression check and fix bad test

* Decrease nesting

* put link on first data field only
2021-01-13 15:30:09 +01:00
Arve Knudsen
0e2f1fe3f5
Metrics API: Use jsoniter for JSON encoding (#30250)
* QueryMetricsV2: Stream response

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

* API: Use jsoniter instead of standard JSON package

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-01-13 15:20:25 +01:00
Tom Wilkie
07aa956667
Add option in database config to skip migrations for faster startup. (#30146)
Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
2021-01-13 13:46:16 +00: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
Hugo Häggmark
d6449c16c7
LibraryPanels: adds connections (#30212)
* LibraryPanels: adds connections

* Chore: testing signing verification

* Update pkg/services/librarypanels/librarypanels_test.go

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

* Update pkg/services/librarypanels/librarypanels_test.go

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

* Update pkg/services/librarypanels/librarypanels_test.go

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

* Update pkg/services/librarypanels/librarypanels_test.go

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

* Update pkg/services/librarypanels/librarypanels_test.go

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

* Update pkg/services/librarypanels/librarypanels_test.go

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

* Update pkg/services/librarypanels/librarypanels_test.go

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

* Chore: changes after PR comments

* Chore: changes after PR comments

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-01-12 12:57:40 +01:00
Arve Knudsen
50b649a869
Middleware: Add CSP support (#29740)
* Middleware: Add support for CSP

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

Co-authored by @iOrcohen
2021-01-12 07:42:32 +01:00
Sofia Papagiannaki
551428af61
Fix alert definition routine stop (#30117) 2021-01-11 16:14:03 +02:00
Torkel Ödegaard
ba158e72df
GraphNG: Minor polish & updates to new time series panel and move it from alpha to beta (#30163)
* GraphNG: Minor polish & updates to new time series panel

* Fixed gradient default

* Updated snapshot
2021-01-10 17:41:20 +01:00