Commit Graph

6442 Commits

Author SHA1 Message Date
Sofia Papagiannaki
8a3edf280e
Alerting: Fix prometheus API to check folder permissions (#36301) 2021-07-05 10:49:14 +03:00
Marcus Efraimsson
b26b922658
Contribute: Ongoing refactoring of context.Context everywhere (#36363) 2021-07-02 17:07:21 +02:00
Leonard Gram
09a96ad2ad
Azure OAuth: debug logs for user information (#36389) 2021-07-02 16:24:33 +02:00
Karl Persson
2fd7031102
Access Control: Add fine-grained access control to explore (#35883)
* add fixed role for datasource read operations

* Add action for datasource explore

* add authorize middleware to explore index route

* add fgac support for explore navlink

* update hasAccessToExplore to check if accesscontrol is enable and evalute action if it is

* add getExploreRoles to evalute roles based onaccesscontrol, viewersCanEdit and default

* create function to evaluate permissions or using fallback if accesscontrol is disabled

* change hasAccess to prop and derive the value in mapStateToProps

* add test case to ensure buttons is not rendered when user does not have access

* Only hide return with changes button

* remove internal links if user does not have access to explorer

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
2021-07-02 14:43:12 +02:00
Selene
ef05596e07
Allow white labeling loading logo (#36174)
* Allow to whitelabeling loading logo

* Add loading_logo to documentation

* Change loading_logo to loading_logo_url
2021-07-02 14:17:10 +02:00
ying-jeanne
54acb18c5f
migrate away from goconvey (#36203) 2021-07-02 19:22:47 +08:00
Andres Martinez Gotor
30dc4025c2
Remove AWS CW client cache (#36311) 2021-07-02 10:13:23 +02:00
Ward Bekker
b255f3db3f
Team Sync: Add group mapping to support team sync in the Generic OAuth provider (#36307)
Added group mapping to support team sync in the Generic OAuth provider.

Co-authored-by: Leonard Gram <leo@xlson.com>
Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
Co-authored-by: Dan Cech <dan@aussiedan.com>
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2021-07-01 22:40:46 +02:00
Dimitris Sotirakis
084c9c8746
Dashboards: Add IsFolder field into models.GetDashboardQuery (#36214)
* Add IsFolder field into models.GetDashboardQuery

* Reverted folderId - return dummy success when calling get folder with id 0

* Moved condition to upper level - add test
2021-07-01 11:40:38 +03:00
Hugo Häggmark
44c48ecebb
Chore: Replace util.DynMap with structs (#36332)
* Chore: Replace util.DynMap

* Chore: added comments
2021-07-01 10:23:33 +02:00
Alexander Emelin
483418dbb0
live: add allowed_origins option (#36318) 2021-07-01 09:30:09 +03:00
idafurjes
7231eba6a5
Chore: Refactor OpenTSDB using backend SDK (#35815)
* Refactor OpenTSDB using backend SDK

* Adjust tests to the SDK refactor

* Remove openTSDB from service

* Rename OpenTASDB service to Service, use AuthPassword from DecryptedSecureJson

* Devenv: Add opentsdb v2.3 data source and dashboard

* Letting http client provider to set basic auth,
renaming,
casting datasource direclty to pointer

* Update pkg/tsdb/opentsdb/opentsdb.go

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

* Update pkg/tsdb/opentsdb/opentsdb.go

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

* Format struct

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2021-06-30 15:58:44 +02:00
Hugo Häggmark
63f9231de1
Annotations: Adds tags endpoint (#36199)
* Annotations: Adds tags endpoint

* Chore: fixes sql  statement

* Refactor: adds count to the api

* Chore: changes after PR comments

* Refactor: changes after PR comments
2021-06-30 13:42:54 +02:00
Andres Martinez Gotor
a4368790d5
AzureMonitor: Add an error message if a request failed with deprecated creds (#36136) 2021-06-29 10:39:28 +02:00
Sergey Kostrukov
52e38c54e5
AzureMonitor: token provider into aztokenprovider and cleanup (#36102) 2021-06-29 10:05:42 +02:00
Sarah Zinger
493d35ccc6
Azure monitor: ensure that time column has a name (#36144)
Fixes bug when switching from Timeseries to Table view when viewing Azure Monitor Metrics Data.
2021-06-28 08:28:56 -04:00
Ester Martí Vilaseca
81a79aef23
Elasticsearch: add rate aggregation (#33311)
* Elasticsearch: add first version of rate aggregation

* Add test for rate aggreation settings editor

* Fix unit

* Add default value for mode for rate agg

* Add todo

* Revert "Add default value for mode for rate agg"

This reverts commit a44c985d8b.

* Fix width when select is empty

* Add rate aggregation to elasticsearch models

* Remove rate aggregation from extended stats

* Move elastic2 docker block & add elastic (latest)

* Add versionRange to rate aggregation

* add 7.10 elasticsearch version option

* Set supportsInlineScript to true for rate aggregation

* Remove fixed width from select

* Change seconds label for rate aggregation unit options dropdown

Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>

Co-authored-by: Elfo404 <me@giordanoricci.com>
Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>
2021-06-28 11:55:31 +01:00
Piotr Jamróz
faf25bc4ea
Graphite: Interpolate Graphite alerts with tags (#35887) 2021-06-27 23:58:50 +02:00
Ryan McKinley
035eec1502
Testdata: use UTC time and circle alcatraz for streaming flight sample 2021-06-27 10:17:01 -07:00
Dimitris Sotirakis
4f3bc71caa
Chore: Update tests to prevent test-backend step from failing the pipeline (#36155)
* Chore: Update flight-simple-X.txt

* Fix api_notification_channel_test.go failing test
2021-06-25 10:32:01 +02:00
Ganesh Vernekar
8fe58fc2e3
Alerting: Add additional newlines to Microsoft Teams notification message where necessary (#36126)
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2021-06-24 20:52:00 +05:30
Ganesh Vernekar
f2bb3faea8
Alerting: Add integration test case for email channel (#36029)
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2021-06-24 20:31:29 +05:30
Alexander Emelin
98893c0420
Live: experimental HA with Redis (#34851) 2021-06-24 11:07:09 +03:00
Kyle Brandt
19f764739b
Alerting: Change __value__ label to __value_string__ annotation and add ValueString variable in notifications (#36032)
* Alerting: Allow __value__ label in notifications
was being removed by removePrivateItems
discoverd in #36020, but issue is not about that specifically

* __value__ label to __value_string__ annotation
and .ValueString extended property for notifications
2021-06-24 12:45:49 +05:30
Alexander Emelin
5bbf45592e
Live: rely on app url for origin check (#35983) 2021-06-23 19:51:03 +03:00
Ryan McKinley
8ad9834019
TestData: add simple scenario with GPS and altitude coordinates (#36011) 2021-06-22 14:19:29 -07:00
Ganesh Vernekar
9a5c1f06df
Alerting: Template all possible variables in notification channels (#35749)
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2021-06-22 15:12:54 +05:30
Sofia Papagiannaki
91cf062d0b
Alerting: fix conflicting folder and dashboard permissions during migration (#35967)
* Alerting: Fix conflicting user and team permissions

* Avoid duplicate perrmissions

* Fix lint

Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>

Co-authored-by: Ganesh Vernekar <ganeshvern@gmail.com>
2021-06-22 12:07:52 +05:30
ying-jeanne
73fdd9dc22
[MYSQL] convert explicitely smallint and tinyint (#35897)
* [MYSQL] convert explicitely smallint and tinyint

* clean up code

* fix comments
2021-06-22 00:10:45 +08:00
Tom Pickles
b05b5d5e3b
AzureMonitor: Fix queries with Microsoft.NetApp/../../volumes resources (#32661)
* Extend description of existing tests (#28350)

* Tests for building MetricNamespaces URL (#28350)

* Added tests that break the URL builder (#28350)

* Arbitrary length of metric definition (#28350)

* Change var to const as requested (#32661)

* Adding tests to datasource url builder (#28350)

* Fixes to datasource url builder (#28350)

* Fixed linting issue that broke build (#28350)
2021-06-21 13:05:13 +01:00
Carl Bergquist
9ef4c21033
add context to getsignedinUser calls (#35963)
Signed-off-by: bergquist <carl.bergquist@gmail.com>
2021-06-21 07:51:33 +02:00
Ganesh Vernekar
33d6e11175
Alerting: Decouple default template from channel tests (#35239)
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2021-06-21 07:59:09 +05:30
Dimitris Sotirakis
0d08881876
Elasticsearch: Convert Timeseries and Tables to Dataframes (#34710)
* Rebase (broken tests)

* Removed tables - refactored processAggregationDocs func

* Tests cleanup

* Nit - add space in percentile legend titles

* Fix labels naming - use metricAggType map

* Fix bug which appended same fields over and over again

* Replace test with dataframes

* Fix tests

* Add nolint:gocyclo - will need refactoring

* Move frames tags assignment

* Add failing test fo when ES server is booting up

* Revert "Add failing test fo when ES server is booting up"

This reverts commit fd14a1fd5e.

Co-authored-by: Elfo404 <me@giordanoricci.com>
2021-06-18 13:26:19 +03:00
Ryan McKinley
1d6e99bc95
SQL: Fixes issues with showing value column name prefix in legends (#35839)
* rename strategy

* Update pkg/tsdb/sqleng/sql_engine.go

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

* more strict constraints

* Fixed so that it works on multi series results

* only apply the logic when original query returns 3 fields

* removed part of comment

* Update mysql test

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
2021-06-18 08:05:23 +02:00
David Parrott
4732f832f7
Alerting: recalculate EndsAt (#35830)
* setEndsAt

* one more test case

* add should clause to tests
2021-06-17 10:01:46 -07:00
Sofia Papagiannaki
5e534d212c
Alerting: Fix alert permissions migration (#35869)
* Alerting: Fix alert permissions migration

for MySQL >= 5.7 and PostgreSQL

* Do not use import struct
2021-06-17 15:49:56 +03:00
Marcus Efraimsson
477d4197fb
Chore: Improve save dashboard error messages (#35780)
Includes panel and dashboard id in alert
extractor errors.
Logs all non-400 dashboard errors.

Fixes #35751
2021-06-16 14:56:55 +02:00
Ganesh Vernekar
dcd4bf1615
Alerting: Fill the empty GeneratorURL (#35740)
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2021-06-16 15:34:12 +05:30
Sofia Papagiannaki
e5a5b8e3fe
Alerting: Fix updating alert rule properties with missing/zero values (#35512)
* Fix deleting labels and annotations

* Add test

* Keep no data and error start if not provided

* Allow setting interval and for to zero during rule updates
2021-06-15 20:55:25 +03:00
Sofia Papagiannaki
abe35c8c01
Alerting: Add error recovery during rule evaluations (#35450)
* Alerting: Eval recovery after query failure

* Apply suggestions from code review
2021-06-15 19:30:21 +03:00
gotjosh
f7ed35336d
Alerting: Implement /status for the notification system (#33227)
* Alerting: Implement /status for the notification system

Implements the necessary plumbing to have a /status endpoint on the
notification system.

* Add API examples

* Update API specs

* Update prometheus/common dependency

Co-authored-by: Sofia Papagiannaki <sofia@grafana.com>
2021-06-15 19:14:02 +03:00
Carl Bergquist
b40e78a943
Instrumentation: add context.Context to the dashboard get flow. (#34955)
Signed-off-by: bergquist <carl.bergquist@gmail.com>
2021-06-15 16:08:27 +02:00
Andres Martinez Gotor
6b786e7f68
Avoid log entry if not set for debug (#35741) 2021-06-15 15:03:24 +02:00
Andrej Ocenas
9a3e3014dd
CloudWatch/Logs: Fix missing response data for log queries (#35724) 2021-06-15 14:42:55 +02:00
Will Browne
adbb15a3a7
Plugins: fix test with bad symlink target (#35737) 2021-06-15 13:53:09 +02:00
Will Browne
303352a89b
Plugins: Ignore symlinked folders when verifying plugin signature (#34434)
* add check + test

* fix test

* add manifest

* fix linter

* add nolint

* separate err cond checks

* only collect relevant plugin files

* skip symlinks

* refactor

* add missing test files + enable scanning Chromium.app/

* remove test since case already covered

* remove unnecessary changes from before

* refactor

* remove comment
2021-06-15 11:55:47 +02:00
Domas
5b5cb94809
Fix: fix loading symbolically linked plugins (#35635) 2021-06-15 09:10:30 +03:00
Sofia Papagiannaki
c997f646cc
Alerting: Fix alert migration RefID generation (#35667)
* Alerting: Fix alert migration RefID generation

if the alert has more than 26 conditions

* Remove TODO comment

* Make similar change under pkg/expr
2021-06-14 22:13:45 +03:00
Tobias Skarhed
7f882eea05
Login: Require user to not be signed in to get request password email (#35421) 2021-06-14 18:02:05 +02:00
Karl Persson
395b942134
Access Control: Add fine-grained access control to GET stats and settings handlers (#35622)
* add accesscontrol action for stats read

* use accesscontrol middleware for stats route

* add fixed role with permissions to read sever stats

* add accesscontrol action for settings read

* use accesscontrol middleware for settings route

* add fixed role with permissions to read settings

* add accesscontrol tests for AdminGetSettings and AdminGetStats

* add ability to scope settings

* add tests for AdminGetSettings
2021-06-14 17:36:48 +02:00